Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mod versioning #903

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/nativefuncs.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
"argTypes":"string modName, string modVersion, bool enabled"
},
{
"name":"DecodeJSON",
Expand Down Expand Up @@ -222,7 +222,7 @@
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
"argTypes":"string modName, string modVersion, bool enabled"
},
{
"name":"DecodeJSON",
Expand Down Expand Up @@ -392,7 +392,7 @@
"name":"NSSetModEnabled",
"helpText":"",
"returnTypeString":"void",
"argTypes":"string modName, bool enabled"
"argTypes":"string modName, string modVersion, bool enabled"
},
{
"name": "NSFetchVerifiedModsManifesto",
Expand Down
6 changes: 3 additions & 3 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_ns_modmenu.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<ModInfo> infos = NSGetModInformation( mod.name )
Expand Down Expand Up @@ -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<ModInfo> infos = NSGetModInformation( mod.name )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand All @@ -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))
}
}
Expand All @@ -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
}
Expand Down
Loading