Merge pull request #821 from argonui/helper-loading

Updated load function for CardsWithHelper
This commit is contained in:
dscarpac 2024-08-15 10:22:26 -05:00 committed by GitHub
commit 1ef6c641a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,16 @@ local GlobalApi = require("core/GlobalApi")
-- if the respective option is enabled in onLoad(), enable the helper
function syncDisplayWithOptionPanel()
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()
if options.enableCardHelpers then
setHelperState(true)