Merge pull request #405 from argonui/suzi-helper

Suzi Helper: moved script and added handling for empty bags
This commit is contained in:
Entrox-Licher 2023-10-14 00:01:03 -04:00 committed by GitHub
commit 6b7a3821fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View File

@ -49,8 +49,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "require(\"accessories/Subject5U-21Helper\")",
"LuaScriptState": "",
"LuaScript_path": "Fan-MadeAccessories.aa8b38/Subject5U-21Helper.1335e8.ttslua",
"MeasureMovement": false,
"Name": "Custom_Tile",
"Nickname": "Subject 5U-21 Helper",

View File

@ -34,8 +34,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "require(\"accessories/UnderworldMarketHelper\")",
"LuaScriptState": "",
"LuaScript_path": "Fan-MadeAccessories.aa8b38/UnderworldMarketHelper.3650ea.ttslua",
"MaterialIndex": -1,
"MeasureMovement": false,
"MeshIndex": -1,

View File

@ -91,7 +91,10 @@ function getNotesFromCardsAndContainers()
notes = JSON.decode(obj.getGMNotes()) or {}
table.insert(notesList, notes)
elseif obj.type == "Bag" or obj.type == "Deck" then
for _, deepObj in ipairs(obj.getData().ContainedObjects) do
-- check if there are actually objects contained and loop through them
local containedObjects = obj.getData().ContainedObjects
if containedObjects then
for _, deepObj in ipairs(containedObjects) do
if deepObj.Name == "Card" or deepObj.Name == "CardCustom" then
notes = JSON.decode(deepObj.GMNotes) or {}
table.insert(notesList, notes)
@ -99,5 +102,6 @@ function getNotesFromCardsAndContainers()
end
end
end
end
return notesList
end