game: working PopulateFields
This commit is contained in:
parent
685fbe961d
commit
30c82d77f6
5 changed files with 175 additions and 99 deletions
|
@ -78,6 +78,11 @@ public class AccountUI : MonoBehaviour
|
|||
/// </summary>
|
||||
private Button _usernameUpdateButton;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
GameManager.Instance.Backend.RegisterOnSignInCallback(OnSignInCallback);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (state == State.UnassociatedState) throw new Exception("unreachable state");
|
||||
|
@ -118,11 +123,6 @@ public class AccountUI : MonoBehaviour
|
|||
TransitionStateTo(State.NotSignedIn);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
GameManager.Instance.Backend.RegisterOnSignInCallback(OnSignInCallback);
|
||||
}
|
||||
|
||||
private void OnSignInCallback(FirebaseUser user)
|
||||
{
|
||||
Debug.Log("sign in account ui callback");
|
||||
|
@ -134,15 +134,6 @@ public class AccountUI : MonoBehaviour
|
|||
_header.text = $"Signed in as {username}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// populate the fields with the given username and email, used by GameManager after local player data is loaded
|
||||
/// </summary>
|
||||
public void PopulateFields(string username, string email)
|
||||
{
|
||||
_usernameField.value = username;
|
||||
_emailField.value = email;
|
||||
}
|
||||
|
||||
private void TransitionStateTo(State newState, bool keepAccompanyingText = false)
|
||||
{
|
||||
// if we're transitioning to the same state, do nothing
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
/// <summary>
|
||||
/// singleton for a single source of truth game state and flow management
|
||||
|
@ -10,6 +11,11 @@ public class GameManager : MonoBehaviour
|
|||
/// </summary>
|
||||
public static GameManager Instance;
|
||||
|
||||
/// <summary>
|
||||
/// ui manager object for handling ui state and flow
|
||||
/// </summary>
|
||||
public UIManager ui;
|
||||
|
||||
/// <summary>
|
||||
/// the local player data object for storing player data
|
||||
/// </summary>
|
||||
|
@ -20,11 +26,6 @@ public class GameManager : MonoBehaviour
|
|||
/// </summary>
|
||||
public Backend Backend;
|
||||
|
||||
/// <summary>
|
||||
/// ui manager object for handling ui state and flow
|
||||
/// </summary>
|
||||
public UIManager ui;
|
||||
|
||||
/// <summary>
|
||||
/// enforces singleton behaviour; sets doesn't destroy on load and checks for multiple instances
|
||||
/// </summary>
|
||||
|
@ -43,7 +44,17 @@ public class GameManager : MonoBehaviour
|
|||
Debug.Log("awake as non-singleton instance, destroying self");
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// load the local player data and refresh the ui
|
||||
_localPlayerData = new LocalPlayerData();
|
||||
_localPlayerData.LoadFromTheWorld();
|
||||
PopulateFields();
|
||||
|
||||
// register a callback to refresh the ui when the player signs in
|
||||
Backend.RegisterOnSignInCallback(_ => { _localPlayerData.LoadFromTheWorld(); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -56,21 +67,22 @@ public class GameManager : MonoBehaviour
|
|||
ui = UIManager.Instance;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
/// <summary>
|
||||
/// called when the application is quitting, saves the local player data
|
||||
/// </summary>
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
// load the local player data and refresh the ui
|
||||
_localPlayerData = new LocalPlayerData();
|
||||
_localPlayerData.LoadFromTheWorld();
|
||||
|
||||
// register a callback to refresh the ui when the player signs in
|
||||
Backend.RegisterOnSignInCallback(_ => { _localPlayerData.LoadFromTheWorld(); });
|
||||
Debug.Log("running deferred cleanup/save functions");
|
||||
Backend.Cleanup();
|
||||
_localPlayerData.SaveToTheWorld();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// called when the game object is disabled
|
||||
/// populate the fields with the given username and email, used by GameManager after local player data is loaded
|
||||
/// </summary>
|
||||
private void OnDestroy()
|
||||
public void PopulateFields()
|
||||
{
|
||||
Backend.Cleanup();
|
||||
ui.UI.Q<TextField>("UsernameField").value = _localPlayerData.LastKnownUsername;
|
||||
ui.UI.Q<TextField>("EmailField").value = _localPlayerData.LastKnownEmail;
|
||||
}
|
||||
}
|
|
@ -90,7 +90,8 @@ public class LocalPlayerData
|
|||
RecentOnlineScores.Enqueue(onlineScore);
|
||||
}
|
||||
|
||||
Debug.Log("loaded online scores from backend");
|
||||
Debug.Log(
|
||||
$"loaded lpdata from the world ({LastKnownUsername} <{LastKnownEmail}> with RLS.Count={RecentLocalScores.Count}), ROS.Count={RecentOnlineScores.Count}");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -114,8 +115,7 @@ public class LocalPlayerData
|
|||
idx++;
|
||||
}
|
||||
|
||||
Debug.Log("saved lpdata to playerprefs");
|
||||
// online scores are already saved in the backend
|
||||
Debug.Log("saved lpdata to playerprefs"); // online scores are already saved in the backend
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -128,7 +128,6 @@ public class LocalPlayerData
|
|||
RecentLocalScores.Enqueue(score);
|
||||
}
|
||||
|
||||
|
||||
public struct Score
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -4,11 +4,6 @@ using UnityEngine.UIElements;
|
|||
|
||||
public class UIManager : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// singleton pattern: define instance field for accessing the singleton elsewhere
|
||||
/// </summary>
|
||||
public static UIManager Instance;
|
||||
|
||||
/// <summary>
|
||||
/// enum for available menus in the game, for use with <c>ShowMenu()</c>
|
||||
/// </summary>
|
||||
|
@ -20,12 +15,17 @@ public class UIManager : MonoBehaviour
|
|||
LeaderboardView,
|
||||
AccountView
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// singleton pattern: define instance field for accessing the singleton elsewhere
|
||||
/// </summary>
|
||||
public static UIManager Instance;
|
||||
|
||||
/// <summary>
|
||||
/// the current display state of the game
|
||||
/// </summary>
|
||||
[SerializeField] private DisplayState state = DisplayState.UnassociatedState;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// the visual element object for game ui
|
||||
/// </summary>
|
||||
|
@ -56,7 +56,7 @@ public class UIManager : MonoBehaviour
|
|||
UI = GetComponent<UIDocument>().rootVisualElement;
|
||||
SetDisplayState(DisplayState.Nothing);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// function to show a menu based on the enum passed,
|
||||
/// and any other necessary actions
|
||||
|
|
|
@ -1,92 +1,166 @@
|
|||
<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="False">
|
||||
<Style src="project://database/Assets/UI/GameUI.uss?fileID=7433441132597879392&guid=2c7ff79f21a3e8e408e76d75944d575b&type=3#GameUI" />
|
||||
<ui:VisualElement name="Root" style="flex-grow: 1; background-color: rgb(208, 152, 194); justify-content: space-around; align-items: stretch; align-self: stretch; flex-direction: row;">
|
||||
<ui:VisualElement name="SideView" style="flex-grow: 0; background-color: rgb(15, 13, 27); flex-shrink: 0; width: 25%; justify-content: space-between;">
|
||||
<ui:VisualElement name="Header" style="flex-grow: 0; margin-top: 10%; margin-right: 10%; margin-bottom: 0; margin-left: 10%; justify-content: space-between; align-items: flex-start; flex-direction: column;">
|
||||
<ui:Label tabindex="-1" text="Colour Me OK" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Name" style="color: rgb(208, 152, 194); -unity-font-style: bold; font-size: 58px; white-space: normal;" />
|
||||
<ui:Label tabindex="-1" text="Color Me OK is a colour-matching game using the coordinates of the OKLCh colour model on the OKLab perceptually uniform colour space." parse-escape-sequences="true" display-tooltip-when-elided="true" name="Description" style="font-size: 16px; white-space: normal; text-overflow: clip; color: rgb(208, 152, 194);" />
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
engine="UnityEngine.UIElements" editor="UnityEditor.UIElements"
|
||||
noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
|
||||
<Style src="project://database/Assets/UI/GameUI.uss?fileID=7433441132597879392&guid=2c7ff79f21a3e8e408e76d75944d575b&type=3#GameUI"/>
|
||||
<ui:VisualElement name="Root"
|
||||
style="flex-grow: 1; background-color: rgb(208, 152, 194); justify-content: space-around; align-items: stretch; align-self: stretch; flex-direction: row;">
|
||||
<ui:VisualElement name="SideView"
|
||||
style="flex-grow: 0; background-color: rgb(15, 13, 27); flex-shrink: 0; width: 25%; justify-content: space-between;">
|
||||
<ui:VisualElement name="Header"
|
||||
style="flex-grow: 0; margin-top: 10%; margin-right: 10%; margin-bottom: 0; margin-left: 10%; justify-content: space-between; align-items: flex-start; flex-direction: column;">
|
||||
<ui:Label tabindex="-1" text="Colour Me OK" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="Name"
|
||||
style="color: rgb(208, 152, 194); -unity-font-style: bold; font-size: 58px; white-space: normal;"/>
|
||||
<ui:Label tabindex="-1"
|
||||
text="Color Me OK is a colour-matching game using the coordinates of the OKLCh colour model on the OKLab perceptually uniform colour space."
|
||||
parse-escape-sequences="true" display-tooltip-when-elided="true" name="Description"
|
||||
style="font-size: 16px; white-space: normal; text-overflow: clip; color: rgb(208, 152, 194);"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="Content" style="flex-grow: 0; padding-right: 10%; padding-bottom: 10%; padding-left: 10%;">
|
||||
<ui:Button text="Play ↗" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PlayButton" />
|
||||
<ui:Button text="Leaderboard ↗" parse-escape-sequences="true" display-tooltip-when-elided="true" name="LeaderboardButton" />
|
||||
<ui:Button text="Account ↗" parse-escape-sequences="true" display-tooltip-when-elided="true" name="AccountButton" />
|
||||
<ui:VisualElement name="AccountSection" style="flex-grow: 0; border-top-color: rgb(208, 152, 194); margin-top: 0; border-top-width: 1px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-color: rgb(208, 152, 194); padding-bottom: 12px;">
|
||||
<ui:VisualElement name="PlayerDetails" style="flex-grow: 1; flex-direction: row; align-items: stretch; justify-content: space-between; font-size: 10px; align-self: stretch;">
|
||||
<ui:VisualElement name="Content"
|
||||
style="flex-grow: 0; padding-right: 10%; padding-bottom: 10%; padding-left: 10%;">
|
||||
<ui:Button text="Play ↗" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="PlayButton"/>
|
||||
<ui:Button text="Leaderboard ↗" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="LeaderboardButton"/>
|
||||
<ui:Button text="Account ↗" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="AccountButton"/>
|
||||
<ui:VisualElement name="AccountSection"
|
||||
style="flex-grow: 0; border-top-color: rgb(208, 152, 194); margin-top: 0; border-top-width: 1px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-color: rgb(208, 152, 194); padding-bottom: 12px;">
|
||||
<ui:VisualElement name="PlayerDetails"
|
||||
style="flex-grow: 1; flex-direction: row; align-items: stretch; justify-content: space-between; font-size: 10px; align-self: stretch;">
|
||||
<ui:VisualElement name="PlayerNameDetail" style="flex-grow: 1;">
|
||||
<ui:Label tabindex="-1" text="Player" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PlayerHeader" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left;" />
|
||||
<ui:Label tabindex="-1" text="Not Signed In" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PlayerText" style="-unity-font-style: normal; font-size: 18px; padding-top: 6px;" />
|
||||
<ui:Label tabindex="-1" text="Player" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="PlayerHeader"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left;"/>
|
||||
<ui:Label tabindex="-1" text="Not Signed In" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="PlayerText"
|
||||
style="-unity-font-style: normal; font-size: 18px; padding-top: 6px;"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="PlayerRatingDetail" style="flex-grow: 0;">
|
||||
<ui:Label tabindex="-1" text="Rating" parse-escape-sequences="true" display-tooltip-when-elided="true" name="RatingHeader" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-right;" />
|
||||
<ui:Label tabindex="-1" text="00.00%" parse-escape-sequences="true" display-tooltip-when-elided="true" name="RatingText" style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-right;" />
|
||||
<ui:Label tabindex="-1" text="Rating" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="RatingHeader"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-right;"/>
|
||||
<ui:Label tabindex="-1" text="00.00%" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="RatingText"
|
||||
style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-right;"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="AccuracyDetails" style="flex-grow: 1; flex-direction: row; align-items: stretch; justify-content: space-between; font-size: 10px; align-self: stretch; padding-top: 4px;">
|
||||
<ui:VisualElement name="AccuracyDetails"
|
||||
style="flex-grow: 1; flex-direction: row; align-items: stretch; justify-content: space-between; font-size: 10px; align-self: stretch; padding-top: 4px;">
|
||||
<ui:VisualElement name="LightnessAccuracyDetail" style="flex-grow: 0;">
|
||||
<ui:Label tabindex="-1" text="Lightness Accuracy" parse-escape-sequences="true" display-tooltip-when-elided="true" name="LightnessAccuracyHeader" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left; padding-top: 0;" />
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true" display-tooltip-when-elided="true" name="LightnessAccuracyText" style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; padding-bottom: 0;" />
|
||||
<ui:Label tabindex="-1" text="Lightness Accuracy" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="LightnessAccuracyHeader"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left; padding-top: 0;"/>
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="LightnessAccuracyText"
|
||||
style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; padding-bottom: 0;"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ChromaAccuracyDetail" style="flex-grow: 0;">
|
||||
<ui:Label tabindex="-1" text="Chroma Accuracy" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ChromaAccuracyHeader" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-center; padding-top: 0;" />
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ChromaAccuracyText" style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-center; padding-bottom: 0;" />
|
||||
<ui:Label tabindex="-1" text="Chroma Accuracy" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="ChromaAccuracyHeader"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-center; padding-top: 0;"/>
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="ChromaAccuracyText"
|
||||
style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-center; padding-bottom: 0;"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="HueAccuracyDetail" style="flex-grow: 0;">
|
||||
<ui:Label tabindex="-1" text="Hue Accuracy" parse-escape-sequences="true" display-tooltip-when-elided="true" name="HueAccuracyHeader" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-right; padding-top: 0;" />
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true" display-tooltip-when-elided="true" name="HueAccuracyText" style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-right; padding-bottom: 0;" />
|
||||
<ui:Label tabindex="-1" text="Hue Accuracy" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="HueAccuracyHeader"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-right; padding-top: 0;"/>
|
||||
<ui:Label tabindex="-1" text="00.0%" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="HueAccuracyText"
|
||||
style="-unity-font-style: normal; font-size: 18px; padding-top: 6px; -unity-text-align: upper-right; padding-bottom: 0;"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ConnectionStatusText" style="flex-grow: 0; border-top-color: rgb(208, 152, 194); margin-top: 0; border-top-width: 1px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-color: rgb(208, 152, 194); border-bottom-width: 1px; padding-bottom: 12px;">
|
||||
<ui:Label tabindex="-1" text="Status: Unknown" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ConnectionStatusText" style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left;" />
|
||||
<ui:VisualElement name="ConnectionStatusText"
|
||||
style="flex-grow: 0; border-top-color: rgb(208, 152, 194); margin-top: 0; border-top-width: 1px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-color: rgb(208, 152, 194); border-bottom-width: 1px; padding-bottom: 12px;">
|
||||
<ui:Label tabindex="-1" text="Status: Unknown" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="ConnectionStatusText"
|
||||
style="-unity-font-style: normal; font-size: 14px; padding-bottom: 0; -unity-text-align: lower-left;"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="MainView" style="flex-grow: 0; flex-shrink: 0; width: 75%; justify-content: space-between;">
|
||||
<ui:VisualElement name="GameView" style="flex-grow: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; justify-content: space-between; height: 100%; align-self: stretch; display: none;">
|
||||
<ui:VisualElement name="GameHeader" style="flex-grow: 0; flex-direction: row; justify-content: space-between; align-self: stretch;">
|
||||
<ui:Label tabindex="-1" text="1/5" parse-escape-sequences="true" display-tooltip-when-elided="true" name="RoundText" style="font-size: 58px; -unity-font-style: normal;" />
|
||||
<ui:Label tabindex="-1" text="0.00s" parse-escape-sequences="true" display-tooltip-when-elided="true" name="TimeText" style="-unity-text-align: lower-right; font-size: 58px;" />
|
||||
<ui:VisualElement name="MainView"
|
||||
style="flex-grow: 0; flex-shrink: 0; width: 75%; justify-content: space-between;">
|
||||
<ui:VisualElement name="GameView"
|
||||
style="flex-grow: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; justify-content: space-between; height: 100%; align-self: stretch; display: none;">
|
||||
<ui:VisualElement name="GameHeader"
|
||||
style="flex-grow: 0; flex-direction: row; justify-content: space-between; align-self: stretch;">
|
||||
<ui:Label tabindex="-1" text="1/5" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="RoundText" style="font-size: 58px; -unity-font-style: normal;"/>
|
||||
<ui:Label tabindex="-1" text="0.00s" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="TimeText"
|
||||
style="-unity-text-align: lower-right; font-size: 58px;"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ColourPreview" style="flex-grow: 0; height: 50%; background-color: rgb(255, 255, 255); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; flex-direction: row; padding-top: 2%; padding-right: 2%; padding-bottom: 2%; padding-left: 2%; justify-content: space-between;">
|
||||
<ui:VisualElement name="TemplatePreview" style="flex-grow: 0; flex-shrink: 0; height: 100%; width: 49%;">
|
||||
<ui:Label tabindex="-1" text="Template" parse-escape-sequences="true" display-tooltip-when-elided="true" name="TemplateText" style="margin-bottom: 12px; margin-top: 0; -unity-font-style: normal;" />
|
||||
<ui:VisualElement name="TemplateColour" style="flex-grow: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; background-color: rgb(0, 0, 0);" />
|
||||
<ui:VisualElement name="ColourPreview"
|
||||
style="flex-grow: 0; height: 50%; background-color: rgb(255, 255, 255); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; flex-direction: row; padding-top: 2%; padding-right: 2%; padding-bottom: 2%; padding-left: 2%; justify-content: space-between;">
|
||||
<ui:VisualElement name="TemplatePreview"
|
||||
style="flex-grow: 0; flex-shrink: 0; height: 100%; width: 49%;">
|
||||
<ui:Label tabindex="-1" text="Template" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="TemplateText"
|
||||
style="margin-bottom: 12px; margin-top: 0; -unity-font-style: normal;"/>
|
||||
<ui:VisualElement name="TemplateColour"
|
||||
style="flex-grow: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; background-color: rgb(0, 0, 0);"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ResponsePreview" style="flex-grow: 0; flex-shrink: 0; height: 100%; width: 49%;">
|
||||
<ui:Label tabindex="-1" text="Response" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ResponseText" style="margin-bottom: 12px; margin-top: 0; -unity-font-style: normal; -unity-text-align: upper-right;" />
|
||||
<ui:VisualElement name="ResponseColour" style="flex-grow: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; background-color: rgb(0, 0, 0);" />
|
||||
<ui:VisualElement name="ResponsePreview"
|
||||
style="flex-grow: 0; flex-shrink: 0; height: 100%; width: 49%;">
|
||||
<ui:Label tabindex="-1" text="Response" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="ResponseText"
|
||||
style="margin-bottom: 12px; margin-top: 0; -unity-font-style: normal; -unity-text-align: upper-right;"/>
|
||||
<ui:VisualElement name="ResponseColour"
|
||||
style="flex-grow: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; background-color: rgb(0, 0, 0);"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="ResponseSliders" style="flex-grow: 0; display: flex;">
|
||||
<ui:Slider label="Lightness" high-value="100" name="ResponseLightnessSlider" class="lch-slider" />
|
||||
<ui:Slider label="Chroma" high-value="0.5" name="ResponseChromaSlider" class="lch-slider" />
|
||||
<ui:Slider label="Hue" high-value="360" name="ResponseHueSlider" class="lch-slider" />
|
||||
<ui:Slider label="Lightness" high-value="100" name="ResponseLightnessSlider" class="lch-slider"/>
|
||||
<ui:Slider label="Chroma" high-value="0.5" name="ResponseChromaSlider" class="lch-slider"/>
|
||||
<ui:Slider label="Hue" high-value="360" name="ResponseHueSlider" class="lch-slider"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="LeaderboardView" style="flex-grow: 1; display: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; flex-direction: column; justify-content: space-between;">
|
||||
<ui:Label tabindex="-1" text="Leaderboard" parse-escape-sequences="true" display-tooltip-when-elided="true" name="RoundText" style="font-size: 58px; -unity-font-style: normal;" />
|
||||
<ui:ListView name="LeaderboardListView" />
|
||||
<ui:VisualElement name="LeaderboardView"
|
||||
style="flex-grow: 1; display: none; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; flex-direction: column; justify-content: space-between;">
|
||||
<ui:Label tabindex="-1" text="Leaderboard" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="RoundText"
|
||||
style="font-size: 58px; -unity-font-style: normal;"/>
|
||||
<ui:ListView name="LeaderboardListView"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="AccountView" style="flex-grow: 1; display: flex; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; flex-direction: column; justify-content: space-between;">
|
||||
<ui:Label tabindex="-1" text="You are not signed in." parse-escape-sequences="true" display-tooltip-when-elided="true" name="AccountHeader" style="font-size: 58px; -unity-font-style: normal;" />
|
||||
<ui:VisualElement name="AccountView"
|
||||
style="flex-grow: 1; display: flex; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 3.25%; margin-right: 3.25%; margin-bottom: 3.25%; margin-left: 3.25%; flex-direction: column; justify-content: space-between;">
|
||||
<ui:Label tabindex="-1" text="You are not signed in." parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="AccountHeader"
|
||||
style="font-size: 58px; -unity-font-style: normal;"/>
|
||||
<ui:VisualElement name="AccountFields" style="flex-grow: 0;">
|
||||
<ui:VisualElement name="UsernameContainer" style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Username" name="UsernameField" />
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true" name="UsernameUpdateButton" />
|
||||
<ui:VisualElement name="UsernameContainer"
|
||||
style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Username" name="UsernameField"/>
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="UsernameUpdateButton"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="EmailContainer" style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Email" name="EmailField" keyboard-type="EmailAddress" />
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true" name="EmailUpdateButton" />
|
||||
<ui:VisualElement name="EmailContainer"
|
||||
style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Email" name="EmailField"
|
||||
keyboard-type="EmailAddress"/>
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="EmailUpdateButton"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="PasswordContainer" style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Password" name="PasswordField" password="true" />
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PasswordUpdateButton" />
|
||||
<ui:VisualElement name="PasswordContainer"
|
||||
style="flex-grow: 1; flex-direction: row; justify-content: space-between;">
|
||||
<ui:TextField picking-mode="Ignore" label="Password" name="PasswordField" password="true"/>
|
||||
<ui:Button text="Update" parse-escape-sequences="true" display-tooltip-when-elided="true"
|
||||
name="PasswordUpdateButton"/>
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="A verification email has been sent. Check your inbox." parse-escape-sequences="true" display-tooltip-when-elided="true" name="AccompanyingText" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 1.5%; margin-right: 0; margin-bottom: 0.75%; margin-left: 0; -unity-text-align: upper-left; display: none;" />
|
||||
<ui:Label tabindex="-1" text="A verification email has been sent. Check your inbox."
|
||||
parse-escape-sequences="true" display-tooltip-when-elided="true" name="AccompanyingText"
|
||||
style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 1.5%; margin-right: 0; margin-bottom: 0.75%; margin-left: 0; -unity-text-align: upper-left; display: none;"/>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="AccountButtons" style="flex-grow: 0; align-items: flex-start;">
|
||||
<ui:Button text="Primary Action Button →" parse-escape-sequences="true" display-tooltip-when-elided="true" name="PrimaryActionButton" style="-unity-text-align: middle-center; margin-bottom: 1%; margin-right: 1%; margin-top: 1%; -unity-font-style: bold;" />
|
||||
<ui:Button text="Secondary Action Button →" parse-escape-sequences="true" display-tooltip-when-elided="true" name="SecondaryActionButton" style="margin-top: 1%; margin-right: 1%; -unity-font-style: bold;" />
|
||||
<ui:Button text="Primary Action Button →" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="PrimaryActionButton"
|
||||
style="-unity-text-align: middle-center; margin-bottom: 1%; margin-right: 1%; margin-top: 1%; -unity-font-style: bold;"/>
|
||||
<ui:Button text="Secondary Action Button →" parse-escape-sequences="true"
|
||||
display-tooltip-when-elided="true" name="SecondaryActionButton"
|
||||
style="margin-top: 1%; margin-right: 1%; -unity-font-style: bold;"/>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
|
|
Reference in a new issue