Skip to content

Commit

Permalink
Merge pull request #99 from Sp00ph/main
Browse files Browse the repository at this point in the history
Allow additively loading mod presets.
  • Loading branch information
maddie480 authored Sep 17, 2024
2 parents dca38f9 + 4196c32 commit 09a671a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/scenes/modlist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@ local function disableAllMods()
end

-- disables all mods then enables mods from preset
local function applyPreset(name)
disableAllMods()
local function applyPreset(name, disableAll)
if disableAll then
disableAllMods()
end
name = name:gsub("%p", "%%%1") -- escape special characters
local root = config.installs[config.install].path
local contents = fs.read(fs.joinpath(root, "Mods", "modpresets.txt"))
Expand Down Expand Up @@ -553,8 +555,11 @@ local function updatePresetsUI()
local presetRow = uie.paneled.row({
uie.label(presets[i]):with(verticalCenter),
uie.row({
uie.button("Load", function(self)
applyPreset(presets[i])
uie.button("Load mods", function(self)
applyPreset(presets[i], false)
end),
uie.button("Override current mods", function(self)
applyPreset(presets[i], true)
end),
uie.button("Delete", function(self)
alert({
Expand Down

0 comments on commit 09a671a

Please sign in to comment.