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> </TableLayout>
</Panel> </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"> <VerticalLayout height="300" width="500" spacing="10" childAlignment="MiddleCenter">
<ToggleButton <ToggleButton class="optionButton" id="optionAgenda" onClick="optionClick(Agenda)">Doom on Agenda</ToggleButton>
class="optionButton" <ToggleButton class="optionButton" id="optionPlayarea" onClick="optionClick(Playarea)">Doom in Playarea</ToggleButton>
id="optionAgenda" <ToggleButton class="optionButton" id="optionPlayermats" onClick="optionClick(Playermats)">Doom on Playermats</ToggleButton>
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> </VerticalLayout>
</Panel> </Panel>

View File

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