diff --git a/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.json b/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.json index 79976965..b2caf18d 100644 --- a/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.json +++ b/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.json @@ -50,7 +50,7 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScriptState": "{\"options\":{\"importTrauma\":true,\"removeDrawnLines\":false,\"tidyPlayermats\":true},\"optionsVisible\":false}", + "LuaScriptState": "{\"options\":{\"importTrauma\":true,\"removeDrawnLines\":false,\"tidyPlayermats\":true}}", "LuaScript_path": "Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua", "MeasureMovement": false, "Name": "Custom_Token", diff --git a/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua b/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua index 337b6e9d..b82a6589 100644 --- a/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua +++ b/objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua @@ -82,8 +82,7 @@ buttonParameters.function_owner = self function onSave() return JSON.encode({ - options = options, - optionsVisible = optionsVisible + options = options }) end @@ -91,8 +90,10 @@ function onLoad(savedData) if savedData ~= nil then local loadedData = JSON.decode(savedData) options = loadedData.options - optionsVisible = loadedData.optionsVisible or false - updateOptionState() + -- update UI to match saved state + for id, state in pairs(options) do + self.UI.setAttribute(id, "image", state and "option_on" or "option_off") + end end -- index 0: button as label @@ -155,16 +156,6 @@ function showOrHideOptions() end end -function updateOptionState() - for id, state in pairs(options) do - self.UI.setAttribute(id, "image", state and "option_on" or "option_off") - end - - if optionsVisible then - self.UI.show("options") - end -end - --------------------------------------------------------- -- main function --------------------------------------------------------- @@ -207,7 +198,7 @@ function updateCounters(tableOfGUIDs, tableOfNewValues, info) if TOKEN ~= nil then TOKEN.call("updateVal", tableOfNewValues[i]) else - printToAll(info .. ": Token number " .. i .. " could not be found and was skipped.", "Yellow") + printToAll(info .. ": No. " .. i .. " could not be found.", "Yellow") end end end @@ -220,7 +211,7 @@ function resetSkillTrackers() if obj ~= nil then obj.call("updateStats", { 1, 1, 1, 1 }) else - printToAll("Skill tracker number " .. i .. " could not be found and was skipped.", "Yellow") + printToAll("Skill tracker number " .. i .. " could not be found.", "Yellow") end end end @@ -232,7 +223,7 @@ function resetDoomCounter() if doomcounter ~= nil then doomcounter.call("updateVal") else - printToAll("Doom counter could not be found and was skipped.", "Yellow") + printToAll("Doom counter could not be found.", "Yellow") end end @@ -292,6 +283,7 @@ end -- discard all hand objects function discardHands() + if not options["tidyPlayermats"] then return end for i = 1, 4 do local trashcan = getObjectFromGUID(TRASHCAN_GUIDS[i]) if trashcan == nil then return end