Skip to content

Commit

Permalink
Show hide room settings button
Browse files Browse the repository at this point in the history
  • Loading branch information
sbanca committed Jan 25, 2025
1 parent 973e6ef commit e8547c9
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 11 deletions.
13 changes: 7 additions & 6 deletions Assets/Prefabs/Panels/MultiplayerPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ MonoBehaviour:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
m_RoomSettingsButton: {fileID: 4513402330335811974}
references:
version: 2
RefIds: []
Expand Down Expand Up @@ -1703,7 +1704,7 @@ MonoBehaviour:
m_TableReference:
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
m_TableEntryReference:
m_KeyId: 294637073212186624
m_KeyId: 326572252843143168
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
Expand Down Expand Up @@ -2033,12 +2034,12 @@ GameObject:
- component: {fileID: 4873125866289393846}
- component: {fileID: 5322833515426493788}
m_Layer: 16
m_Name: MultiplayerRoomSettings
m_Name: RoomSettings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &7486361010185590075
Transform:
m_ObjectHideFlags: 0
Expand All @@ -2048,8 +2049,8 @@ Transform:
m_GameObject: {fileID: 4513402330335811974}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.63, y: -0.44700006, z: -0.042}
m_LocalScale: {x: 0.33, y: 0.33, z: 0.33}
m_LocalPosition: {x: 0.177, y: 0.853, z: -0.042}
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8346410928580794432}
Expand Down Expand Up @@ -2144,7 +2145,7 @@ MonoBehaviour:
m_TableReference:
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
m_TableEntryReference:
m_KeyId: 294637000357126144
m_KeyId: 326570591894564864
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
Expand Down
25 changes: 25 additions & 0 deletions Assets/Scripts/GUI/MultiplayerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class MultiplayerPanel : BasePanel
[SerializeField] private LocalizedString m_AlertsErrorBeginnerModeActive;
[SerializeField] private LocalizedString m_AlertsRoomAlreadyExistent;
[SerializeField] private LocalizedString m_AlertsPassThroughAcive;
[SerializeField] private GameObject m_RoomSettingsButton;

private PlayerPrefsDataStore m_multiplayer;
private bool updateDisplay = false;
Expand Down Expand Up @@ -271,6 +272,7 @@ private void OnStateUpdated(ConnectionState newState)
{
if (!m_State) return;
m_State.text = m_StatString.GetLocalizedString() + StateToString(newState);
DisplayRoomSettingsButton(newState);
UpdateDisplay();
}

Expand Down Expand Up @@ -301,6 +303,29 @@ private string StateToString(ConnectionState newState)
}
}

private void DisplayRoomSettingsButton(ConnectionState newState)
{
if (!m_RoomSettingsButton) return;

switch (newState)
{
case ConnectionState.IN_ROOM:
m_RoomSettingsButton.SetActive(true);
break;
case ConnectionState.INITIALIZING:
case ConnectionState.INITIALIZED:
case ConnectionState.DISCONNECTED:
case ConnectionState.DISCONNECTING:
case ConnectionState.CONNECTING:
case ConnectionState.AUTHENTICATING:
case ConnectionState.IN_LOBBY:
case ConnectionState.ERROR:
default:
m_RoomSettingsButton.SetActive(false);
break;
}
}

private void OnRoomOwnershipUpdated(bool isRoomOwner)
{
if (!m_RoomOwnership) return;
Expand Down
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings Shared Data.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3443,6 +3443,18 @@ MonoBehaviour:
m_Key: MULTIPLAYER_PANEL_MAX_ROOM_NUMBER
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Key: MULTIPLAYER_ROOM_SETTINGS
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Key: MULTIPLAYER_IN_ROOM_PANEL_BUTTON
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Key: MULTIPLAYER_EDIT_MAX_PLAYERS
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:
Expand Down
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_de.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3642,6 +3642,18 @@ MonoBehaviour:
m_Localized: 'Maximale Spieler: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: 'Raumeinstellungen: '
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: 'Raum-Panel: '
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: 'Maximale Spieler bearbeiten: '
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_en.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3612,6 +3612,18 @@ MonoBehaviour:
m_Localized: 'Max Players: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: 'Room Settings: '
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: 'In Room Panel: '
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: 'Edit max PLayers: '
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_es.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3612,6 +3612,18 @@ MonoBehaviour:
m_Localized: "Jugadores M\xE1ximos: "
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "Configuraci\xF3n de la Sala: "
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: "Panel de Habitaci\xF3n: "
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: "Editar m\xE1ximo de jugadores: "
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_fr.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3582,6 +3582,18 @@ MonoBehaviour:
m_Localized: 'Joueurs Max: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "Param\xE8tres de la Salle: "
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: 'Panneau de Salle: '
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: 'Modifier le nombre max de joueurs : '
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_ja.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3534,6 +3534,18 @@ MonoBehaviour:
m_Localized: "\u6700\u5927\u30D7\u30EC\u30A4\u30E4\u30FC\u6570: "
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "\u30EB\u30FC\u30E0\u8A2D\u5B9A: "
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: "\u30EB\u30FC\u30E0\u30D1\u30CD\u30EB\uFF1A"
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: "\u6700\u5927\u30D7\u30EC\u30A4\u30E4\u30FC\u6570\u3092\u7DE8\u96C6\uFF1A"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_ko.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3603,6 +3603,18 @@ MonoBehaviour:
m_Localized: "\uCD5C\uB300 \uD50C\uB808\uC774\uC5B4 \uC218: "
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "\uBC29 \uC124\uC815: "
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: "\uBC29 \uD328\uB110: "
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: "\uCD5C\uB300 \uD50C\uB808\uC774\uC5B4 \uC218 \uD3B8\uC9D1: "
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
12 changes: 12 additions & 0 deletions Assets/Settings/Localization/Strings/Strings_zh.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3530,6 +3530,18 @@ MonoBehaviour:
m_Localized: "\u6700\u5927\u73A9\u5BB6\u6570: "
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "\u623F\u95F4\u8BBE\u7F6E: "
m_Metadata:
m_Items: []
- m_Id: 326570591894564864
m_Localized: "\u623F\u95F4\u9762\u677F\uFF1A"
m_Metadata:
m_Items: []
- m_Id: 326572252843143168
m_Localized: "\u7F16\u8F91\u6700\u5927\u73A9\u5BB6\u6570\uFF1A"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
23 changes: 18 additions & 5 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PlayerSettings:
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 0
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 0
Expand Down Expand Up @@ -893,10 +893,23 @@ PlayerSettings:
webGLMemoryGeometricGrowthCap: 96
webGLPowerPreference: 2
scriptingDefineSymbols:
Android: TILT_BRUSH
Standalone: TILT_BRUSH;USD_SUPPORTED;FBX_SUPPORTED;FBXSDK_RUNTIME;HAVE_GLTFAST;
Windows Store Apps: TILT_BRUSH;USD_SUPPORTED
iPhone: TILT_BRUSH
Android: TILT_BRUSH;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;CROSS_PLATFORM_INPUT;MOBILE_INPUT;PHOTON_VOICE_DEFINED;MP_PHOTON;FUSION_WEAVER;FUSION2
EmbeddedLinux: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
GameCoreScarlett: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
GameCoreXboxOne: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
LinuxHeadlessSimulation: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
Nintendo Switch: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
PS4: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
PS5: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
QNX: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
Stadia: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
Standalone: TILT_BRUSH;USD_SUPPORTED;FBX_SUPPORTED;FBXSDK_RUNTIME;HAVE_GLTFAST;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;CROSS_PLATFORM_INPUT;PHOTON_VOICE_DEFINED;FUSION_WEAVER;FUSION2;MP_PHOTON
VisionOS: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
WebGL: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
Windows Store Apps: TILT_BRUSH;USD_SUPPORTED;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;MOBILE_INPUT;PHOTON_VOICE_DEFINED
XboxOne: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
iPhone: TILT_BRUSH;PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;CROSS_PLATFORM_INPUT;MOBILE_INPUT;PHOTON_VOICE_DEFINED
tvOS: PHOTON_UNITY_NETWORKING;PUN_2_0_OR_NEWER;PUN_2_OR_NEWER;PUN_2_19_OR_NEWER;PHOTON_VOICE_DEFINED
additionalCompilerArguments: {}
platformArchitecture:
iPhone: 1
Expand Down

0 comments on commit e8547c9

Please sign in to comment.