Skip to content

Commit 7dc5320

Browse files
author
Mikkel Sørensen
committed
Auto pop up on SDK install
Tested in both package manager and Asset install
1 parent 073da79 commit 7dc5320

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Runtime/Editor/Editor UI/LootLockerAdminExtension.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,17 @@ public static void Run()
101101
[InitializeOnLoadMethod]
102102
public static void LoadFirstTime()
103103
{
104+
104105
if (LootLockerEditorData.ShouldAutoShowWindow())
105106
{
106-
LootLockerAdminExtension wnd = GetWindow<LootLockerAdminExtension>();
107-
wnd.titleContent = new GUIContent("LootLocker");
107+
EditorApplication.delayCall = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.delayCall, (EditorApplication.CallbackFunction)delegate
108+
{
109+
LootLockerAdminExtension wnd = GetWindow<LootLockerAdminExtension>();
110+
wnd.titleContent = new GUIContent("LootLocker");
111+
wnd.ShowUtility();
112+
});
113+
114+
return;
108115
}
109116

110117
}
@@ -145,12 +152,16 @@ public void CreateGUI()
145152

146153
environmentElement = root.Q<VisualElement>("Environment");
147154

155+
environmentElement.style.display = DisplayStyle.None;
156+
148157
environmentTitle = root.Q<Label>("EnvironmentTitle");
149158

150159
gameName = root.Q<Label>("GameName");
151160

152161
menu = root.Q<VisualElement>("MenuBar");
153162

163+
menu.style.display = DisplayStyle.None;
164+
154165
menuChangeGameBtn = root.Q<Button>("ChangeGameBtn");
155166

156167
menuAPIKeyBtn = root.Q<Button>("APIKeyBtn");
@@ -178,6 +189,8 @@ public void CreateGUI()
178189

179190
loginFlow = root.Q<VisualElement>("LoginFlow");
180191

192+
loginFlow.style.display = DisplayStyle.Flex;
193+
181194
emailField = root.Q<TextField>("EmailField");
182195
passwordField = root.Q<TextField>("PasswordField");
183196

Runtime/Editor/LootLockerEditorData.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public static bool IsEnvironmentStage()
7373

7474
public static bool ShouldAutoShowWindow()
7575
{
76-
return EditorPrefs.GetBool(prefix + firstTimeWelcome);
76+
var result = EditorPrefs.GetBool(prefix + firstTimeWelcome, true);
77+
EditorPrefs.SetBool(prefix + firstTimeWelcome, false);
78+
return result;
7779
}
7880

7981
public static bool IsNewSession()

0 commit comments

Comments
 (0)