diff --git a/.github/nativefuncs.json b/.github/nativefuncs.json index 10ceebd5d..059c03021 100644 --- a/.github/nativefuncs.json +++ b/.github/nativefuncs.json @@ -16,7 +16,7 @@ "name":"NSSetModEnabled", "helpText":"", "returnTypeString":"void", - "argTypes":"string modName, bool enabled" + "argTypes":"string modName, string modVersion, bool enabled" }, { "name":"DecodeJSON", @@ -222,7 +222,7 @@ "name":"NSSetModEnabled", "helpText":"", "returnTypeString":"void", - "argTypes":"string modName, bool enabled" + "argTypes":"string modName, string modVersion, bool enabled" }, { "name":"DecodeJSON", @@ -392,7 +392,7 @@ "name":"NSSetModEnabled", "helpText":"", "returnTypeString":"void", - "argTypes":"string modName, bool enabled" + "argTypes":"string modName, string modVersion, bool enabled" }, { "name": "NSFetchVerifiedModsManifesto", 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 67a184312..f8fab6940 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut @@ -149,7 +149,7 @@ void function OnModMenuClosed() foreach ( ModInfo enMod in file.enabledMods ) { - if ( mod.name == enMod.name ) + if ( mod.name == enMod.name && mod.version == enMod.version ) { notFound = false break @@ -210,7 +210,7 @@ void function OnModButtonPressed( var button ) CoreModToggleDialog( modName ) else { - NSSetModEnabled( modName, !mod.enabled ) + NSSetModEnabled( modName, mod.version, !mod.enabled ) // retrieve state of the mod that just got toggled array infos = NSGetModInformation( mod.name ) @@ -304,7 +304,7 @@ void function DisableMod() { ModInfo mod = file.mods[ int ( Hud_GetScriptID( Hud_GetParent( file.currentButton ) ) ) + file.scrollOffset - 1 ].mod string modName = mod.name - NSSetModEnabled( modName, false ) + NSSetModEnabled( modName, mod.version, false ) // retrieve state of the mod that just got toggled array infos = NSGetModInformation( mod.name ) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index f2effd128..c014a3cb1 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -1132,7 +1132,7 @@ void function ThreadedAuthAndConnectToServer( string password = "", bool modsCha if (!found) { modsChanged = true - NSSetModEnabled( modName, false ) + NSSetModEnabled( modName, modVersion, false ) print(format("Disabled \"%s\" (v%s) since it's not required on server.", modName, modVersion)) } } @@ -1151,7 +1151,7 @@ void function ThreadedAuthAndConnectToServer( string password = "", bool modsCha if ( !localModInfos[0].enabled ) { modsChanged = true - NSSetModEnabled( modName, true ) + NSSetModEnabled( modName, localModInfos[0].version, true ) print(format("Enabled \"%s\" (v%s) to join server.", modName, localModInfos[0].version)) } } @@ -1160,10 +1160,10 @@ void function ThreadedAuthAndConnectToServer( string password = "", bool modsCha { foreach( localMod in localModInfos ) { - if ( localMod.version == mod.version ) + if ( localMod.version == mod.version && !localMod.enabled) { modsChanged = true - NSSetModEnabled( mod.name, true ) + NSSetModEnabled( mod.name, mod.version, true ) print(format("Enabled \"%s\" (v%s) to join server.", modName, modVersion)) break }