From 4066cb7a54f7ba8f516979fb42df9b61f0df5b65 Mon Sep 17 00:00:00 2001 From: Erik Bylund Date: Thu, 26 Feb 2026 13:55:00 +0100 Subject: [PATCH] fix: Remove references to live env (and also stage env) --- ...LootLockerAdminExtension.Authentication.cs | 20 ++---- .../LootLockerAdminExtension.EventHandlers.cs | 8 +-- ...LootLockerAdminExtension.GameManagement.cs | 4 +- .../Editor UI/LootLockerAdminExtension.UI.cs | 39 +----------- .../Editor UI/LootLockerAdminExtension.cs | 61 ------------------- .../Editor UI/LootLockerAdminExtension.uxml | 11 +--- Runtime/Editor/LootLockerEditorData.cs | 17 ------ Runtime/Game/Resources/LootLockerConfig.cs | 4 +- 8 files changed, 14 insertions(+), 150 deletions(-) diff --git a/Runtime/Editor/Editor UI/LootLockerAdminExtension.Authentication.cs b/Runtime/Editor/Editor UI/LootLockerAdminExtension.Authentication.cs index 8429ffd1c..a7ce5ab63 100644 --- a/Runtime/Editor/Editor UI/LootLockerAdminExtension.Authentication.cs +++ b/Runtime/Editor/Editor UI/LootLockerAdminExtension.Authentication.cs @@ -133,20 +133,15 @@ private void ProcessUserInformation(LoginResponse response) void CreateNewAPIKey() { int gameId = LootLockerEditorData.GetSelectedGame(); - if (gameId == 0) + if (gameId == 0 || !gameData.ContainsKey(gameId)) { ShowPopup("Error", "No active Game found!"); return; } - if (isStage && gameData.ContainsKey(gameId)) - { - gameId = gameData[gameId].development.id; - } - ShowLoadingAndExecute(() => { - LootLockerAdminManager.GenerateKey(gameId, newApiKeyName.value, "game", (onComplete) => + LootLockerAdminManager.GenerateKey(gameData[gameId].development.id, newApiKeyName.value, "game", (onComplete) => { if (!onComplete.success) { @@ -168,16 +163,15 @@ public void RefreshAPIKeys() if (apiKeyList != null) apiKeyList.Clear(); int gameID = LootLockerEditorData.GetSelectedGame(); - if (isStage && gameData.ContainsKey(gameID)) + if (gameID == 0 || !gameData.ContainsKey(gameID)) { - gameID = gameData[gameID].development.id; + ShowPopup("Error", "No active Game found!"); + return; } - - isLoadingKeys = true; ShowLoadingAndExecute(() => { - LootLockerAdminManager.GetAllKeys(gameID, (onComplete) => + LootLockerAdminManager.GetAllKeys(gameData[gameID].development.id, (onComplete) => { if (!onComplete.success) { @@ -190,8 +184,6 @@ public void RefreshAPIKeys() { APIKeyTemplate(key); } - - isLoadingKeys = false; HideLoading(); }); }); diff --git a/Runtime/Editor/Editor UI/LootLockerAdminExtension.EventHandlers.cs b/Runtime/Editor/Editor UI/LootLockerAdminExtension.EventHandlers.cs index 0f9eee00c..32a995ca3 100644 --- a/Runtime/Editor/Editor UI/LootLockerAdminExtension.EventHandlers.cs +++ b/Runtime/Editor/Editor UI/LootLockerAdminExtension.EventHandlers.cs @@ -67,9 +67,6 @@ private void OnGameSelected(EventBase e) gameName.text = selectedGameData.name; UpdateLicenseCountdownUI(); - LootLockerEditorData.SetEnvironmentStage(); - isStage = true; - ShowLoadingAndExecute(() => { LootLockerAdminManager.GetGameDomainKey(LootLockerEditorData.GetSelectedGame(), (onComplete) => @@ -96,7 +93,7 @@ private void OnAPIKeySelected(EventBase e) LootLockerConfig.current.apiKey = target.name; SwapNewSelectedKey(); - ShowPopup("API Key Selected", $"API Key {target.name} is now active."); + ShowPopup("API Key Selected", $"API Key {target.name} is now active.", Color.green); } private void LicenseCountdownIconClick(MouseDownEvent evt) @@ -125,9 +122,10 @@ private void OnEditorUpdate() EditorApplication.QueuePlayerLoopUpdate(); } - private void ShowPopup(string title, string message) + private void ShowPopup(string title, string message, Color? titleColor = null) { if (popupTitle != null) popupTitle.text = title; + if (titleColor.HasValue && popupTitle != null) popupTitle.style.color = titleColor.Value; if (popupMessage != null) popupMessage.text = message; if (popup != null) popup.style.display = DisplayStyle.Flex; } diff --git a/Runtime/Editor/Editor UI/LootLockerAdminExtension.GameManagement.cs b/Runtime/Editor/Editor UI/LootLockerAdminExtension.GameManagement.cs index 34af49375..810e669b3 100644 --- a/Runtime/Editor/Editor UI/LootLockerAdminExtension.GameManagement.cs +++ b/Runtime/Editor/Editor UI/LootLockerAdminExtension.GameManagement.cs @@ -72,7 +72,7 @@ void APIKeyTemplate(KeyResponse key) if (button.name == LootLockerConfig.current.apiKey) { button.style.borderRightColor = button.style.borderLeftColor = - button.style.borderTopColor = button.style.borderBottomColor = stage; + button.style.borderTopColor = button.style.borderBottomColor = new Color(0.094f, 0.749f, 0.352f, 1); button.style.backgroundColor = new StyleColor(new Color(0.2f, 0.5f, 0.2f, 1f)); } @@ -106,7 +106,7 @@ void SwapNewSelectedKey() if (key.name == LootLockerConfig.current.apiKey) { key.style.borderRightColor = key.style.borderLeftColor = - key.style.borderTopColor = key.style.borderBottomColor = stage; + key.style.borderTopColor = key.style.borderBottomColor = new Color(0.094f, 0.749f, 0.352f, 1); key.style.backgroundColor = new StyleColor(new Color(0.2f, 0.5f, 0.2f, 1f)); } else diff --git a/Runtime/Editor/Editor UI/LootLockerAdminExtension.UI.cs b/Runtime/Editor/Editor UI/LootLockerAdminExtension.UI.cs index 11d782c2d..011c0da39 100644 --- a/Runtime/Editor/Editor UI/LootLockerAdminExtension.UI.cs +++ b/Runtime/Editor/Editor UI/LootLockerAdminExtension.UI.cs @@ -32,7 +32,7 @@ public void InitializeUIElements() if (visualTree == null) { // Try to load from Packages - visualTree = EditorGUIUtility.Load("Packages/com.lootlocker.lootlockersdk/Runtime/Editor UI/LootLockerAdminExtension.uxml") as VisualTreeAsset; + visualTree = EditorGUIUtility.Load("Packages/com.lootlocker.lootlockersdk/Runtime/Editor/Editor UI/LootLockerAdminExtension.uxml") as VisualTreeAsset; } if (visualTree == null) { @@ -53,7 +53,6 @@ public void InitializeUIElements() InitializeStyleColors(); InitializeUIReferences(root); InitializeEventHandlers(); - InitializeEnvironmentUI(); InitializeLoadingIcon(root); InitializeLicenseCountdownUI(root); } @@ -69,19 +68,11 @@ private void CreateSecurityWarning(VisualElement root) private void InitializeStyleColors() { - live.value = new Color(0.749f, 0.325f, 0.098f, 1); - stage.value = new Color(0.094f, 0.749f, 0.352f, 1); defaultButton.value = new Color(0.345f, 0.345f, 0.345f, 1); } private void InitializeUIReferences(VisualElement root) { - // Environment - environmentBackground = root.Q("SwitchBackground"); - environmentHandle = root.Q("Handle"); - environmentElement = root.Q("Environment"); - environmentTitle = root.Q