@@ -338,10 +338,10 @@ local function enableMod(mod)
338338 enableMods ({[" name" ] = mod })
339339end
340340
341- -- disable mods on the UI
342- local function disableMods (mods )
341+ -- disable mods on the UI, optionally including favorites
342+ local function disableMods (mods , alsoDisableFavorites )
343343 for _ , mod in pairs (mods ) do
344- if not mod .info .IsBlacklisted then
344+ if not mod .info .IsBlacklisted and ( alsoDisableFavorites or not mod . info . IsFavorite ) then
345345 handleModEnabledStateChange (mod , false )
346346 end
347347 end
352352
353353local function disableMod (mod )
354354 -- we could use mod.info.Name, but that might be nil for mods without everest.yaml, and disableMods() doesn't care
355- disableMods ({[" name" ] = mod })
355+ -- this function should only be used for explicitly disabling one mod, so we should disable it even if it's a favorite
356+ disableMods ({[" name" ] = mod }, true )
356357end
357358
358359-- builds the confirmation message body for toggling mods, including a potentially-long list of mods in a scrollbox
@@ -559,7 +560,7 @@ local function checkEnabledDependenciesOfDisabledMods(newlyDisabledMods)
559560 " Yes" ,
560561 function (container )
561562 -- disable them all!
562- disableMods (dependenciesThatCanBeDisabled )
563+ disableMods (dependenciesThatCanBeDisabled , false )
563564 container :close ()
564565 end
565566 },
@@ -595,7 +596,7 @@ local function checkEnabledDependentsOfDisabledMod(mod)
595596 " Yes" ,
596597 function (container )
597598 -- disable them all!
598- disableMods (dependentsToToggle )
599+ disableMods (dependentsToToggle , false )
599600 container :close ()
600601
601602 dependentsToToggle [mod .info .Name ] = mod
688689-- disables all mods then enables mods from preset
689690local function applyPreset (name , disableAll )
690691 if disableAll then
691- disableMods (scene .modsByPath )
692+ -- still don't disable favorites
693+ disableMods (scene .modsByPath , false )
692694 end
693695 name = name :gsub (" %p" , " %%%1" ) -- escape special characters
694696 local root = config .installs [config .install ].path
@@ -1031,7 +1033,8 @@ function scene.reload()
10311033 writeBlacklist ()
10321034 end ):with ({ enabled = false }):as (" enableAllButton" ),
10331035 uie .button (" Disable All" , function ()
1034- disableMods (scene .modsByPath )
1036+ -- don't disable favorites
1037+ disableMods (scene .modsByPath , false )
10351038 writeBlacklist ()
10361039 end ):with ({ enabled = false }):as (" disableAllButton" ),
10371040 }):with (uiu .rightbound )
0 commit comments