repairing save function, XML animation added

This commit is contained in:
Chr1Z93 2022-12-12 09:38:29 +01:00
parent 1edf2c084e
commit a312ede891
2 changed files with 13 additions and 21 deletions

View File

@ -16,22 +16,10 @@
</TableLayout>
</Panel>
<Panel id="Options" offsetXY="0 535" active="false">
<Panel id="Options" offsetXY="0 535" active="false" showAnimation="Grow" hideAnimation="Shrink">
<VerticalLayout height="300" width="500" spacing="10" childAlignment="MiddleCenter">
<ToggleButton
class="optionButton"
id="optionAgenda"
onClick="optionClick(Agenda)"
>Doom on Agenda</ToggleButton>
<ToggleButton
class="optionButton"
id="optionPlayarea"
onClick="optionClick(Playarea)"
>Doom in Playarea</ToggleButton>
<ToggleButton
class="optionButton"
id="optionPlayermats"
onClick="optionClick(Playermats)"
>Doom on Playermats</ToggleButton>
<ToggleButton class="optionButton" id="optionAgenda" onClick="optionClick(Agenda)">Doom on Agenda</ToggleButton>
<ToggleButton class="optionButton" id="optionPlayarea" onClick="optionClick(Playarea)">Doom in Playarea</ToggleButton>
<ToggleButton class="optionButton" id="optionPlayermats" onClick="optionClick(Playermats)">Doom on Playermats</ToggleButton>
</VerticalLayout>
</Panel>

View File

@ -18,9 +18,7 @@ function onLoad(savedData)
-- restore state for option panel
for key, bool in pairs(options) do
if bool then
self.UI.setAttribute("option" .. key, "isOn", 0)
end
self.UI.setAttribute("option" .. key, "isOn", not bool)
end
end
@ -41,7 +39,9 @@ end
-- called by the invisible button to change displayed value
function addOrSubtract(_, _, isRightClick)
local newVal = math.min(math.max(val + (isRightClick and -1 or 1), 0), 99)
if val ~= newVal then updateVal(newVal) end
if val ~= newVal then
updateVal(newVal)
end
end
function updateVal(number)
@ -55,7 +55,11 @@ function startReset()
if options.Agenda then
updateVal(0)
end
getObjectFromGUID("652ff3").call("removeDoom", options)
-- call the "Doom-in-Play"-counter
local DoomInPlayCounter = getObjectFromGUID("652ff3")
if DoomInPlayCounter then
DoomInPlayCounter.call("removeDoom", options)
end
end
-- XML UI functions