Updated load function for CardsWithHelper

This commit is contained in:
Chr1Z93 2024-08-15 16:44:04 +02:00
parent 30c2a596be
commit 433b4688c4

View File

@ -18,6 +18,16 @@ local GlobalApi = require("core/GlobalApi")
-- if the respective option is enabled in onLoad(), enable the helper -- if the respective option is enabled in onLoad(), enable the helper
function syncDisplayWithOptionPanel() function syncDisplayWithOptionPanel()
self.addTag("CardWithHelper") self.addTag("CardWithHelper")
-- check if this card is in a hand zone (because we're loading a saved game)
for _, zone in ipairs(self.getZones()) do
if zone.type == "Hand" then
setHelperState(false)
return
end
end
-- get state of the option panel
local options = GlobalApi.getOptionPanelState() local options = GlobalApi.getOptionPanelState()
if options.enableCardHelpers then if options.enableCardHelpers then
setHelperState(true) setHelperState(true)