diff --git a/src/playercards/cards/NkosiMabati3.ttslua b/src/playercards/cards/NkosiMabati3.ttslua index 91208972..e5cf8643 100644 --- a/src/playercards/cards/NkosiMabati3.ttslua +++ b/src/playercards/cards/NkosiMabati3.ttslua @@ -27,15 +27,17 @@ function updateSave() end function onLoad(savedData) - syncDisplayWithOptionPanel() if savedData and savedData ~= "" then local loadedData = JSON.decode(savedData) isHelperEnabled = loadedData.isHelperEnabled sigil = loadedData.sigil - makeXMLButton() + if sigil and sigil ~= nil then + makeXMLButton() + end self.clearContextMenu() self.addContextMenuItem("Clear Helper", toggleHelper) end + syncDisplayWithOptionPanel() end function makeXMLButton() @@ -67,30 +69,35 @@ function makeXMLButton() } } ) + updateSave() end -- Create XML button to prompt choosing a sigil; acts as this card's helper function initialize() - self.UI.setXmlTable({ - { - tag = "Button", - attributes = { - height = 450, - width = 1400, - rotation = "0 0 180", - scale = "0.1 0.1 1", - position = "0 -55 -22", - padding = "50 50 50 50", - font = "font_teutonic-arkham", - fontSize = 300, - onClick = "chooseSigil", - color = "#77674DE6", - textColor = "White" - }, - value = "Choose Sigil" + if sigil and sigil ~= nil then + makeXMLButton() + else + self.UI.setXmlTable({ + { + tag = "Button", + attributes = { + height = 450, + width = 1400, + rotation = "0 0 180", + scale = "0.1 0.1 1", + position = "0 -55 -22", + padding = "50 50 50 50", + font = "font_teutonic-arkham", + fontSize = 300, + onClick = "chooseSigil", + color = "#77674DE6", + textColor = "White" + }, + value = "Choose Sigil" + } } - } - ) + ) + end end -- Create dialog window to choose sigil and create sigil-drawing button @@ -112,11 +119,13 @@ function chooseSigil(player) makeXMLButton() end ) + updateSave() end function shutOff() self.UI.setXml("") sigil = nil + updateSave() end function resolveSigil()