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 13020da
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Assets/Prefabs/Panels/MultiplayerPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2048,8 +2048,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.526, 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 @@ -2180,9 +2180,9 @@ MonoBehaviour:
m_PopupText:
m_LocalizedPopup:
m_TableReference:
m_TableCollectionName:
m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86
m_TableEntryReference:
m_KeyId: 0
m_KeyId: 326549804571619328
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
Expand Down
27 changes: 27 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 @@ -230,6 +231,8 @@ private void UpdateDisplay()
if (m_RoomNumber) m_RoomNumber.text = m_RoomNumberString.GetLocalizedString() + data.roomName;
if (m_Nickname) m_Nickname.text = m_NicknameString.GetLocalizedString() + NickName;
if (m_RoomMaxPlayer) m_RoomMaxPlayer.text = m_RoomMaxPlayerString.GetLocalizedString() + MaxPlayers;
DisplayRoomSettingsButton(MultiplayerManager.m_Instance.State);
OnStateUpdated(MultiplayerManager.m_Instance.State);
Alerts();
updateDisplay = false;
}
Expand Down Expand Up @@ -271,6 +274,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 +305,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
Original file line number Diff line number Diff line change
Expand Up @@ -3443,6 +3443,10 @@ 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_Metadata:
m_Items: []
m_KeyGenerator:
Expand Down
4 changes: 4 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,10 @@ MonoBehaviour:
m_Localized: 'Maximale Spieler: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: 'Raumeinstellungen: '
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ MonoBehaviour:
m_Localized: 'Max Players: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: 'Room Settings: '
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ MonoBehaviour:
m_Localized: "Jugadores M\xE1ximos: "
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "Configuraci\xF3n de la Sala: "
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ MonoBehaviour:
m_Localized: 'Joueurs Max: '
m_Metadata:
m_Items: []
- m_Id: 326549804571619328
m_Localized: "Param\xE8tres de la Salle: "
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ 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: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ 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: []
references:
version: 2
RefIds: []
4 changes: 4 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,10 @@ 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: []
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 13020da

Please sign in to comment.