update scriptstate

This commit is contained in:
Chr1Z93 2024-04-27 20:04:42 +02:00
parent 11d4820093
commit d5ef1d93cc
6 changed files with 9 additions and 18 deletions

View File

@ -1 +1 @@
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"White"}
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"White","slotData":["any","any","any","Tarot","Hand (left)","Hand (right)","Ally","any","any","any","Accessory","Arcane","Arcane","Body"]}

View File

@ -1 +1 @@
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"Orange"}
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"Orange","slotData":["any","any","any","Tarot","Hand (left)","Hand (right)","Ally","any","any","any","Accessory","Arcane","Arcane","Body"]}

View File

@ -1 +1 @@
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"Green"}
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"Green","slotData":["any","any","any","Tarot","Hand (left)","Hand (right)","Ally","any","any","any","Accessory","Arcane","Arcane","Body"]}

View File

@ -344,7 +344,7 @@
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/Playmat\")",
"LuaScriptState": "{\"activeInvestigatorId\":\"00000\",\"isDrawButtonVisible\":false,\"playerColor\":\"Red\"}",
"LuaScriptState_path": "Playermat4Red.0840d5.luascriptstate",
"MeasureMovement": false,
"Memo": "Red",
"Name": "Custom_Tile",

View File

@ -0,0 +1 @@
{"activeInvestigatorId":"00000","isDrawButtonVisible":false,"playerColor":"Red","slotData":["any","any","any","Tarot","Hand (left)","Hand (right)","Ally","any","any","any","Accessory","Arcane","Arcane","Body"]}

View File

@ -88,21 +88,11 @@ end
function onLoad(savedData)
if savedData and savedData ~= "" then
local loadedData = JSON.decode(savedData)
playerColor = loadedData.playerColor
local loadedData = JSON.decode(savedData)
playerColor = loadedData.playerColor
activeInvestigatorId = loadedData.activeInvestigatorId
isDrawButtonVisible = loadedData.isDrawButtonVisible
-- To-Do: remove this once the save state is properly populated
if loadedData.slotData then
slotData = loadedData.slotData
else
-- make a deep copy of the default table
slotData = {}
for _, slotName in ipairs(defaultSlotData) do
table.insert(slotData, slotName)
end
end
isDrawButtonVisible = loadedData.isDrawButtonVisible
slotData = loadedData.slotData
end
self.interactable = false