aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2022-01-10 21:59:56 +0100
committerGitHub <noreply@github.com>2022-01-10 17:59:56 -0300
commitb2c443cbe04361933bd4531ab8e747a8ffa368cd (patch)
tree093e6695c0817bfb037efd7c9086b5a95d44f6c8 /Northstar.Client
parent9acf30fdf2e0d1aaef1c7a3f79168c8afe6e2f88 (diff)
downloadNorthstarMods-b2c443cbe04361933bd4531ab8e747a8ffa368cd.tar.gz
NorthstarMods-b2c443cbe04361933bd4531ab8e747a8ffa368cd.zip
Add a warning when disabling core mods (#98)
Diffstat (limited to 'Northstar.Client')
-rw-r--r--Northstar.Client/mod/resource/northstar_client_localisation_english.txtbin22158 -> 22402 bytes
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut43
2 files changed, 40 insertions, 3 deletions
diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt
index c74bbef3b..c8d400b86 100644
--- a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt
+++ b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt
Binary files differ
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut
index cb1535d32..cc681e95b 100644
--- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut
+++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut
@@ -4,6 +4,8 @@ global function ReloadMods
struct {
bool shouldReloadModsOnEnd
+ string currentMod
+ var currentButton
} file
void function AddNorthstarModMenu()
@@ -83,9 +85,44 @@ void function SetModMenuNameText( var button )
void function OnModMenuButtonPressed( var button )
{
string modName = NSGetModNames()[ int ( Hud_GetScriptID( button ) ) ]
- NSSetModEnabled( modName, !NSIsModEnabled( modName ) )
- SetModMenuNameText( button )
-
+ if ( ( modName == "Northstar.Client" || modName == "Northstar.Coop" || modName == "Northstar.CustomServers") && NSIsModEnabled( modName ) )
+ {
+ file.currentMod = modName
+ file.currentButton = button
+ CoreModToggleDialog( modName )
+ }
+ else
+ {
+ NSSetModEnabled( modName, !NSIsModEnabled( modName ) )
+
+ SetModMenuNameText( button )
+
+ file.shouldReloadModsOnEnd = true
+ }
+}
+
+void function CoreModToggleDialog( string mod )
+{
+ DialogData dialogData
+ dialogData.header = "#WARNING"
+ dialogData.message = "#CORE_MOD_DISABLE_WARNING"
+
+ AddDialogButton( dialogData, "#CANCEL" )
+ // This can't have any arguments so we use the file struct
+ AddDialogButton( dialogData, "#DISABLE", DisableMod )
+
+ AddDialogFooter( dialogData, "#A_BUTTON_SELECT" )
+ AddDialogFooter( dialogData, "#B_BUTTON_CANCEL" )
+
+ OpenDialog( dialogData )
+}
+
+void function DisableMod()
+{
+ NSSetModEnabled( file.currentMod, false )
+
+ SetModMenuNameText( file.currentButton )
+
file.shouldReloadModsOnEnd = true
}