resolving review comments
This commit is contained in:
parent
2474660947
commit
2932ac2c31
@ -50,7 +50,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": false,
|
"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",
|
"LuaScript_path": "Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "Custom_Token",
|
"Name": "Custom_Token",
|
||||||
|
@ -82,8 +82,7 @@ buttonParameters.function_owner = self
|
|||||||
|
|
||||||
function onSave()
|
function onSave()
|
||||||
return JSON.encode({
|
return JSON.encode({
|
||||||
options = options,
|
options = options
|
||||||
optionsVisible = optionsVisible
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -91,8 +90,10 @@ function onLoad(savedData)
|
|||||||
if savedData ~= nil then
|
if savedData ~= nil then
|
||||||
local loadedData = JSON.decode(savedData)
|
local loadedData = JSON.decode(savedData)
|
||||||
options = loadedData.options
|
options = loadedData.options
|
||||||
optionsVisible = loadedData.optionsVisible or false
|
-- update UI to match saved state
|
||||||
updateOptionState()
|
for id, state in pairs(options) do
|
||||||
|
self.UI.setAttribute(id, "image", state and "option_on" or "option_off")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- index 0: button as label
|
-- index 0: button as label
|
||||||
@ -155,16 +156,6 @@ function showOrHideOptions()
|
|||||||
end
|
end
|
||||||
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
|
-- main function
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
@ -207,7 +198,7 @@ function updateCounters(tableOfGUIDs, tableOfNewValues, info)
|
|||||||
if TOKEN ~= nil then
|
if TOKEN ~= nil then
|
||||||
TOKEN.call("updateVal", tableOfNewValues[i])
|
TOKEN.call("updateVal", tableOfNewValues[i])
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
@ -220,7 +211,7 @@ function resetSkillTrackers()
|
|||||||
if obj ~= nil then
|
if obj ~= nil then
|
||||||
obj.call("updateStats", { 1, 1, 1, 1 })
|
obj.call("updateStats", { 1, 1, 1, 1 })
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
@ -232,7 +223,7 @@ function resetDoomCounter()
|
|||||||
if doomcounter ~= nil then
|
if doomcounter ~= nil then
|
||||||
doomcounter.call("updateVal")
|
doomcounter.call("updateVal")
|
||||||
else
|
else
|
||||||
printToAll("Doom counter could not be found and was skipped.", "Yellow")
|
printToAll("Doom counter could not be found.", "Yellow")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -292,6 +283,7 @@ end
|
|||||||
|
|
||||||
-- discard all hand objects
|
-- discard all hand objects
|
||||||
function discardHands()
|
function discardHands()
|
||||||
|
if not options["tidyPlayermats"] then return end
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
local trashcan = getObjectFromGUID(TRASHCAN_GUIDS[i])
|
local trashcan = getObjectFromGUID(TRASHCAN_GUIDS[i])
|
||||||
if trashcan == nil then return end
|
if trashcan == nil then return end
|
||||||
|
Loading…
Reference in New Issue
Block a user