Merge pull request #376 from bankey1443/underworldMarketHelperFix

Fix: Underworld Market Helper breaks after saving & loading
This commit is contained in:
Chr1Z 2023-09-09 22:42:53 +02:00 committed by GitHub
commit d2c4cf3514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,4 @@
function onload(saved_data) function onload(saved_data)
if saved_data != '' then
local loaded_data = JSON.decode(saved_data)
end
revealCardPositions = { revealCardPositions = {
Vector(3.5, 0.25, 0), Vector(3.5, 0.25, 0),
Vector(-3.5, 0.25, 0) Vector(-3.5, 0.25, 0)
@ -31,6 +27,20 @@ function onload(saved_data)
movingCards = false movingCards = false
self.addContextMenuItem('Reset helper', resetHelper) self.addContextMenuItem('Reset helper', resetHelper)
if saved_data != '' then
local loaded_data = JSON.decode(saved_data)
hiddenCards = loaded_data.saved_hiddenCards
isSetup = true
refreshButtons()
end
end
function onSave()
return JSON.encode({
saved_hiddenCards = hiddenCards
})
end end
function onObjectEnterContainer(container, object) function onObjectEnterContainer(container, object)