Skip to content

Commit 462d536

Browse files
author
Mikkel Sørensen
committed
Fixed lost references
1 parent 307778b commit 462d536

8 files changed

+159
-20
lines changed
File renamed without changes.

Runtime/Editor/Editor UI/LootLockerAdminExtension.uss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
}
1717

1818
.gameButton {
19-
border-bottom-width: 10px;
20-
background-color: var(--ButtonColor);
2119
margin-bottom: 10px;
2220
align-items: flex-start;
2321
}

Runtime/Editor/Editor UI/LootLockerAdminExtension.uxml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
22
<Style src="project://database/Assets/LootLockerSDK/Editor/NewUI/LootLockerAdminExtension.uss?fileID=7433441132597879392&amp;guid=f1130e18dfb99e04cbd54f3fac00ff15&amp;type=3#LootLockerAdminExtension" />
33
<ui:VisualElement style="align-self: stretch; justify-content: center; align-items: stretch; height: 100%;">
4-
<ui:VisualElement name="Topbar" style="flex-grow: 1; visibility: visible; display: flex; border-bottom-width: 2px; border-bottom-color: rgb(46, 46, 46); flex-direction: row; justify-content: flex-start; align-self: auto; align-items: stretch;">
4+
<ui:VisualElement name="Topbar" style="flex-grow: 1; visibility: visible; display: flex; border-bottom-width: 2px; border-bottom-color: rgb(46, 46, 46); flex-direction: row; justify-content: flex-start; align-self: auto; align-items: stretch; flex-wrap: wrap;">
55
<ui:Label tabindex="-1" text="LootLocker" display-tooltip-when-elided="true" name="GameName" style="align-items: flex-start; align-self: center; font-size: 28px; -unity-text-align: middle-left; text-overflow: clip; width: auto; white-space: nowrap; max-width: 750px; margin-left: 24px; justify-content: flex-start;" />
66
<ui:VisualElement name="Environment" style="flex-grow: 1; flex-direction: row; flex-shrink: 1; align-self: stretch; justify-content: flex-end; margin-right: 24px;">
77
<ui:Label tabindex="-1" text="Environment: Stage" display-tooltip-when-elided="true" name="EnvironmentTitle" style="align-items: flex-start; align-self: center; font-size: 14px; -unity-text-align: middle-left; text-overflow: clip; white-space: nowrap; margin-right: 8px;" />
8-
<ui:VisualElement name="SwitchBackground" class="environmentToStageBackground" style="flex-grow: 1; background-color: rgb(28, 232, 109); min-width: 0; min-height: 25px; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; border-bottom-left-radius: 15px; align-items: auto; align-self: center; max-width: 45px; justify-content: center; flex-shrink: 0;">
9-
<ui:VisualElement name="Handle" style="flex-grow: 1; background-color: rgb(255, 255, 255); align-self: flex-start; align-items: flex-end; justify-content: flex-start; border-top-left-radius: 90px; border-top-right-radius: 90px; border-bottom-right-radius: 90px; border-bottom-left-radius: 90px; margin-right: 4px; margin-left: 4px; flex-shrink: 0; width: 20px; height: 20px; min-width: 20px; min-height: 20px; max-height: 20px; max-width: 20px; margin-top: 1px;" />
8+
<ui:VisualElement name="SwitchBackground" class="environmentToStageBackground" style="flex-grow: 1; background-color: rgb(28, 232, 109); min-width: 0; min-height: 26px; border-top-left-radius: 12px; border-top-right-radius: 12px; border-bottom-right-radius: 12px; border-bottom-left-radius: 12px; align-items: auto; align-self: center; max-width: 45px; justify-content: center; flex-shrink: 0;">
9+
<ui:VisualElement name="Handle" style="flex-grow: 1; background-color: rgb(255, 255, 255); align-self: flex-start; align-items: flex-end; justify-content: flex-start; border-top-left-radius: 90px; border-top-right-radius: 90px; border-bottom-right-radius: 90px; border-bottom-left-radius: 90px; margin-right: 4px; margin-left: 4px; flex-shrink: 0; width: 20px; height: 20px; min-width: 20px; min-height: 20px; max-height: 20px; max-width: 20px; margin-top: 0;" />
1010
</ui:VisualElement>
1111
</ui:VisualElement>
1212
</ui:VisualElement>
1313
<ui:VisualElement name="ContentView" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); margin-top: 0; opacity: 1; bottom: 0; top: 0; height: 100%;">
14-
<ui:VisualElement name="MenuBar" style="flex-grow: 1; visibility: visible; display: flex; border-bottom-width: 2px; border-bottom-color: rgb(46, 46, 46); flex-direction: row; justify-content: flex-start; align-self: auto; align-items: stretch;">
14+
<ui:VisualElement name="MenuBar" style="flex-grow: 1; visibility: visible; display: flex; border-bottom-width: 2px; border-bottom-color: rgb(46, 46, 46); flex-direction: row; justify-content: flex-start; align-self: auto; align-items: stretch; margin-left: 0; margin-bottom: 12px; flex-wrap: wrap;">
1515
<ui:VisualElement name="DynamicMenu" style="flex-grow: 1; flex-direction: row;">
1616
<ui:Button text="API Keys" display-tooltip-when-elided="true" name="APIKeyBtn" class="menuBtn" style="-unity-font-style: bold; background-color: rgba(188, 188, 188, 0); border-left-color: rgba(149, 149, 149, 0); border-right-color: rgba(149, 149, 149, 0); border-top-color: rgba(149, 149, 149, 0); border-bottom-color: rgba(149, 149, 149, 0); margin-left: 20px;" />
1717
</ui:VisualElement>
@@ -40,7 +40,7 @@
4040
<ui:Label tabindex="-1" text="Getting started guide" display-tooltip-when-elided="true" name="gettingStartedLink" class="clickable" style="font-size: 16px; align-items: auto; justify-content: space-evenly; align-self: center; color: rgb(81, 171, 255);" />
4141
</ui:VisualElement>
4242
</ui:VisualElement>
43-
<ui:VisualElement name="MFAFlow" style="flex-grow: 1; flex-direction: row; display: none; height: 100%;">
43+
<ui:VisualElement name="MFAFlow" style="flex-grow: 1; flex-direction: row; display: flex; height: 100%;">
4444
<ui:VisualElement name="Verify" style="flex-grow: 1; align-self: stretch; align-items: center; justify-content: flex-start; -unity-text-align: middle-center; flex-direction: column;">
4545
<ui:Label tabindex="-1" text="MFA Code" display-tooltip-when-elided="true" name="Title" style="font-size: 24px; align-items: auto; justify-content: space-evenly; align-self: center;" />
4646
<ui:VisualElement name="Form" style="flex-direction: column; flex-wrap: nowrap; flex-grow: 1; align-self: center; align-items: flex-start;">
@@ -56,19 +56,19 @@
5656
<ui:ScrollView name="GamesList" style="min-width: 300px; overflow: visible;" />
5757
</ui:VisualElement>
5858
</ui:VisualElement>
59-
<ui:VisualElement name="APIKeyFlow" style="flex-grow: 1; flex-direction: column; display: flex; justify-content: flex-end; height: 100%;">
59+
<ui:VisualElement name="APIKeyFlow" style="flex-grow: 1; flex-direction: column; display: none; justify-content: flex-end; height: 100%;">
6060
<ui:VisualElement name="Keys" style="flex-grow: 1; align-self: stretch; align-items: center; justify-content: flex-start; -unity-text-align: middle-center; flex-direction: column; min-width: 300px;">
6161
<ui:Label tabindex="-1" text="API Keys" display-tooltip-when-elided="true" name="Title" style="font-size: 24px; align-items: auto; justify-content: space-evenly; align-self: center; margin-bottom: 0; padding-bottom: 0;" />
6262
<ui:Label tabindex="-1" text="Select a key to use" display-tooltip-when-elided="true" name="Title" style="font-size: 14px; align-items: auto; justify-content: space-evenly; align-self: center; margin-bottom: 10px; padding-top: 0; margin-top: 0;" />
63-
<ui:ScrollView name="APIKeyList" style="background-color: rgb(53, 53, 53);" />
63+
<ui:ScrollView name="APIKeyList" style="background-color: rgb(53, 53, 53); flex-direction: column-reverse;" />
6464
</ui:VisualElement>
6565
</ui:VisualElement>
6666
<ui:VisualElement name="Footer" style="transform-origin: center; align-self: center; position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-end; flex-grow: 1; flex-shrink: 0; min-height: auto;">
67-
<ui:Label tabindex="-1" text="Learn more about &lt;color=#51ABFF&gt;&#10;API Keys" display-tooltip-when-elided="true" name="LearnMore" class="clickable" style="-unity-text-align: upper-center; display: flex; position: relative; flex-direction: column-reverse; align-self: center; align-items: center; justify-content: flex-end;" />
67+
<ui:Label tabindex="-1" text="Learn more about &lt;color=#51ABFF&gt;&#10;API Keys" display-tooltip-when-elided="true" name="LearnMore" class="clickable" style="-unity-text-align: upper-center; display: flex; position: relative; flex-direction: column-reverse; align-self: center; align-items: center; justify-content: flex-end; margin-bottom: 12px; margin-top: 12px;" />
6868
</ui:VisualElement>
6969
</ui:VisualElement>
7070
</ui:VisualElement>
71-
<ui:VisualElement name="InfoandCreate" style="flex-grow: 1; align-self: center; align-items: auto; justify-content: flex-start; -unity-text-align: middle-center; flex-direction: column; margin-right: 0; margin-left: 0; padding-left: 0; min-width: 81px; max-width: 167px; position: absolute; right: 0; top: 109px; bottom: 0;">
71+
<ui:VisualElement name="InfoandCreate" style="flex-grow: 1; align-self: center; align-items: auto; justify-content: flex-start; -unity-text-align: middle-center; flex-direction: column; margin-right: 15px; margin-left: 0; padding-left: 0; min-width: 81px; max-width: 167px; position: absolute; right: 0; top: 109px; bottom: 0;">
7272
<ui:Label tabindex="-1" text="Active Key: Not selected" display-tooltip-when-elided="true" name="ActiveKey" style="font-size: 10px; align-items: flex-end; justify-content: space-evenly; align-self: flex-end; margin-bottom: 8px; padding-bottom: 0; margin-right: 10px; text-overflow: ellipsis; max-width: 250px;" />
7373
<ui:Button text="Create new API Key" display-tooltip-when-elided="true" name="CreateKeyBtn" style="margin-right: 10px; min-height: 30px;" />
7474
</ui:VisualElement>
@@ -88,7 +88,7 @@
8888
<ui:Button text="Logout" display-tooltip-when-elided="true" name="LogoutBtn" class="menuButton" style="align-self: stretch;" />
8989
</ui:VisualElement>
9090
</ui:VisualElement>
91-
<ui:VisualElement name="CreateAPIKeyWindow" class="clickable" style="flex-grow: 1; position: absolute; right: 0; left: 0; bottom: 0; top: 0; color: rgb(27, 27, 27); align-self: center; align-items: center; justify-content: space-around; display: none; background-color: rgba(0, 0, 0, 0.75);">
91+
<ui:VisualElement name="CreateAPIKeyWindow" style="flex-grow: 1; position: absolute; right: 0; left: 0; bottom: 0; top: 0; color: rgb(27, 27, 27); align-self: center; align-items: center; justify-content: space-around; display: none; background-color: rgba(0, 0, 0, 0.75);">
9292
<ui:VisualElement name="Background" style="flex-grow: 1; background-color: rgb(56, 56, 56); max-width: 511px; min-width: 281px; max-height: 256px; min-height: 167px; align-self: center; align-items: flex-end; justify-content: flex-start; width: auto; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-left-color: rgb(46, 46, 46); border-right-color: rgb(46, 46, 46); border-top-color: rgb(46, 46, 46); border-bottom-color: rgb(46, 46, 46);">
9393
<ui:Label tabindex="-1" text="Create key" display-tooltip-when-elided="true" name="popupTitle" style="align-items: flex-start; align-self: center; justify-content: flex-start; font-size: 24px; margin-bottom: 0; padding-bottom: 0; margin-top: 15px; color: rgb(210, 210, 210);" />
9494
<ui:VisualElement name="VisualElement" style="flex-grow: 0; align-self: center; justify-content: flex-end; align-items: auto; flex-wrap: nowrap; white-space: normal; flex-direction: column; margin-bottom: 30px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 25px;">
@@ -99,4 +99,7 @@
9999
<ui:Label tabindex="-1" text="Cancel" display-tooltip-when-elided="true" name="APINewKeyCancel" class="clickable" style="align-items: flex-start; align-self: center; justify-content: flex-start; font-size: 13px; margin-bottom: 0; padding-bottom: 0; color: rgb(135, 135, 135); margin-top: 8px; padding-top: 0; -unity-font-style: bold-and-italic;" />
100100
</ui:VisualElement>
101101
</ui:VisualElement>
102+
<ui:VisualElement name="LoadingBackground" style="flex-grow: 1; position: absolute; right: 0; left: 0; bottom: 0; top: 0; color: rgb(27, 27, 27); align-self: center; align-items: center; justify-content: center; display: flex; background-color: rgba(0, 0, 0, 0.75); rotate: 0;">
103+
<ui:VisualElement name="LoadingIcon" style="flex-grow: 0; background-color: rgba(255, 255, 255, 0); align-self: center; align-items: center; justify-content: flex-end; width: 50px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 10px; border-right-width: 10px; border-bottom-width: 10px; border-left-width: 10px; border-left-color: rgb(255, 255, 255); border-right-color: rgb(255, 255, 255); border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(255, 255, 255); min-width: 50px; min-height: 50px; max-height: 50px; display: flex; position: relative; max-width: 50px; flex-shrink: 0; height: 50px; bottom: 0; right: 0; top: 0; left: 0; rotate: 0; translate: 0 0; transform-origin: center;" />
104+
</ui:VisualElement>
102105
</ui:UXML>

Runtime/Editor/LootLockerAdminEndPoints.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public class LootLockerAdminEndPoints
1313
public static EndPointClass adminExtensionLogin = new EndPointClass("v1/session", LootLockerHTTPMethod.POST);
1414
public static EndPointClass adminExtensionMFA = new EndPointClass("v1/2fa", LootLockerHTTPMethod.POST);
1515

16-
[Header("User Roles")]
16+
[Header("User Information")]
17+
public static EndPointClass adminExtensionUserInformation = new EndPointClass("v1/user/all", LootLockerHTTPMethod.GET);
1718
public static EndPointClass adminExtensionGetUserRole = new EndPointClass("roles/{0}", LootLockerHTTPMethod.GET);
19+
public static EndPointClass adminExtensionGetGameInformation = new EndPointClass("/game/{0}", LootLockerHTTPMethod.GET);
1820
}
1921
}
2022
#endif
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
#if UNITY_EDITOR && UNITY_2021_3_OR_NEWER
3+
using UnityEditor;
4+
5+
public class LootLockerEditorData
6+
{
7+
private static string prefix = PlayerSettings.productGUID.ToString() + ".LootLocker.";
8+
9+
private static string adminToken = "AdminToken";
10+
private static string selectedGameID = "SelectedGameID";
11+
private static string environment = "Environment";
12+
private static string firstTimeWelcome = "FirstTimeWelcome";
13+
private static string newSession = "NewSession";
14+
15+
public static void ClearLootLockerPrefs()
16+
{
17+
EditorPrefs.DeleteKey(prefix + adminToken);
18+
EditorPrefs.DeleteKey(prefix + selectedGameID);
19+
EditorPrefs.DeleteKey(prefix + environment);
20+
EditorPrefs.DeleteKey(prefix + firstTimeWelcome);
21+
EditorPrefs.DeleteKey(prefix + newSession);
22+
}
23+
24+
public static void SetAdminToken(string _adminToken)
25+
{
26+
EditorPrefs.SetString(prefix + adminToken, _adminToken);
27+
EditorPrefs.SetBool(prefix + firstTimeWelcome, false);
28+
EditorPrefs.SetBool(prefix + newSession, true);
29+
}
30+
31+
public static string GetAdminToken()
32+
{
33+
return EditorPrefs.GetString(prefix + adminToken);
34+
}
35+
36+
public static void SetSelectedGame(string _selectedGame)
37+
{
38+
EditorPrefs.SetInt(prefix + selectedGameID, int.Parse(_selectedGame));
39+
}
40+
41+
public static int GetSelectedGame()
42+
{
43+
return EditorPrefs.GetInt(prefix + selectedGameID);
44+
}
45+
46+
public static void SetEnvironmentStage()
47+
{
48+
EditorPrefs.SetString(prefix + environment, "Stage");
49+
}
50+
51+
public static void SetEnvironmentLive()
52+
{
53+
EditorPrefs.SetString(prefix + environment, "Live");
54+
}
55+
56+
public static bool IsEnvironmentStage()
57+
{
58+
return EditorPrefs.GetString(prefix + environment).Equals("Stage");
59+
}
60+
61+
public static bool ShouldAutoShowWindow()
62+
{
63+
return EditorPrefs.GetBool(prefix + firstTimeWelcome);
64+
}
65+
66+
public static bool IsNewSession()
67+
{
68+
bool result = EditorPrefs.GetBool(prefix + newSession, false);
69+
EditorPrefs.SetBool(prefix + newSession, false);
70+
return result;
71+
}
72+
}
73+
#endif

Runtime/Editor/LootLockerEditorData.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)