mirror of
https://github.com/R2Northstar/NorthstarMods
synced 2026-08-25 12:29:17 -04:00
fix: Mod versioning (#903)
* feat: `NSSetModEnabled` now takes mod version as argument
This commit is contained in:
parent
e29e347021
commit
2d3ed5e2c0
3 changed files with 10 additions and 10 deletions
|
|
@ -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<ModInfo> 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<ModInfo> infos = NSGetModInformation( mod.name )
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue