From 92aa45646c91c17b8b008b870d2bf2b74ff6c371 Mon Sep 17 00:00:00 2001 From: Mark Joshwel Date: Sun, 11 Aug 2024 07:20:58 +0800 Subject: [PATCH] game(ui): interim overlay uxmls and skeleton scripts --- .../Scripts/OverlayCompleteUnderTimeMenu.cs | 22 +++++ .../OverlayCompleteUnderTimeMenu.cs.meta | 3 + .../Scripts/OverlayFailedOverTimeMenu.cs | 22 +++++ .../Scripts/OverlayFailedOverTimeMenu.cs.meta | 3 + .../Assets/Scripts/OverlayPauseMenu.cs | 22 +++++ .../Assets/Scripts/OverlayPauseMenu.cs.meta | 3 + .../Assets/Scripts/ScreenMainMenu.cs | 86 ++++++++++++++++++ .../Assets/Scripts/ScreenMainMenu.cs.meta | 3 + .../Assets/Scripts/ScreenOptionsMenu.cs | 90 +++++++++++++++++++ .../Assets/Scripts/ScreenOptionsMenu.cs.meta | 3 + .../Assets/UI Toolkit/Interfaces.meta | 8 ++ .../UI Toolkit/Interfaces/OverlayHUD.uxml | 8 ++ .../Interfaces/OverlayHUD.uxml.meta | 10 +++ .../Interfaces/OverlayInteractionPrompt.uxml | 7 ++ .../OverlayInteractionPrompt.uxml.meta | 10 +++ 15 files changed, 300 insertions(+) create mode 100644 RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs create mode 100644 RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs.meta create mode 100644 RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs create mode 100644 RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs.meta create mode 100644 RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs create mode 100644 RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs.meta create mode 100644 RunningLateGame/Assets/Scripts/ScreenMainMenu.cs create mode 100644 RunningLateGame/Assets/Scripts/ScreenMainMenu.cs.meta create mode 100644 RunningLateGame/Assets/Scripts/ScreenOptionsMenu.cs create mode 100644 RunningLateGame/Assets/Scripts/ScreenOptionsMenu.cs.meta create mode 100644 RunningLateGame/Assets/UI Toolkit/Interfaces.meta create mode 100644 RunningLateGame/Assets/UI Toolkit/Interfaces/OverlayHUD.uxml create mode 100644 RunningLateGame/Assets/UI Toolkit/Interfaces/OverlayHUD.uxml.meta create mode 100644 RunningLateGame/Assets/UI Toolkit/Interfaces/OverlayInteractionPrompt.uxml create mode 100644 RunningLateGame/Assets/UI Toolkit/Interfaces/OverlayInteractionPrompt.uxml.meta diff --git a/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs b/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs new file mode 100644 index 0000000..d499e36 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs @@ -0,0 +1,22 @@ +/* + * author: mark joshwel + * date: 11/8/2024 + * description: TODO + */ + +/// +/// TODO +/// +public class OverlayCompleteUnderTimeMenu : CommonMenu +{ + /// + /// function to associate a display state with the menu, + /// and subscribe button events to their respective functions + /// + public override void OnEnable() + { + // set the associated state and call the base OnEnable + associatedState = GameManager.DisplayState.OverlayCompleteUnderTimeMenu; + base.OnEnable(); + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs.meta b/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs.meta new file mode 100644 index 0000000..7d1eb25 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d90104adf847428596a24cd16d00676e +timeCreated: 1723322846 \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs b/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs new file mode 100644 index 0000000..c453ca2 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs @@ -0,0 +1,22 @@ +/* + * author: mark joshwel + * date: 11/8/2024 + * description: TODO + */ + +/// +/// TODO +/// +public class OverlayFailedOverTimeMenu : CommonMenu +{ + /// + /// function to associate a display state with the menu, + /// and subscribe button events to their respective functions + /// + public override void OnEnable() + { + // set the associated state and call the base OnEnable + associatedState = GameManager.DisplayState.OverlayFailedOverTimeMenu; + base.OnEnable(); + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs.meta b/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs.meta new file mode 100644 index 0000000..91ca3c4 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayFailedOverTimeMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9dda88a82bad4822922db26f7f9f4266 +timeCreated: 1723322994 \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs b/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs new file mode 100644 index 0000000..b7e4eeb --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs @@ -0,0 +1,22 @@ +/* + * author: mark joshwel + * date: 11/8/2024 + * description: TODO + */ + +/// +/// TODO +/// +public class OverlayPauseMenu : CommonMenu +{ + /// + /// function to associate a display state with the menu, + /// and subscribe button events to their respective functions + /// + public override void OnEnable() + { + // set the associated state and call the base OnEnable + associatedState = GameManager.DisplayState.OverlayPauseMenu; + base.OnEnable(); + } +} \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs.meta b/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs.meta new file mode 100644 index 0000000..85f2a76 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/OverlayPauseMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 06af012c6fb2403484f6b955d96c91db +timeCreated: 1723323029 \ No newline at end of file diff --git a/RunningLateGame/Assets/Scripts/ScreenMainMenu.cs b/RunningLateGame/Assets/Scripts/ScreenMainMenu.cs new file mode 100644 index 0000000..51e8c14 --- /dev/null +++ b/RunningLateGame/Assets/Scripts/ScreenMainMenu.cs @@ -0,0 +1,86 @@ +/* + * author: mark joshwel + * date: 11/8/2024 + * description: script for handling main menu button functions + */ + +using UnityEngine; +using UnityEngine.UIElements; + +/// +/// class managing the main menu and button function invocations +/// +public class ScreenMainMenu : CommonMenu +{ + /// + /// button to quit game + /// + public Button ButtonExit; + + /// + /// button to show the options menu + /// + public Button ButtonOptions; + + /// + /// button to play game + /// + public Button ButtonPlay; + + /// + /// function to associate a display state with the menu, + /// and subscribe button events to their respective functions + /// + public override void OnEnable() + { + // set the associated state and call the base OnEnable + associatedState = GameManager.DisplayState.ScreenMainMenu; + base.OnEnable(); + + // get the start button from the ui root and subscribe appropriate functions + ButtonPlay = UI.Q