1
+ using System ;
2
+ using System . Collections . Generic ;
3
+
4
+ #if UNITY_EDITOR && UNITY_2021_3_OR_NEWER
5
+ using UnityEditor ;
1
6
using UnityEngine ;
2
7
using UnityEngine . UIElements ;
3
8
using LootLocker ;
4
-
5
9
using LootLocker . Extension ;
6
- using LootLocker . Extension . DataTypes ;
7
10
using LootLocker . Extension . Responses ;
8
11
9
- using UnityEditor ;
10
-
11
12
public class LootLockerAdminExtension : EditorWindow
12
13
{
13
14
[ SerializeField ]
@@ -46,7 +47,6 @@ public class LootLockerAdminExtension : EditorWindow
46
47
47
48
private Button popupBtn ;
48
49
49
-
50
50
private Label infoText ;
51
51
52
52
private Label newApiKeyCancel ;
@@ -58,25 +58,16 @@ public class LootLockerAdminExtension : EditorWindow
58
58
59
59
private Button createApiKeyBtn ;
60
60
61
- //Login Flow Start
62
61
private TextField emailField , passwordField ;
63
62
private Label signupLink , gettingStartedLink , forgotPasswordLink ;
64
63
private Button loginBtn ;
65
- //Login Flow End
66
-
67
- //MFA Flow Begin
68
64
69
65
private TextField codeField ;
70
66
private Button signInBtn ;
71
67
private string mfaKey ;
72
- //MFA Flow End
73
-
74
- //Game Selector Flow Begin
75
68
76
69
VisualElement gameSelectorList ;
77
- //Game Selector Flow End
78
70
79
- //API Key Flow Begin
80
71
VisualElement apiKeyList ;
81
72
82
73
bool isStage = true ;
@@ -143,7 +134,7 @@ public void CreateGUI()
143
134
144
135
if ( LootLockerConfig . current . apiKey != null || LootLockerConfig . current . apiKey != "" )
145
136
{
146
- // activeKey.text = "Active Key: " + LootLockerConfig.current.apiKey;
137
+ activeKey . text = "Active Key: " + LootLockerConfig . current . apiKey ;
147
138
} else
148
139
{
149
140
activeKey . text = "Active Key: Not selected" ;
@@ -181,8 +172,6 @@ public void CreateGUI()
181
172
popupBtn . clickable . clickedWithEventInfo += ClosePopup ;
182
173
183
174
184
- //Login Flow Start
185
-
186
175
loginFlow = root . Q < VisualElement > ( "LoginFlow" ) ;
187
176
188
177
emailField = root . Q < TextField > ( "EmailField" ) ;
@@ -196,7 +185,7 @@ public void CreateGUI()
196
185
}
197
186
} ) ;
198
187
199
- signupLink = root . Q < Label > ( "newUserLink" ) ;
188
+ signupLink = root . Q < Label > ( "newUserLink" ) ;
200
189
gettingStartedLink = root . Q < Label > ( "gettingStartedLink" ) ;
201
190
forgotPasswordLink = root . Q < Label > ( "forgotPasswordLink" ) ;
202
191
@@ -209,9 +198,6 @@ public void CreateGUI()
209
198
loginBtn . clickable . clicked += Login ;
210
199
211
200
loginFlow . style . display = DisplayStyle . Flex ;
212
- //Login Flow End
213
-
214
- //MFA Flow Begin
215
201
216
202
mfaFlow = root . Q < VisualElement > ( "MFAFlow" ) ;
217
203
@@ -222,20 +208,13 @@ public void CreateGUI()
222
208
signInBtn . clickable . clickedWithEventInfo += SignIn ;
223
209
224
210
mfaFlow . style . display = DisplayStyle . None ;
225
- //MFA Flow End
226
-
227
-
228
- //Game Selector Flow Begin
229
211
230
212
gameSelectorFlow = root . Q < VisualElement > ( "GameSelectorFlow" ) ;
231
213
232
214
gameSelectorList = root . Q < VisualElement > ( "GamesList" ) ;
233
215
234
216
gameSelectorFlow . style . display = DisplayStyle . None ;
235
217
236
- //Game Selector Flow End
237
-
238
- //API Key Flow Begin
239
218
apiKeyFlow = root . Q < VisualElement > ( "APIKeyFlow" ) ;
240
219
241
220
apiKeyFlow . style . display = DisplayStyle . None ;
@@ -275,8 +254,6 @@ public void CreateGUI()
275
254
newApiKeyWindow . style . display = DisplayStyle . Flex ;
276
255
} ;
277
256
278
- //API Key Flow End
279
-
280
257
if ( StoredUser . current . user != null )
281
258
{
282
259
LootLockerConfig . current . adminToken = EditorPrefs . GetString ( "LootLocker.AdminToken" ) ;
@@ -386,7 +363,6 @@ private void ClosePopup(EventBase e)
386
363
popup . style . display = DisplayStyle . None ;
387
364
}
388
365
389
- //Login Flow Start
390
366
public void Login ( )
391
367
{
392
368
@@ -432,10 +408,6 @@ public void Login()
432
408
} ) ;
433
409
}
434
410
435
- //Login Flow End
436
-
437
- //MFA Flow Start
438
-
439
411
public void SignIn ( EventBase e )
440
412
{
441
413
EditorApplication . update += OnEditorUpdate ;
@@ -458,9 +430,7 @@ public void SignIn(EventBase e)
458
430
} ) ;
459
431
460
432
}
461
- //MFA Flow End
462
433
463
- //Game Selector Flow Start
464
434
public void CreateGameButtons ( )
465
435
{
466
436
@@ -476,21 +446,18 @@ public void CreateGameButtons()
476
446
477
447
public void GameButtonTemplate ( Game game , string orgName )
478
448
{
479
- //Parent
480
449
Button button = new Button ( ) ;
481
450
482
451
button . style . flexDirection = FlexDirection . Column ;
483
452
button . name = game . id . ToString ( ) ;
484
453
485
454
button . AddToClassList ( "gameButton" ) ;
486
455
487
- //Game title
488
456
Label gameTitle = new Label ( ) ;
489
457
gameTitle . text = game . name ;
490
458
491
459
gameTitle . AddToClassList ( "gameButtonTitle" ) ;
492
460
493
- //Org title
494
461
Label gameOrg = new Label ( ) ;
495
462
gameOrg . text = orgName ;
496
463
@@ -535,11 +502,6 @@ void OnGameSelected(EventBase e)
535
502
536
503
}
537
504
538
- //Game Selector Flow End
539
-
540
- //API Key Flow Start
541
-
542
-
543
505
void CreateNewAPIKey ( )
544
506
{
545
507
@@ -635,7 +597,7 @@ void OnAPIKeySelected(EventBase e)
635
597
636
598
LootLockerConfig . current . apiKey = target . name ;
637
599
638
- // activeKey.text = "Active Key: " + LootLockerConfig.current.apiKey;
600
+ activeKey . text = "Active Key: " + LootLockerConfig . current . apiKey ;
639
601
SwapNewSelectedKey ( ) ;
640
602
641
603
}
@@ -670,4 +632,4 @@ void Logout()
670
632
}
671
633
672
634
}
673
- // #endif
635
+ #endif
0 commit comments