diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-09-02 17:52:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 18:52:06 +0200 |
commit | 1d95b7d5f3a4b7176456c94b147f0382de04f18e (patch) | |
tree | 1678c273b68985fe54cde59154a37a47b89bf419 /Northstar.Client/mod/scripts | |
parent | c7e50b28fe31e20b064f812758d8a0f5e889ea74 (diff) | |
download | NorthstarMods-1d95b7d5f3a4b7176456c94b147f0382de04f18e.tar.gz NorthstarMods-1d95b7d5f3a4b7176456c94b147f0382de04f18e.zip |
Progression system (#655)
This also can't hurt right?
---------
Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
Diffstat (limited to 'Northstar.Client/mod/scripts')
-rw-r--r-- | Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut index 2bef0e20..e4cc5687 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut @@ -178,6 +178,8 @@ void function InitLobbyMenu() AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" ) AddMenuFooterOption( menu, BUTTON_BACK, "#BACK_BUTTON_POSTGAME_REPORT", "#POSTGAME_REPORT", OpenPostGameMenu, IsPostGameMenuValid ) AddMenuFooterOption( menu, BUTTON_TRIGGER_RIGHT, "#R_TRIGGER_CHAT", "", null, IsVoiceChatPushToTalk ) + // Client side progression toggle + AddMenuFooterOption( menu, BUTTON_Y, "#Y_BUTTON_TOGGLE_PROGRESSION", "#TOGGLE_PROGRESSION", ShowToggleProgressionDialog ) InitChatroom( menu ) @@ -226,6 +228,57 @@ void function InitLobbyMenu() RegisterSignal( "LeaveParty" ) } +void function ShowToggleProgressionDialog( var button ) +{ + bool enabled = Progression_GetPreference() + + DialogData dialogData + dialogData.menu = GetMenu( "AnnouncementDialog" ) + dialogData.header = enabled ? "#PROGRESSION_TOGGLE_ENABLED_HEADER" : "#PROGRESSION_TOGGLE_DISABLED_HEADER" + dialogData.message = enabled ? "#PROGRESSION_TOGGLE_ENABLED_BODY" : "#PROGRESSION_TOGGLE_DISABLED_BODY" + dialogData.image = $"ui/menu/common/dialog_announcement_1" + + AddDialogButton( dialogData, "#NO" ) + AddDialogButton( dialogData, "#YES", enabled ? DisableProgression : EnableProgression ) + + OpenDialog( dialogData ) +} + +void function EnableProgression() +{ + Progression_SetPreference( true ) + + // update the cache just in case something changed + UpdateCachedLoadouts_Delayed() + + DialogData dialogData + dialogData.menu = GetMenu( "AnnouncementDialog" ) + dialogData.header = "#PROGRESSION_ENABLED_HEADER" + dialogData.message = "#PROGRESSION_ENABLED_BODY" + dialogData.image = $"ui/menu/common/dialog_announcement_1" + + AddDialogButton( dialogData, "#OK" ) + + EmitUISound( "UI_Menu_Item_Purchased_Stinger" ) + + OpenDialog( dialogData ) +} + +void function DisableProgression() +{ + Progression_SetPreference( false ) + + DialogData dialogData + dialogData.menu = GetMenu( "AnnouncementDialog" ) + dialogData.header = "#PROGRESSION_DISABLED_HEADER" + dialogData.message = "#PROGRESSION_DISABLED_BODY" + dialogData.image = $"ui/menu/common/dialog_announcement_1" + + AddDialogButton( dialogData, "#OK" ) + + OpenDialog( dialogData ) +} + void function SetupComboButtonTest( var menu ) { ComboStruct comboStruct = ComboButtons_Create( menu ) |