From 7b9f6a1ca069f90ce49ac6a778f3d03c79c3bad2 Mon Sep 17 00:00:00 2001 From: Riccardo Bovo Date: Thu, 19 Dec 2024 14:29:01 +0000 Subject: [PATCH] Add alert to check if passthrough environment is active --- Assets/Prefabs/Panels/MultiplayerPanel.prefab | 9 +++++++++ Assets/Scripts/GUI/MultiplayerPanel.cs | 18 +++++++++++++++++- .../Multiplayer/Photon/PhotonManager.cs | 2 +- .../Strings/Strings Shared Data.asset | 6 +++++- .../Localization/Strings/Strings_de.asset | 5 +++++ .../Localization/Strings/Strings_en.asset | 2 +- .../Localization/Strings/Strings_es.asset | 4 ++++ .../Localization/Strings/Strings_fr.asset | 5 +++++ .../Localization/Strings/Strings_ja.asset | 4 ++++ .../Localization/Strings/Strings_ko.asset | 5 +++++ .../Localization/Strings/Strings_zh.asset | 4 ++++ 11 files changed, 60 insertions(+), 4 deletions(-) diff --git a/Assets/Prefabs/Panels/MultiplayerPanel.prefab b/Assets/Prefabs/Panels/MultiplayerPanel.prefab index be876a028..875727125 100644 --- a/Assets/Prefabs/Panels/MultiplayerPanel.prefab +++ b/Assets/Prefabs/Panels/MultiplayerPanel.prefab @@ -179,6 +179,15 @@ MonoBehaviour: m_FallbackState: 0 m_WaitForCompletion: 0 m_LocalVariables: [] + m_AlertsPassThroughAcive: + m_TableReference: + m_TableCollectionName: GUID:c84355079ab3f3e4f8f3812258805f86 + m_TableEntryReference: + m_KeyId: 156198200358006784 + m_Key: + m_FallbackState: 0 + m_WaitForCompletion: 0 + m_LocalVariables: [] references: version: 2 RefIds: [] diff --git a/Assets/Scripts/GUI/MultiplayerPanel.cs b/Assets/Scripts/GUI/MultiplayerPanel.cs index a0a92157f..2a0d8ec81 100644 --- a/Assets/Scripts/GUI/MultiplayerPanel.cs +++ b/Assets/Scripts/GUI/MultiplayerPanel.cs @@ -37,7 +37,7 @@ public class MultiplayerPanel : BasePanel [SerializeField] private TextMeshPro m_AlertsErrors; [SerializeField] private LocalizedString m_AlertsErrorBeginnerModeActive; [SerializeField] private LocalizedString m_AlertsRoomAlreadyExistent; - + [SerializeField] private LocalizedString m_AlertsPassThroughAcive; private PlayerPrefsDataStore m_multiplayer; private bool updateDisplay = false; @@ -91,6 +91,7 @@ public void Awake() alertChecks = new List>> { CheckAdvancedModeActive, + CheckIfPassThroughEnvironment, CheckMultiplayerManagerErrors, CheckIfRoomExist, }; @@ -297,6 +298,21 @@ private Tuple CheckIfRoomExist() } + // hardoded copied from LightingPopUpWindow + private const string PASSTHROUGH_GUID = "e38af599-4575-46ff-a040-459703dbcd36"; + private Tuple CheckIfPassThroughEnvironment() + { + + if (MultiplayerManager.m_Instance != null && MultiplayerManager.m_Instance.State == ConnectionState.IN_LOBBY) + { + TiltBrush.Environment targetEnvironment = SceneSettings.m_Instance.GetDesiredPreset(); + if (targetEnvironment.m_Guid.ToString() == PASSTHROUGH_GUID) + return Tuple.Create(true, m_AlertsPassThroughAcive.GetLocalizedString()); + } + + return Tuple.Create(false, ""); + } + private void Alerts() { if (m_AlertsErrors) diff --git a/Assets/Scripts/Multiplayer/Photon/PhotonManager.cs b/Assets/Scripts/Multiplayer/Photon/PhotonManager.cs index 63fa26034..dbcea03c3 100644 --- a/Assets/Scripts/Multiplayer/Photon/PhotonManager.cs +++ b/Assets/Scripts/Multiplayer/Photon/PhotonManager.cs @@ -150,7 +150,6 @@ public async Task JoinRoom(RoomCreateData roomCreateData) //m_Runner.ReliableDataSendRate = 60; //m_Runner.Config.Network.ReliableDataTransferModes = NetworkConfiguration.ReliableDataTransfers.ClientToClientWithServerProxy; - if (result.Ok) { // Verify if the room is actually full @@ -163,6 +162,7 @@ public async Task JoinRoom(RoomCreateData roomCreateData) State = ConnectionState.ERROR; LastError = "[PhotonManager] Room is full."; ControllerConsoleScript.m_Instance.AddNewLine(LastError); + Disconnect(); return false; } diff --git a/Assets/Settings/Localization/Strings/Strings Shared Data.asset b/Assets/Settings/Localization/Strings/Strings Shared Data.asset index 71c4d8d15..19d6b358a 100644 --- a/Assets/Settings/Localization/Strings/Strings Shared Data.asset +++ b/Assets/Settings/Localization/Strings/Strings Shared Data.asset @@ -3300,7 +3300,7 @@ MonoBehaviour: m_Metadata: m_Items: [] - m_Id: 156198200358006784 - m_Key: ADMIN_PANEL_MULTIPLAYER_BUTTON_DESCRIPTION + m_Key: MULTIPLAYER_PANEL_ALERT_PASSTHROUGH_ACTIVE m_Metadata: m_Items: [] - m_Id: 157582826200739840 @@ -3427,6 +3427,10 @@ MonoBehaviour: m_Key: MULTIPLAYER_PANEL_ALERT_ROOM_EXIST m_Metadata: m_Items: [] + - m_Id: 313081115495178240 + m_Key: MULTIPLAYER_PANEL_ALERT_PASSTHROUGH_EXIST + m_Metadata: + m_Items: [] m_Metadata: m_Items: [] m_KeyGenerator: diff --git a/Assets/Settings/Localization/Strings/Strings_de.asset b/Assets/Settings/Localization/Strings/Strings_de.asset index 21b1c2888..aa9610940 100644 --- a/Assets/Settings/Localization/Strings/Strings_de.asset +++ b/Assets/Settings/Localization/Strings/Strings_de.asset @@ -3629,6 +3629,11 @@ MonoBehaviour: beitreten. m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: Schalten Sie den Passthrough-Modus aus, um den Mehrspielermodus + zu nutzen. + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Settings/Localization/Strings/Strings_en.asset b/Assets/Settings/Localization/Strings/Strings_en.asset index 3ac06298b..a6d099e88 100644 --- a/Assets/Settings/Localization/Strings/Strings_en.asset +++ b/Assets/Settings/Localization/Strings/Strings_en.asset @@ -3521,7 +3521,7 @@ MonoBehaviour: m_Metadata: m_Items: [] - m_Id: 156198200358006784 - m_Localized: Multiplayer (Alpha) + m_Localized: Switch off passthrough environment mode to use Multiplayer m_Metadata: m_Items: [] - m_Id: 238556149774557184 diff --git a/Assets/Settings/Localization/Strings/Strings_es.asset b/Assets/Settings/Localization/Strings/Strings_es.asset index 9b5de33b4..5c8126a0a 100644 --- a/Assets/Settings/Localization/Strings/Strings_es.asset +++ b/Assets/Settings/Localization/Strings/Strings_es.asset @@ -3600,6 +3600,10 @@ MonoBehaviour: m_Localized: "La sala ya existe. Te unir\xE1s a una sesi\xF3n existente." m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: Desactiva el modo de entorno de passthrough para usar el multijugador. + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Settings/Localization/Strings/Strings_fr.asset b/Assets/Settings/Localization/Strings/Strings_fr.asset index 8b7b0e83a..251fb8c8d 100644 --- a/Assets/Settings/Localization/Strings/Strings_fr.asset +++ b/Assets/Settings/Localization/Strings/Strings_fr.asset @@ -3569,6 +3569,11 @@ MonoBehaviour: m_Localized: "La salle existe d\xE9j\xE0. Vous allez rejoindre une session existante." m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: "D\xE9sactivez le mode environnement de transparence pour utiliser + le multijoueur." + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Settings/Localization/Strings/Strings_ja.asset b/Assets/Settings/Localization/Strings/Strings_ja.asset index 55af60b17..6d6184643 100644 --- a/Assets/Settings/Localization/Strings/Strings_ja.asset +++ b/Assets/Settings/Localization/Strings/Strings_ja.asset @@ -3522,6 +3522,10 @@ MonoBehaviour: m_Localized: "\u30EB\u30FC\u30E0\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u65E2\u5B58\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u53C2\u52A0\u3057\u307E\u3059\u3002" m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: "\u30DE\u30EB\u30C1\u30D7\u30EC\u30A4\u30E4\u30FC\u3092\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001\u900F\u904E\u74B0\u5883\u30E2\u30FC\u30C9\u3092\u30AA\u30D5\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002" + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Settings/Localization/Strings/Strings_ko.asset b/Assets/Settings/Localization/Strings/Strings_ko.asset index 74fbf82d2..d363f4ed0 100644 --- a/Assets/Settings/Localization/Strings/Strings_ko.asset +++ b/Assets/Settings/Localization/Strings/Strings_ko.asset @@ -3590,6 +3590,11 @@ MonoBehaviour: \uC138\uC158\uC5D0 \uCC38\uC5EC\uD569\uB2C8\uB2E4." m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: "\uBA40\uD2F0\uD50C\uB808\uC774\uC5B4\uB97C \uC0AC\uC6A9\uD558\uB824\uBA74 + \uD328\uC2A4\uC2A4\uB8E8 \uD658\uACBD \uBAA8\uB4DC\uB97C \uB044\uC138\uC694." + m_Metadata: + m_Items: [] references: version: 2 RefIds: [] diff --git a/Assets/Settings/Localization/Strings/Strings_zh.asset b/Assets/Settings/Localization/Strings/Strings_zh.asset index adc6b43c9..64c144843 100644 --- a/Assets/Settings/Localization/Strings/Strings_zh.asset +++ b/Assets/Settings/Localization/Strings/Strings_zh.asset @@ -3518,6 +3518,10 @@ MonoBehaviour: m_Localized: "\u623F\u95F4\u5DF2\u5B58\u5728\u3002\u60A8\u5C06\u52A0\u5165\u4E00\u4E2A\u73B0\u6709\u7684\u4F1A\u8BDD\u3002" m_Metadata: m_Items: [] + - m_Id: 156198200358006784 + m_Localized: "\u5173\u95ED\u900F\u89C6\u73AF\u5883\u6A21\u5F0F\u4EE5\u4F7F\u7528\u591A\u4EBA\u6E38\u620F\u3002" + m_Metadata: + m_Items: [] references: version: 2 RefIds: []