more changes

This commit is contained in:
dscarpac 2024-07-31 15:36:43 -05:00
parent c35d0cd7c0
commit f957ea2511

View File

@ -27,15 +27,17 @@ function updateSave()
end end
function onLoad(savedData) function onLoad(savedData)
syncDisplayWithOptionPanel()
if savedData and savedData ~= "" then if savedData and savedData ~= "" then
local loadedData = JSON.decode(savedData) local loadedData = JSON.decode(savedData)
isHelperEnabled = loadedData.isHelperEnabled isHelperEnabled = loadedData.isHelperEnabled
sigil = loadedData.sigil sigil = loadedData.sigil
if sigil and sigil ~= nil then
makeXMLButton() makeXMLButton()
end
self.clearContextMenu() self.clearContextMenu()
self.addContextMenuItem("Clear Helper", toggleHelper) self.addContextMenuItem("Clear Helper", toggleHelper)
end end
syncDisplayWithOptionPanel()
end end
function makeXMLButton() function makeXMLButton()
@ -67,10 +69,14 @@ function makeXMLButton()
} }
} }
) )
updateSave()
end end
-- Create XML button to prompt choosing a sigil; acts as this card's helper -- Create XML button to prompt choosing a sigil; acts as this card's helper
function initialize() function initialize()
if sigil and sigil ~= nil then
makeXMLButton()
else
self.UI.setXmlTable({ self.UI.setXmlTable({
{ {
tag = "Button", tag = "Button",
@ -92,6 +98,7 @@ function initialize()
} }
) )
end end
end
-- Create dialog window to choose sigil and create sigil-drawing button -- Create dialog window to choose sigil and create sigil-drawing button
function chooseSigil(player) function chooseSigil(player)
@ -112,11 +119,13 @@ function chooseSigil(player)
makeXMLButton() makeXMLButton()
end end
) )
updateSave()
end end
function shutOff() function shutOff()
self.UI.setXml("") self.UI.setXml("")
sigil = nil sigil = nil
updateSave()
end end
function resolveSigil() function resolveSigil()