diff --git a/config.json b/config.json index f50cdecb..f688047f 100644 --- a/config.json +++ b/config.json @@ -19,6 +19,7 @@ "MusicPlayer_path": "MusicPlayer.json", "Note": "", "ObjectStates_order": [ + "GUIDReferenceHandler.da23e4", "HandTrigger.5fe087", "HandTrigger.be2f17", "HandTrigger.0285cc", diff --git a/objects/AllPlayerCards.15bb07.json b/objects/AllPlayerCards.15bb07.json index af75a7b5..f0715db7 100644 --- a/objects/AllPlayerCards.15bb07.json +++ b/objects/AllPlayerCards.15bb07.json @@ -1575,7 +1575,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"AllCardsBag\"}", "MeshIndex": -1, "Name": "Bag", "Nickname": "All Player Cards", diff --git a/objects/ArkhamDBDeckImporter.a28140.json b/objects/ArkhamDBDeckImporter.a28140.json index 8a42ae1a..418d63a3 100644 --- a/objects/ArkhamDBDeckImporter.a28140.json +++ b/objects/ArkhamDBDeckImporter.a28140.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"arkhamdb/DeckImporterMain\")", "LuaScriptState_path": "ArkhamDBDeckImporter.a28140.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"DeckImporter\"}", "Name": "Custom_Tile", "Nickname": "ArkhamDB Deck Importer", "Snap": false, diff --git a/objects/BlessCurseManager.5933fb.json b/objects/BlessCurseManager.5933fb.json index c7325804..ae7809ce 100644 --- a/objects/BlessCurseManager.5933fb.json +++ b/objects/BlessCurseManager.5933fb.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"chaosbag/BlessCurseManager\")", "LuaScriptState": "false", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"BlessCurseManager\"}", "Name": "Custom_Token", "Nickname": "Bless/Curse Manager", "Snap": true, diff --git a/objects/ClueCounter.032300.json b/objects/ClueCounter.032300.json index b3453154..71211083 100644 --- a/objects/ClueCounter.032300.json +++ b/objects/ClueCounter.032300.json @@ -45,7 +45,6 @@ "LuaScript": "require(\"playermat/ClueCounter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"ClueCounter\"}", "Name": "Custom_Model", "Nickname": "Clue Counter", "Snap": true, diff --git a/objects/ClueCounter.1769ed.json b/objects/ClueCounter.1769ed.json index ef8f9040..914b6298 100644 --- a/objects/ClueCounter.1769ed.json +++ b/objects/ClueCounter.1769ed.json @@ -45,7 +45,6 @@ "LuaScript": "require(\"playermat/ClueCounter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"ClueCounter\"}", "Name": "Custom_Model", "Nickname": "Clue Counter", "Snap": true, diff --git a/objects/ClueCounter.37be78.json b/objects/ClueCounter.37be78.json index d43058e5..5b7fcb52 100644 --- a/objects/ClueCounter.37be78.json +++ b/objects/ClueCounter.37be78.json @@ -45,7 +45,6 @@ "LuaScript": "require(\"playermat/ClueCounter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"ClueCounter\"}", "Name": "Custom_Model", "Nickname": "Clue Counter", "Snap": true, diff --git a/objects/ClueCounter.d86b7c.json b/objects/ClueCounter.d86b7c.json index ce05c108..8beb0fc8 100644 --- a/objects/ClueCounter.d86b7c.json +++ b/objects/ClueCounter.d86b7c.json @@ -45,7 +45,6 @@ "LuaScript": "require(\"playermat/ClueCounter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"ClueCounter\"}", "Name": "Custom_Model", "Nickname": "Clue Counter", "Snap": true, diff --git a/objects/Clues.3f22e5.json b/objects/Clues.3f22e5.json index 18ea7e44..17a50489 100644 --- a/objects/Clues.3f22e5.json +++ b/objects/Clues.3f22e5.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"ClickableClueCounter\"}", "Name": "Custom_Token", "Nickname": "Clues", "Snap": true, diff --git a/objects/Clues.4111de.json b/objects/Clues.4111de.json index 01eac58b..97c69558 100644 --- a/objects/Clues.4111de.json +++ b/objects/Clues.4111de.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"ClickableClueCounter\"}", "Name": "Custom_Token", "Nickname": "Clues", "Snap": true, diff --git a/objects/Clues.891403.json b/objects/Clues.891403.json index 64b11f2e..32174201 100644 --- a/objects/Clues.891403.json +++ b/objects/Clues.891403.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"ClickableClueCounter\"}", "Name": "Custom_Token", "Nickname": "Clues", "Snap": true, diff --git a/objects/Clues.db85d6.json b/objects/Clues.db85d6.json index 2a9177df..902a38f5 100644 --- a/objects/Clues.db85d6.json +++ b/objects/Clues.db85d6.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"ClickableClueCounter\"}", "Name": "Custom_Token", "Nickname": "Clues", "Snap": true, diff --git a/objects/Damage.1f5a0a.json b/objects/Damage.1f5a0a.json index 3e21c9ac..38534af1 100644 --- a/objects/Damage.1f5a0a.json +++ b/objects/Damage.1f5a0a.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"DamageCounter\"}", "Name": "Custom_Token", "Nickname": "Damage\n", "Snap": true, diff --git a/objects/Damage.591a45.json b/objects/Damage.591a45.json index b8f9f6b4..b1c402b9 100644 --- a/objects/Damage.591a45.json +++ b/objects/Damage.591a45.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"DamageCounter\"}", "Name": "Custom_Token", "Nickname": "Damage\n", "Snap": true, diff --git a/objects/Damage.e64eec.json b/objects/Damage.e64eec.json index e82254b7..99f89b60 100644 --- a/objects/Damage.e64eec.json +++ b/objects/Damage.e64eec.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"DamageCounter\"}", "Name": "Custom_Token", "Nickname": "Damage\n", "Snap": true, diff --git a/objects/Damage.eb08d6.json b/objects/Damage.eb08d6.json index f4a3ea15..39eab22d 100644 --- a/objects/Damage.eb08d6.json +++ b/objects/Damage.eb08d6.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"DamageCounter\"}", "Name": "Custom_Token", "Nickname": "Damage\n", "Snap": true, diff --git a/objects/DataHelper.708279.json b/objects/DataHelper.708279.json index 78a32f2e..1e3696b0 100644 --- a/objects/DataHelper.708279.json +++ b/objects/DataHelper.708279.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/DataHelper\")", "LuaScriptState": "[]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"DataHelper\"}", "Name": "Custom_Tile", "Nickname": "Data Helper", "Snap": true, diff --git a/objects/DoomCounter.85c4c6.json b/objects/DoomCounter.85c4c6.json index c5d41256..6f061c53 100644 --- a/objects/DoomCounter.85c4c6.json +++ b/objects/DoomCounter.85c4c6.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/DoomCounter\")", "LuaScriptState": "[0,{\"Agenda\":true,\"Playarea\":true,\"Playermats\":true}]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"DoomCounter\"}", "Name": "Custom_Token", "Nickname": "Doom Counter", "Snap": true, diff --git a/objects/GUIDReferenceHandler.da23e4.json b/objects/GUIDReferenceHandler.da23e4.json new file mode 100644 index 00000000..4f868304 --- /dev/null +++ b/objects/GUIDReferenceHandler.da23e4.json @@ -0,0 +1,48 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0.116, + "g": 0.116, + "r": 0.716 + }, + "Description": "This object handles GUID references to objects.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "da23e4", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "require(\"core/GUIDReferenceHandler\")", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "go_game_piece_white", + "Nickname": "GUID Reference Handler", + "Snap": true, + "Sticky": true, + "Tags": [ + "GUIDs" + ], + "Tooltip": true, + "Transform": { + "posX": 78, + "posY": 1.328, + "posZ": -8, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} \ No newline at end of file diff --git a/objects/HandTrigger.0285cc.json b/objects/HandTrigger.0285cc.json index 735a2aa8..d8eff7f5 100644 --- a/objects/HandTrigger.0285cc.json +++ b/objects/HandTrigger.0285cc.json @@ -26,7 +26,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"HandZone\"}", "Name": "HandTrigger", "Nickname": "", "Snap": true, diff --git a/objects/HandTrigger.5fe087.json b/objects/HandTrigger.5fe087.json index b4867966..0ea988e6 100644 --- a/objects/HandTrigger.5fe087.json +++ b/objects/HandTrigger.5fe087.json @@ -26,7 +26,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"HandZone\"}", "Name": "HandTrigger", "Nickname": "", "Snap": true, diff --git a/objects/HandTrigger.a70eee.json b/objects/HandTrigger.a70eee.json index d4713ce7..9fcb112a 100644 --- a/objects/HandTrigger.a70eee.json +++ b/objects/HandTrigger.a70eee.json @@ -26,7 +26,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"HandZone\"}", "Name": "HandTrigger", "Nickname": "", "Snap": true, diff --git a/objects/HandTrigger.be2f17.json b/objects/HandTrigger.be2f17.json index 19dbb68d..ac40365c 100644 --- a/objects/HandTrigger.be2f17.json +++ b/objects/HandTrigger.be2f17.json @@ -26,7 +26,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"HandZone\"}", "Name": "HandTrigger", "Nickname": "", "Snap": true, diff --git a/objects/Horror.0257d9.json b/objects/Horror.0257d9.json index 5be90941..f933c101 100644 --- a/objects/Horror.0257d9.json +++ b/objects/Horror.0257d9.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"HorrorCounter\"}", "Name": "Custom_Token", "Nickname": "Horror", "Snap": true, diff --git a/objects/Horror.468e88.json b/objects/Horror.468e88.json index 620826ca..b6a6cb0b 100644 --- a/objects/Horror.468e88.json +++ b/objects/Horror.468e88.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"HorrorCounter\"}", "Name": "Custom_Token", "Nickname": "Horror", "Snap": true, diff --git a/objects/Horror.7b5729.json b/objects/Horror.7b5729.json index c8214fa4..973828d6 100644 --- a/objects/Horror.7b5729.json +++ b/objects/Horror.7b5729.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"HorrorCounter\"}", "Name": "Custom_Token", "Nickname": "Horror", "Snap": true, diff --git a/objects/Horror.beb964.json b/objects/Horror.beb964.json index 77c029f6..9564ddac 100644 --- a/objects/Horror.beb964.json +++ b/objects/Horror.beb964.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "0", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"HorrorCounter\"}", "Name": "Custom_Token", "Nickname": "Horror", "Snap": true, diff --git a/objects/InvestigatorCount.f182ee.json b/objects/InvestigatorCount.f182ee.json index 8566a1aa..3229f06b 100644 --- a/objects/InvestigatorCount.f182ee.json +++ b/objects/InvestigatorCount.f182ee.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/ActiveInvestigatorCounter\")", "LuaScriptState": "2", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"InvestigatorCounter\"}", "Name": "Custom_Token", "Nickname": "Investigator Count", "Snap": true, diff --git a/objects/InvestigatorSkillTracker.af7ed7.json b/objects/InvestigatorSkillTracker.af7ed7.json index ed05ca40..8e320a3d 100644 --- a/objects/InvestigatorSkillTracker.af7ed7.json +++ b/objects/InvestigatorSkillTracker.af7ed7.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"playermat/InvestigatorSkillTracker\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"InvestigatorSkillTracker\"}", "Name": "Custom_Token", "Nickname": "Investigator Skill Tracker", "Snap": true, diff --git a/objects/InvestigatorSkillTracker.b4a5f7.json b/objects/InvestigatorSkillTracker.b4a5f7.json index dd711c4f..cbf2123d 100644 --- a/objects/InvestigatorSkillTracker.b4a5f7.json +++ b/objects/InvestigatorSkillTracker.b4a5f7.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"playermat/InvestigatorSkillTracker\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"InvestigatorSkillTracker\"}", "Name": "Custom_Token", "Nickname": "Investigator Skill Tracker", "Snap": true, diff --git a/objects/InvestigatorSkillTracker.e598c2.json b/objects/InvestigatorSkillTracker.e598c2.json index 91a44681..c82d17bf 100644 --- a/objects/InvestigatorSkillTracker.e598c2.json +++ b/objects/InvestigatorSkillTracker.e598c2.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"playermat/InvestigatorSkillTracker\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"InvestigatorSkillTracker\"}", "Name": "Custom_Token", "Nickname": "Investigator Skill Tracker", "Snap": true, diff --git a/objects/InvestigatorSkillTracker.e74881.json b/objects/InvestigatorSkillTracker.e74881.json index 5d5a57b5..aad443c7 100644 --- a/objects/InvestigatorSkillTracker.e74881.json +++ b/objects/InvestigatorSkillTracker.e74881.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"playermat/InvestigatorSkillTracker\")", "LuaScriptState": "[1,1,1,1]", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"InvestigatorSkillTracker\"}", "Name": "Custom_Token", "Nickname": "Investigator Skill Tracker", "Snap": true, diff --git a/objects/MasterClueCounter.4a3aa4.json b/objects/MasterClueCounter.4a3aa4.json index f5612158..69d25c0f 100644 --- a/objects/MasterClueCounter.4a3aa4.json +++ b/objects/MasterClueCounter.4a3aa4.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/MasterClueCounter\")", "LuaScriptState": "false", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"MasterClueCounter\"}", "Name": "Custom_Token", "Nickname": "Master Clue Counter", "Snap": true, diff --git a/objects/MythosArea.9f334f.json b/objects/MythosArea.9f334f.json index 24b7fa4b..1eeead24 100644 --- a/objects/MythosArea.9f334f.json +++ b/objects/MythosArea.9f334f.json @@ -62,7 +62,6 @@ "LuaScript": "require(\"core/MythosArea\")", "LuaScriptState": "{\"currentScenario\":\"\",\"tokenData\":[],\"useFrontData\":true}", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"MythosArea\"}", "Name": "Custom_Tile", "Nickname": "Mythos Area", "Snap": true, diff --git a/objects/NavigationOverlayHandler.797ede.json b/objects/NavigationOverlayHandler.797ede.json index 16a9c51f..7b15773a 100644 --- a/objects/NavigationOverlayHandler.797ede.json +++ b/objects/NavigationOverlayHandler.797ede.json @@ -24,7 +24,6 @@ "LuaScript": "require(\"core/NavigationOverlayHandler\")", "LuaScriptState_path": "NavigationOverlayHandler.797ede.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"NavigationOverlayHandler\"}", "Name": "go_game_piece_black", "Nickname": "Navigation Overlay Handler", "Snap": true, diff --git a/objects/OptionPanelSource.830bd0.json b/objects/OptionPanelSource.830bd0.json index 9b7d96ce..98907beb 100644 --- a/objects/OptionPanelSource.830bd0.json +++ b/objects/OptionPanelSource.830bd0.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"OptionPanelSource\"}", "MeshIndex": -1, "Name": "Bag", "Nickname": "OptionPanel Source", diff --git a/objects/OtherDoominPlay.652ff3.json b/objects/OtherDoominPlay.652ff3.json index 3bde1d78..6150163c 100644 --- a/objects/OtherDoominPlay.652ff3.json +++ b/objects/OtherDoominPlay.652ff3.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/DoomInPlayCounter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"DoomInPlayCounter\"}", "Name": "Custom_Token", "Nickname": "Other Doom in Play", "Snap": true, diff --git a/objects/Playarea.721ba2.json b/objects/Playarea.721ba2.json index 8057603a..b820bf54 100644 --- a/objects/Playarea.721ba2.json +++ b/objects/Playarea.721ba2.json @@ -973,7 +973,6 @@ "LuaScript": "require(\"core/PlayArea\")", "LuaScriptState": "{\"trackedLocations\":[]}", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"PlayArea\"}", "Name": "Custom_Token", "Nickname": "Play Area", "Snap": true, diff --git a/objects/PlayerCards.2d30ee.json b/objects/PlayerCards.2d30ee.json index f05bd54c..94839147 100644 --- a/objects/PlayerCards.2d30ee.json +++ b/objects/PlayerCards.2d30ee.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"playercards/PlayerCardPanel\")", "LuaScriptState": "{\"spawnBagState\":{\"placed\":[],\"placedObjects\":[]}}", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"PlayerCardPanel\"}", "Name": "Custom_Tile", "Nickname": "Player Cards", "Snap": true, diff --git a/objects/Playermat1White.8b081b.json b/objects/Playermat1White.8b081b.json index ce714318..afb6d149 100644 --- a/objects/Playermat1White.8b081b.json +++ b/objects/Playermat1White.8b081b.json @@ -346,7 +346,7 @@ "LuaScript": "require(\"playermat/Playmat\")", "LuaScriptState_path": "Playermat1White.8b081b.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"Playermat\"}", + "Memo": "White", "Name": "Custom_Tile", "Nickname": "Playermat 1: White", "Snap": true, diff --git a/objects/Playermat2Orange.bd0ff4.json b/objects/Playermat2Orange.bd0ff4.json index d0bc1be6..a0c7a9a1 100644 --- a/objects/Playermat2Orange.bd0ff4.json +++ b/objects/Playermat2Orange.bd0ff4.json @@ -346,7 +346,7 @@ "LuaScript": "require(\"playermat/Playmat\")", "LuaScriptState_path": "Playermat2Orange.bd0ff4.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"Playermat\"}", + "Memo": "Orange", "Name": "Custom_Tile", "Nickname": "Playermat 2: Orange", "Snap": true, diff --git a/objects/Playermat3Green.383d8b.json b/objects/Playermat3Green.383d8b.json index 4f9a6292..1f22c5f7 100644 --- a/objects/Playermat3Green.383d8b.json +++ b/objects/Playermat3Green.383d8b.json @@ -346,7 +346,7 @@ "LuaScript": "require(\"playermat/Playmat\")", "LuaScriptState_path": "Playermat3Green.383d8b.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"Playermat\"}", + "Memo": "Green", "Name": "Custom_Tile", "Nickname": "Playermat 3: Green", "Snap": true, diff --git a/objects/Playermat4Red.0840d5.json b/objects/Playermat4Red.0840d5.json index 862ad7d1..68a96ac7 100644 --- a/objects/Playermat4Red.0840d5.json +++ b/objects/Playermat4Red.0840d5.json @@ -346,7 +346,7 @@ "LuaScript": "require(\"playermat/Playmat\")", "LuaScriptState_path": "Playermat4Red.0840d5.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"Playermat\"}", + "Memo": "Red", "Name": "Custom_Tile", "Nickname": "Playermat 4: Red", "Snap": true, diff --git a/objects/Resources.4406f0.json b/objects/Resources.4406f0.json index 27ee263a..d0ad1b7c 100644 --- a/objects/Resources.4406f0.json +++ b/objects/Resources.4406f0.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "5", "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"ResourceCounter\"}", "Name": "Custom_Token", "Nickname": "Resources", "Snap": true, diff --git a/objects/Resources.816d84.json b/objects/Resources.816d84.json index 56ea1b61..de7dc10a 100644 --- a/objects/Resources.816d84.json +++ b/objects/Resources.816d84.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "5", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"ResourceCounter\"}", "Name": "Custom_Token", "Nickname": "Resources", "Snap": true, diff --git a/objects/Resources.a4b60d.json b/objects/Resources.a4b60d.json index 16f3cbfb..16acd881 100644 --- a/objects/Resources.a4b60d.json +++ b/objects/Resources.a4b60d.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "5", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"ResourceCounter\"}", "Name": "Custom_Token", "Nickname": "Resources", "Snap": true, diff --git a/objects/Resources.cd15ac.json b/objects/Resources.cd15ac.json index d98591a4..d87f1ff2 100644 --- a/objects/Resources.cd15ac.json +++ b/objects/Resources.cd15ac.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/GenericCounter\")", "LuaScriptState": "5", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"ResourceCounter\"}", "Name": "Custom_Token", "Nickname": "Resources", "Snap": true, diff --git a/objects/Resourcetokens.9fadf9.json b/objects/Resourcetokens.9fadf9.json index a39181d0..06da43f5 100644 --- a/objects/Resourcetokens.9fadf9.json +++ b/objects/Resourcetokens.9fadf9.json @@ -39,7 +39,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"ResourceTokenBag\"}", "MeshIndex": -1, "Name": "Custom_Model_Infinite_Bag", "Nickname": "Resource tokens", diff --git a/objects/RulesReference.d99993.json b/objects/RulesReference.d99993.json index b00713d6..4de14917 100644 --- a/objects/RulesReference.d99993.json +++ b/objects/RulesReference.d99993.json @@ -30,7 +30,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"RulesReference\"}", "Name": "Custom_PDF", "Nickname": "Rules Reference", "Snap": true, diff --git a/objects/SCEDTour.0e5aa8.json b/objects/SCEDTour.0e5aa8.json index c75ad261..8709156c 100644 --- a/objects/SCEDTour.0e5aa8.json +++ b/objects/SCEDTour.0e5aa8.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"core/tour/TourStarter\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"TourStarter\"}", "Name": "Custom_Token", "Nickname": "SCED Tour", "Snap": true, diff --git a/objects/ScriptingTrigger.a2f932.json b/objects/ScriptingTrigger.a2f932.json index bf81ab5a..faded6f2 100644 --- a/objects/ScriptingTrigger.a2f932.json +++ b/objects/ScriptingTrigger.a2f932.json @@ -25,7 +25,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"PlayAreaZone\"}", "Name": "ScriptingTrigger", "Nickname": "", "Snap": true, diff --git a/objects/SoundCube.3c988f.json b/objects/SoundCube.3c988f.json index fb205aeb..431b9499 100644 --- a/objects/SoundCube.3c988f.json +++ b/objects/SoundCube.3c988f.json @@ -31,7 +31,6 @@ "LuaScript": "", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"SoundCube\"}", "Name": "Custom_Assetbundle", "Nickname": "SoundCube", "Snap": true, diff --git a/objects/ThePathtoCarcosa.aca04c.json b/objects/ThePathtoCarcosa.aca04c.json index c7c855cd..dd39ca10 100644 --- a/objects/ThePathtoCarcosa.aca04c.json +++ b/objects/ThePathtoCarcosa.aca04c.json @@ -45,7 +45,6 @@ "LuaScript": "require(\"core/DownloadBox\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"CampaignThePathToCarcosa\"}", "Name": "Custom_Model", "Nickname": "The Path to Carcosa", "Snap": true, diff --git a/objects/TokenArranger.022907.json b/objects/TokenArranger.022907.json index 4fb6d2fc..19ab79ff 100644 --- a/objects/TokenArranger.022907.json +++ b/objects/TokenArranger.022907.json @@ -36,7 +36,6 @@ "LuaScript": "require(\"accessories/TokenArranger\")", "LuaScriptState_path": "TokenArranger.022907.luascriptstate", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"TokenArranger\"}", "Name": "Custom_Token", "Nickname": "Token Arranger", "Snap": true, diff --git a/objects/TokenSource.124381.json b/objects/TokenSource.124381.json index 138ba64d..7b6b34fb 100644 --- a/objects/TokenSource.124381.json +++ b/objects/TokenSource.124381.json @@ -37,7 +37,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"TokenSource\"}", "MeshIndex": -1, "Name": "Bag", "Nickname": "Token Source", diff --git a/objects/TokenSpawnTracker.e3ffc9.json b/objects/TokenSpawnTracker.e3ffc9.json index 8709a748..0c4e1527 100644 --- a/objects/TokenSpawnTracker.e3ffc9.json +++ b/objects/TokenSpawnTracker.e3ffc9.json @@ -24,7 +24,6 @@ "LuaScript": "require(\"core/token/TokenSpawnTracker\")", "LuaScriptState": "{\"cards\":[]}", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"TokenSpawnTracker\"}", "Name": "Checker_white", "Nickname": "Token Spawn Tracker", "Snap": true, diff --git a/objects/Trash.147e80.json b/objects/Trash.147e80.json index 7d71eb3a..493eeef7 100644 --- a/objects/Trash.147e80.json +++ b/objects/Trash.147e80.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"White\",\"type\":\"Trash\"}", "MeshIndex": -1, "Name": "Custom_Model_Bag", "Nickname": "Trash", diff --git a/objects/Trash.4b8594.json b/objects/Trash.4b8594.json index d227616b..b3d8e954 100644 --- a/objects/Trash.4b8594.json +++ b/objects/Trash.4b8594.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Red\",\"type\":\"Trash\"}", "MeshIndex": -1, "Name": "Custom_Model_Bag", "Nickname": "Trash", diff --git a/objects/Trash.5f896a.json b/objects/Trash.5f896a.json index 83f9df28..c0aed51b 100644 --- a/objects/Trash.5f896a.json +++ b/objects/Trash.5f896a.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Green\",\"type\":\"Trash\"}", "MeshIndex": -1, "Name": "Custom_Model_Bag", "Nickname": "Trash", diff --git a/objects/Trash.70b9f6.json b/objects/Trash.70b9f6.json index 0ca6bbea..9157562a 100644 --- a/objects/Trash.70b9f6.json +++ b/objects/Trash.70b9f6.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"Trash\"}", "MeshIndex": -1, "Name": "Custom_Model_Bag", "Nickname": "Trash", diff --git a/objects/Trash.f7b6c8.json b/objects/Trash.f7b6c8.json index 1923f48f..a5fc05c6 100644 --- a/objects/Trash.f7b6c8.json +++ b/objects/Trash.f7b6c8.json @@ -38,7 +38,6 @@ "LuaScriptState": "", "MaterialIndex": -1, "MeasureMovement": false, - "Memo": "{\"matColor\":\"Orange\",\"type\":\"Trash\"}", "MeshIndex": -1, "Name": "Custom_Model_Bag", "Nickname": "Trash", diff --git a/objects/VictoryDisplay.6ccd6d.json b/objects/VictoryDisplay.6ccd6d.json index 7834f0a9..622ccfd8 100644 --- a/objects/VictoryDisplay.6ccd6d.json +++ b/objects/VictoryDisplay.6ccd6d.json @@ -158,7 +158,6 @@ "LuaScript": "require(\"core/VictoryDisplay\")", "LuaScriptState": "", "MeasureMovement": false, - "Memo": "{\"matColor\":\"Mythos\",\"type\":\"VictoryDisplay\"}", "Name": "Custom_Token", "Nickname": "Victory Display", "Snap": false, diff --git a/src/accessories/CampaignImporterExporter.ttslua b/src/accessories/CampaignImporterExporter.ttslua index 65fbd108..7084f679 100644 --- a/src/accessories/CampaignImporterExporter.ttslua +++ b/src/accessories/CampaignImporterExporter.ttslua @@ -5,6 +5,8 @@ local optionPanelApi = require("core/OptionPanelApi") local playAreaApi = require("core/PlayAreaApi") local playmatApi = require("playermat/PlaymatApi") +local guidHandler = getObjectsWithTag("GUIDs")[1] + local campaignTokenData = { Name = "Custom_Model", Transform = { @@ -163,7 +165,8 @@ function createCampaignFromToken(importData) Wait.time(function() optionPanelApi.loadSettings(importData["options"]) end, 0.5) -- destroy Tour Starter token - getObjectsWithTag("TourStarter")[1].destruct() + local tourStarter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "TourStarter" }) + tourStarter.destruct() -- restore PlayArea image playAreaApi.updateSurface(importData["playmat"]) diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index c82339c5..ac4d4fc5 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -10,6 +10,8 @@ local playmatApi = require("playermat/PlaymatApi") local soundCubeApi = require("core/SoundCubeApi") local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") +local guidHandler = getObjectsWithTag("GUIDs")[1] + -- objects with this tag will be ignored local IGNORE_TAG = "CleanUpHelper_ignore" @@ -143,7 +145,7 @@ end -- reset doom on agenda function resetDoomCounter() - local doomCounter = getObjectsWithTag("DoomCounter")[1] + local doomCounter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DoomCounter" }) if doomCounter ~= nil then doomCounter.call("updateVal") else @@ -228,7 +230,7 @@ end function discardHands() if not options["tidyPlayermats"] then return end for i = 1, 4 do - local trash = getObjectsWithAllTags({COLORS[i], "Trash"}) + local trash = guidHandler.call("getObjectByOwnerAndType", { owner = COLORS[i], type = "Trash" }) if trash == nil then return end local hand = Player[playmatApi.getPlayerColor(COLORS[i])].getHandObjects() for j = #hand, 1, -1 do @@ -239,8 +241,8 @@ end -- clean up for play area function tidyPlayareaCoroutine() - local trash = getObjectsWithAllTags({"Mythos", "Trash"}) - local playAreaZone = getObjectsWithTag("PlayAreaZone")[1] + local trash = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "Trash" }) + local playAreaZone = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "PlayAreaZone" }) if playAreaZone == nil then printToAll("Scripting zone for main play area could not be found!", "Red") @@ -270,7 +272,7 @@ function tidyPlayerMatCoroutine() for k = 1, 30 do coroutine.yield(0) end -- get respective trash - local trash = getObjectsWithAllTags({COLORS[i], "Trash"}) + local trash = guidHandler.call("getObjectByOwnerAndType", { owner = COLORS[i], type = "Trash" }) if trash == nil then printToAll("Trashcan for " .. COLORS[i] .. " playmat could not be found!", "Red") return 1 @@ -300,7 +302,7 @@ function tidyPlayerMatCoroutine() -- reset "activeInvestigatorId" if i < 5 then - local playermat = getObjectsWithAllTags({COLORS[i], "Playermat"}) + local playermat = guidHandler.call("getObjectByOwnerAndType", { owner = COLORS[i], type = "Playermat" }) if playermat then playermat.setVar("activeInvestigatorId", "00000") end @@ -308,7 +310,7 @@ function tidyPlayerMatCoroutine() end end - local datahelper = getObjectsWithTag("DataHelper")[1] + local datahelper = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DataHelper" }) if datahelper then datahelper.setTable("SPAWNED_PLAYER_CARD_GUIDS", {}) end diff --git a/src/accessories/TokenArrangerApi.ttslua b/src/accessories/TokenArrangerApi.ttslua index 47afb77f..7f2dee07 100644 --- a/src/accessories/TokenArrangerApi.ttslua +++ b/src/accessories/TokenArrangerApi.ttslua @@ -1,11 +1,12 @@ do local TokenArrangerApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] -- local function to call the token arranger, if it is on the table ---@param functionName String Name of the function to cal ---@param argument Variant Parameter to pass local function callIfExistent(functionName, argument) - local tokenArranger = getObjectsWithTag("TokenArranger")[1] + local tokenArranger = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "TokenArranger" }) if tokenArranger ~= nil then tokenArranger.call(functionName, argument) end diff --git a/src/arkhamdb/DeckImporterApi.ttslua b/src/arkhamdb/DeckImporterApi.ttslua index 13e6202b..0ada1a1d 100644 --- a/src/arkhamdb/DeckImporterApi.ttslua +++ b/src/arkhamdb/DeckImporterApi.ttslua @@ -1,5 +1,6 @@ do local DeckImporterApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] -- Returns a table with the full state of the UI, including options and deck IDs. -- This can be used to persist via onSave(), or provide values for a load operation @@ -13,7 +14,7 @@ do -- investigators: True if investigator cards should be spawned DeckImporterApi.getUiState = function() local passthroughTable = {} - local DeckImporter = getObjectsWithTag("DeckImporter")[1] + local DeckImporter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DeckImporter" }) for k,v in pairs(DeckImporter.call("getUiState")) do passthroughTable[k] = v end @@ -31,7 +32,7 @@ do -- loadNewest: True if the most upgraded version of the deck should be loaded -- investigators: True if investigator cards should be spawned DeckImporterApi.setUiState = function(uiStateTable) - local DeckImporter = getObjectsWithTag("DeckImporter")[1] + local DeckImporter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DeckImporter" }) return DeckImporter.call("setUiState", uiStateTable) end diff --git a/src/chaosbag/BlessCurseManagerApi.ttslua b/src/chaosbag/BlessCurseManagerApi.ttslua index 0a97644d..f4861587 100644 --- a/src/chaosbag/BlessCurseManagerApi.ttslua +++ b/src/chaosbag/BlessCurseManagerApi.ttslua @@ -1,14 +1,14 @@ do local BlessCurseManagerApi = {} - local internal = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] - internal.getManager = function() - return getObjectsWithTag("BlessCurseManager")[1] + local function getManager() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "BlessCurseManager" }) end -- removes all taken tokens and resets the counts BlessCurseManagerApi.removeTakenTokensAndReset = function() - local BlessCurseManager = internal.getManager() + local BlessCurseManager = getManager() Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05) Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10) Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15) @@ -16,30 +16,30 @@ do -- updates the internal count (called by cards that seal bless/curse tokens) BlessCurseManagerApi.sealedToken = function(type, guid) - internal.getManager().call("sealedToken", { type = type, guid = guid }) + getManager().call("sealedToken", { type = type, guid = guid }) end -- updates the internal count (called by cards that seal bless/curse tokens) BlessCurseManagerApi.releasedToken = function(type, guid) - internal.getManager().call("releasedToken", { type = type, guid = guid }) + getManager().call("releasedToken", { type = type, guid = guid }) end -- broadcasts the current status for bless/curse tokens ---@param playerColor String Color of the player to show the broadcast to BlessCurseManagerApi.broadcastStatus = function(playerColor) - internal.getManager().call("broadcastStatus", playerColor) + getManager().call("broadcastStatus", playerColor) end -- removes all bless / curse tokens from the chaos bag and play ---@param playerColor String Color of the player to show the broadcast to BlessCurseManagerApi.removeAll = function(playerColor) - internal.getManager().call("doRemove", playerColor) + getManager().call("doRemove", playerColor) end -- adds Wendy's menu to the hovered card (allows sealing of tokens) ---@param color String Color of the player to show the broadcast to BlessCurseManagerApi.addWendysMenu = function(playerColor, hoveredObject) - internal.getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject }) + getManager().call("addMenuOptions", { playerColor = playerColor, hoveredObject = hoveredObject }) end return BlessCurseManagerApi diff --git a/src/core/DoomCounter.ttslua b/src/core/DoomCounter.ttslua index aa133b09..c70fcead 100644 --- a/src/core/DoomCounter.ttslua +++ b/src/core/DoomCounter.ttslua @@ -4,6 +4,7 @@ local options = { Playarea = true, Playermats = true } +local guidHandler = getObjectsWithTag("GUIDs")[1] val = 0 @@ -64,7 +65,7 @@ function startReset() if options.Agenda then updateVal(0) end - local DoomInPlayCounter = getObjectsWithTag("DoomInPlayCounter")[1] + local DoomInPlayCounter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DoomInPlayCounter" }) if DoomInPlayCounter then DoomInPlayCounter.call("removeDoom", options) end diff --git a/src/core/DoomInPlayCounter.ttslua b/src/core/DoomInPlayCounter.ttslua index 0d86b260..4688efd5 100644 --- a/src/core/DoomInPlayCounter.ttslua +++ b/src/core/DoomInPlayCounter.ttslua @@ -1,5 +1,7 @@ local playmatApi = require("playermat/PlaymatApi") +local guidHandler = getObjectsWithTag("GUIDs")[1] + local ZONE, TRASH, loopID local doomURL = "https://i.imgur.com/EoL7yaZ.png" local IGNORE_TAG = "DoomCounter_ignore" @@ -29,8 +31,8 @@ function onLoad() color = { 0, 0, 0, 0 } }) - TRASH = getObjectsWithAllTags({"Mythos", "Trash"}) - ZONE = getObjectsWithAllTags({"Mythos", "PlayAreaZone" }) + TRASH = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "Trash" }) + ZONE = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "PlayAreaZone" }) loopID = Wait.time(countDoom, 2, -1) end diff --git a/src/core/GUIDReferenceHandler.ttslua b/src/core/GUIDReferenceHandler.ttslua new file mode 100644 index 00000000..1a187064 --- /dev/null +++ b/src/core/GUIDReferenceHandler.ttslua @@ -0,0 +1,99 @@ +local GuidReferences = { + White = { + ClueCounter = "d86b7c", + ClickableClueCounter = "db85d6", + DamageCounter = "eb08d6", + HandZone = "a70eee", + HorrorCounter = "468e88", + InvestigatorSkillTracker = "e598c2", + Playermat = "8b081b", + ResourceCounter = "4406f0", + Trash = "147e80" + }, + Orange = { + ClueCounter = "1769ed", + ClickableClueCounter = "3f22e5", + DamageCounter = "e64eec", + HandZone = "5fe087", + HorrorCounter = "0257d9", + InvestigatorSkillTracker = "b4a5f7", + Playermat = "bd0ff4", + ResourceCounter = "816d84", + Trash = "f7b6c8" + }, + Green = { + ClueCounter = "032300", + ClickableClueCounter = "891403", + DamageCounter = "1f5a0a", + HandZone = "0285cc", + HorrorCounter = "7b5729", + InvestigatorSkillTracker = "af7ed7", + Playermat = "383d8b", + ResourceCounter = "cd15ac", + Trash = "5f896a" + }, + Red = { + ClueCounter = "37be78", + ClickableClueCounter = "4111de", + DamageCounter = "591a45", + HandZone = "be2f17", + HorrorCounter = "beb964", + InvestigatorSkillTracker = "e74881", + Playermat = "0840d5", + ResourceCounter = "a4b60d", + Trash = "4b8594" + }, + Mythos = { + AllCardsBag = "15bb07", + BlessCurseManager = "5933fb", + CampaignThePathToCarcosa = "aca04c", + DataHelper = "708279", + DeckImporter = "a28140", + DoomCounter = "85c4c6", + DoomInPlayCounter = "652ff3", + MasterClueCounter = "4a3aa4", + MythosArea = "9f334f", + NavigationOverlayHandler = "797ede", + OptionPanelSource = "830bd0", + PlayArea = "721ba2", + PlayAreaZone = "a2f932", + PlayerCardPanel = "2d30ee", + ResourceTokenBag = "9fadf9", + RulesReference = "d99993", + SoundCube = "3c988f", + TokenArranger = "022907", + TokenSource = "124381", + TokenSpawnTracker = "e3ffc9", + TourStarter = "0e5aa8", + Trash = "70b9f6", + VictoryDisplay = "6ccd6d" + } +} + +function getObjectByOwnerAndType(param) + local owner = param.owner + local type = param.type + return getObjectFromGUID(GuidReferences[owner][type]) +end + +function getObjectsByType(type) + local objList = {} + for owner, objects in pairs(GuidReferences) do + local obj = getObjectFromGUID(objects[type]) + if obj then + objList[owner] = obj + end + end + return objList +end + +function getObjectsByOwner(owner) + local objList = {} + for type, guid in pairs(GuidReferences[owner]) do + local obj = getObjectFromGUID(guid) + if obj then + objList[type] = obj + end + end + return objList +end diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 4d6043c4..aaee28aa 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -3,6 +3,8 @@ local optionPanelApi = require("core/OptionPanelApi") local playmatApi = require("playermat/PlaymatApi") local victoryDisplayApi = require("core/VictoryDisplayApi") +local guidHandler = getObjectsWithTag("GUIDs")[1] + function onLoad() addHotkey("Add Doom to Agenda", addDoomToAgenda) addHotkey("Bless/Curse Status", showBlessCurseStatus) @@ -41,7 +43,8 @@ end -- adds 1 doom to the agenda function addDoomToAgenda() - getObjectsWithTag("DoomCounter")[1].call("addVal", 1) + local doomCounter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DoomCounter" }) + doomCounter.call("addVal", 1) end -- moves the hovered card to the victory display diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 1863657c..4a78850a 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -8,6 +8,8 @@ local tokenArrangerApi = require("accessories/TokenArrangerApi") local tokenChecker = require("core/token/TokenChecker") local tokenManager = require("core/token/TokenManager") +local guidHandler = getObjectsWithTag("GUIDs")[1] + --------------------------------------------------------- -- general setup --------------------------------------------------------- @@ -127,7 +129,7 @@ function onLoad(savedData) if obj ~= nil then obj.interactable = false end end - DATA_HELPER = getObjectsWithTag("DataHelper")[1] + --DATA_HELPER = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DataHelper" }) resetChaosTokenStatTracker() getModVersion() math.randomseed(os.time()) @@ -957,7 +959,7 @@ end ---@param rotation Table Desired rotation of the object (defaults to object's rotation) ---@param color String Matcolor this object is spawned for to set memo function spawnHelperObject(name, position, rotation, color) - local sourceBag = getObjectsWithTag("OptionPanelSource")[1] + local sourceBag = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "OptionPanelSource" }) -- error handling for missing sourceBag if not sourceBag then diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 4b35372b..c0f63408 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -3,6 +3,8 @@ local tokenArrangerApi = require("accessories/TokenArrangerApi") local tokenChecker = require("core/token/TokenChecker") local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") +local guidHandler = getObjectsWithTag("GUIDs")[1] + local ENCOUNTER_DECK_AREA = { upperLeft = { x = 0.9, z = 0.42 }, lowerRight = { x = 0.86, z = 0.38 }, @@ -33,8 +35,8 @@ function onLoad(saveState) useFrontData = loadedState.useFrontData or true tokenData = loadedState.tokenData or {} end - TRASH = getObjectsWithAllTags({"Mythos", "Trash"}) - DATA_HELPER = getObjectsWithTag("DataHelper")[1] + TRASH = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "Trash" }) + DATA_HELPER = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DataHelper" }) collisionEnabled = true end diff --git a/src/core/MythosAreaApi.ttslua b/src/core/MythosAreaApi.ttslua index 4f08509e..702c538d 100644 --- a/src/core/MythosAreaApi.ttslua +++ b/src/core/MythosAreaApi.ttslua @@ -1,16 +1,19 @@ do local MythosAreaApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] + + local function getMythosArea() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "MythosArea" }) + end -- returns the chaos token metadata (if provided through scenario reference card) MythosAreaApi.returnTokenData = function() - local MythosArea = getObjectsWithTag("MythosArea")[1] - return MythosArea.call("returnTokenData") + getMythosArea().call("returnTokenData") end -- draw an encounter card to the requested position/rotation MythosAreaApi.drawEncounterCard = function(pos, rotY, alwaysFaceUp) - local MythosArea = getObjectsWithTag("MythosArea")[1] - MythosArea.call("drawEncounterCard", { + getMythosArea().call("drawEncounterCard", { pos = pos, rotY = rotY, alwaysFaceUp = alwaysFaceUp diff --git a/src/core/NavigationOverlayApi.ttslua b/src/core/NavigationOverlayApi.ttslua index b1e92dd5..995fdbaf 100644 --- a/src/core/NavigationOverlayApi.ttslua +++ b/src/core/NavigationOverlayApi.ttslua @@ -1,12 +1,16 @@ do local NavigationOverlayApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] + + local function getNOHandler() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "NavigationOverlayHandler" }) + end -- Copies the visibility for the Navigation overlay ---@param startColor String Color of the player to copy from ---@param targetColor String Color of the targeted player NavigationOverlayApi.copyVisibility = function(startColor, targetColor) - local handler = getObjectsWithTag("NavigationOverlayHandler")[1] - handler.call("copyVisibility", { + getNOHandler().call("copyVisibility", { startColor = startColor, targetColor = targetColor }) @@ -15,8 +19,7 @@ do -- Changes the Navigation Overlay view ("Full View" --> "Play Areas" --> "Closed" etc.) ---@param playerColor String Color of the player to update the visibility for NavigationOverlayApi.cycleVisibility = function(playerColor) - local handler = getObjectsWithTag("NavigationOverlayHandler")[1] - handler.call("cycleVisibility", playerColor) + getNOHandler().call("cycleVisibility", playerColor) end return NavigationOverlayApi diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index e80cffd1..4a360321 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -2,6 +2,8 @@ -- general setup --------------------------------------------------------- +local guidHandler = getObjectsWithTag("GUIDs")[1] + -- Location connection directional options local BIDIRECTIONAL = 0 local ONE_WAY = 1 @@ -506,7 +508,7 @@ function shiftContentsRight(playerColor) end function shiftContents(playerColor, direction) - local zone = getObjectsWithTag("PlayAreaZone")[1] + local zone = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "PlayAreaZone" }) if not zone then broadcastToColor("Scripting zone couldn't be found.", playerColor, "Red") return diff --git a/src/core/PlayAreaApi.ttslua b/src/core/PlayAreaApi.ttslua index 66dad51c..54291f5f 100644 --- a/src/core/PlayAreaApi.ttslua +++ b/src/core/PlayAreaApi.ttslua @@ -1,105 +1,109 @@ do local PlayAreaApi = {} - local internal = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] - internal.getPlayArea = function() - return getObjectsWithTag("PlayArea")[1] + local function getPlayArea() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "PlayArea" }) + end + + local function getInvestigatorCounter() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "InvestigatorCounter" }) end -- Returns the current value of the investigator counter from the playmat ---@return Integer. Number of investigators currently set on the counter PlayAreaApi.getInvestigatorCount = function() - return getObjectsWithTag("InvestigatorCounter")[1].getVar("val") + getInvestigatorCounter().getVar("val") end -- Updates the current value of the investigator counter from the playmat ---@param count Number of investigators to set on the counter PlayAreaApi.setInvestigatorCount = function(count) - return getObjectsWithTag("InvestigatorCounter")[1].call("updateVal", count) + getInvestigatorCounter().call("updateVal", count) end -- Move all contents on the play area (cards, tokens, etc) one slot in the given direction. Certain -- fixed objects will be ignored, as will anything the player has tagged with 'displacement_excluded' ---@param playerColor Color Color of the player requesting the shift for messages PlayAreaApi.shiftContentsUp = function(playerColor) - return internal.getPlayArea().call("shiftContentsUp", playerColor) + return getPlayArea().call("shiftContentsUp", playerColor) end PlayAreaApi.shiftContentsDown = function(playerColor) - return internal.getPlayArea().call("shiftContentsDown", playerColor) + return getPlayArea().call("shiftContentsDown", playerColor) end PlayAreaApi.shiftContentsLeft = function(playerColor) - return internal.getPlayArea().call("shiftContentsLeft", playerColor) + return getPlayArea().call("shiftContentsLeft", playerColor) end PlayAreaApi.shiftContentsRight = function(playerColor) - return internal.getPlayArea().call("shiftContentsRight", playerColor) + return getPlayArea().call("shiftContentsRight", playerColor) end -- Reset the play area's tracking of which cards have had tokens spawned. PlayAreaApi.resetSpawnedCards = function() - return internal.getPlayArea().call("resetSpawnedCards") + return getPlayArea().call("resetSpawnedCards") end -- Event to be called when the current scenario has changed. ---@param scenarioName Name of the new scenario PlayAreaApi.onScenarioChanged = function(scenarioName) - internal.getPlayArea().call("onScenarioChanged", scenarioName) + getPlayArea().call("onScenarioChanged", scenarioName) end -- Sets this playmat's snap points to limit snapping to locations or not. -- If matchTypes is false, snap points will be reset to snap all cards. ---@param matchTypes Boolean Whether snap points should only snap for the matching card types. PlayAreaApi.setLimitSnapsByType = function(matchCardTypes) - internal.getPlayArea().call("setLimitSnapsByType", matchCardTypes) + getPlayArea().call("setLimitSnapsByType", matchCardTypes) end -- Receiver for the Global tryObjectEnterContainer event. Used to clear vector lines from dragged -- cards before they're destroyed by entering the container PlayAreaApi.tryObjectEnterContainer = function(container, object) - internal.getPlayArea().call("tryObjectEnterContainer", { container = container, object = object }) + getPlayArea().call("tryObjectEnterContainer", { container = container, object = object }) end -- counts the VP on locations in the play area PlayAreaApi.countVP = function() - return internal.getPlayArea().call("countVP") + return getPlayArea().call("countVP") end -- highlights all locations in the play area without metadata ---@param state Boolean True if highlighting should be enabled PlayAreaApi.highlightMissingData = function(state) - return internal.getPlayArea().call("highlightMissingData", state) + return getPlayArea().call("highlightMissingData", state) end -- highlights all locations in the play area with VP ---@param state Boolean True if highlighting should be enabled PlayAreaApi.highlightCountedVP = function(state) - return internal.getPlayArea().call("highlightCountedVP", state) + return getPlayArea().call("highlightCountedVP", state) end -- Checks if an object is in the play area (returns true or false) PlayAreaApi.isInPlayArea = function(object) - return internal.getPlayArea().call("isInPlayArea", object) + return getPlayArea().call("isInPlayArea", object) end PlayAreaApi.getSurface = function() - return internal.getPlayArea().getCustomObject().image + return getPlayArea().getCustomObject().image end PlayAreaApi.updateSurface = function(url) - return internal.getPlayArea().call("updateSurface", url) + return getPlayArea().call("updateSurface", url) end -- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the -- data to the local token manager instance. ---@param args Table Single-value array holding the GUID of the Custom Data Helper making the call PlayAreaApi.updateLocations = function(args) - internal.getPlayArea().call("updateLocations", args) + getPlayArea().call("updateLocations", args) end PlayAreaApi.getCustomDataHelper = function() - return internal.getPlayArea().getVar("customDataHelper") + return getPlayArea().getVar("customDataHelper") end return PlayAreaApi diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua index 13d11fa3..0339f519 100644 --- a/src/core/SoundCubeApi.ttslua +++ b/src/core/SoundCubeApi.ttslua @@ -1,5 +1,6 @@ do local SoundCubeApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] -- this table links the name of a trigger effect to its index local soundIndices = { @@ -9,7 +10,7 @@ do } local function playTriggerEffect(index) - local SoundCube = getObjectsWithTag("SoundCube")[1] + local SoundCube = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "SoundCube" }) SoundCube.AssetBundle.playTriggerEffect(index) end diff --git a/src/core/VictoryDisplay.ttslua b/src/core/VictoryDisplay.ttslua index f706ba63..36680eff 100644 --- a/src/core/VictoryDisplay.ttslua +++ b/src/core/VictoryDisplay.ttslua @@ -10,12 +10,10 @@ local countedVP = {} local highlightMissing = false local highlightCounted = false -local TRASH +local guidHandler = getObjectsWithTag("GUIDs")[1] -- button creation when loading the game function onLoad() - TRASH = getObjectsWithAllTags({"Mythos", "Trash"}) - -- index 0: VP - "Display" local buttonParameters = {} buttonParameters.label = "0" @@ -235,8 +233,7 @@ end function highlightCountedVP() self.editButton({ index = 4, - tooltip = (highlightCounted and "Enable" or "Disable") .. - " highlighting of cards with VP." + tooltip = (highlightCounted and "Enable" or "Disable") .. " highlighting of cards with VP." }) for _, obj in pairs(countedVP) do if obj ~= nil then @@ -253,6 +250,8 @@ end -- places the provided card in the first empty spot function placeCard(card) + local TRASH = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "Trash" }) + -- check snap point states local snaps = self.getSnapPoints() table.sort(snaps, function(a, b) return a.position.x > b.position.x end) diff --git a/src/core/VictoryDisplayApi.ttslua b/src/core/VictoryDisplayApi.ttslua index 6dc0fad4..dc14fe0a 100644 --- a/src/core/VictoryDisplayApi.ttslua +++ b/src/core/VictoryDisplayApi.ttslua @@ -1,19 +1,22 @@ do local VictoryDisplayApi = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] + + local function getVictoryDisplay() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "VictoryDisplay" }) + end -- triggers an update of the Victory count ---@param delay Number Delay in seconds after which the update call is executed VictoryDisplayApi.update = function(delay) - local VictoryDisplay = getObjectsWithTag("VictoryDisplay")[1] - VictoryDisplay.call("startUpdate", delay) + getVictoryDisplay().call("startUpdate", delay) end -- moves a card to the victory display (in the first empty spot) ---@param object Object Object that should be checked and potentially moved VictoryDisplayApi.placeCard = function(object) if object ~= nil and object.tag == "Card" then - local VictoryDisplay = getObjectsWithTag("VictoryDisplay")[1] - VictoryDisplay.call("placeCard", object) + getVictoryDisplay().call("getObjectByOwnerAndType", { owner = "Mythos", type = "VictoryDisplay" }).call("placeCard", object) end end diff --git a/src/core/token/TokenManager.ttslua b/src/core/token/TokenManager.ttslua index bd4972ea..91504bd6 100644 --- a/src/core/token/TokenManager.ttslua +++ b/src/core/token/TokenManager.ttslua @@ -3,6 +3,8 @@ do local playAreaApi = require("core/PlayAreaApi") local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi") + local guidHandler = getObjectsWithTag("GUIDs")[1] + local PLAYER_CARD_TOKEN_OFFSETS = { [1] = { Vector(0, 3, -0.2) @@ -335,7 +337,7 @@ do return end tokenTemplates = { } - local tokenSource = getObjectsWithTag("TokenSource")[1] + local tokenSource = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "TokenSource" }) for _, tokenTemplate in ipairs(tokenSource.getData().ContainedObjects) do local tokenName = tokenTemplate.Memo tokenTemplates[tokenName] = tokenTemplate @@ -347,7 +349,7 @@ do if playerCardData ~= nil then return end - local dataHelper = getObjectsWithTag("DataHelper")[1] + local dataHelper = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DataHelper" }) playerCardData = dataHelper.getTable('PLAYER_CARD_DATA') locationData = dataHelper.getTable('LOCATIONS_DATA') end diff --git a/src/core/token/TokenSpawnTrackerApi.ttslua b/src/core/token/TokenSpawnTrackerApi.ttslua index 21eaf9da..23cf7b8f 100644 --- a/src/core/token/TokenSpawnTrackerApi.ttslua +++ b/src/core/token/TokenSpawnTrackerApi.ttslua @@ -1,33 +1,33 @@ do local TokenSpawnTracker = {} - local internal = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] - internal.getSpawnTracker = function() - return getObjectsWithTag("TokenSpawnTracker")[1] + local function getSpawnTracker() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "TokenSpawnTracker" }) end TokenSpawnTracker.hasSpawnedTokens = function(cardGuid) - return internal.getSpawnTracker().call("hasSpawnedTokens", cardGuid) + return getSpawnTracker().call("hasSpawnedTokens", cardGuid) end TokenSpawnTracker.markTokensSpawned = function(cardGuid) - return internal.getSpawnTracker().call("markTokensSpawned", cardGuid) + return getSpawnTracker().call("markTokensSpawned", cardGuid) end TokenSpawnTracker.resetTokensSpawned = function(cardGuid) - return internal.getSpawnTracker().call("resetTokensSpawned", cardGuid) + return getSpawnTracker().call("resetTokensSpawned", cardGuid) end TokenSpawnTracker.resetAllAssetAndEvents = function() - return internal.getSpawnTracker().call("resetAllAssetAndEvents") + return getSpawnTracker().call("resetAllAssetAndEvents") end TokenSpawnTracker.resetAllLocations = function() - return internal.getSpawnTracker().call("resetAllLocations") + return getSpawnTracker().call("resetAllLocations") end TokenSpawnTracker.resetAll = function() - return internal.getSpawnTracker().call("resetAll") + return getSpawnTracker().call("resetAll") end return TokenSpawnTracker diff --git a/src/playercards/AllCardsBagApi.ttslua b/src/playercards/AllCardsBagApi.ttslua index 322b2aad..8b0387f5 100644 --- a/src/playercards/AllCardsBagApi.ttslua +++ b/src/playercards/AllCardsBagApi.ttslua @@ -1,9 +1,9 @@ do local AllCardsBagApi = {} - local internal = {} + local guidHandler = getObjectsWithTag("GUIDs")[1] - internal.getAllCardsBag = function() - return getObjectsWithTag("AllCardsBag")[1] + local function getAllCardsBag() + return guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "AllCardsBag" }) end -- Returns a specific card from the bag, based on ArkhamDB ID @@ -14,7 +14,7 @@ do -- cardData: TTS object data, suitable for spawning the card -- cardMetadata: Table of parsed metadata AllCardsBagApi.getCardById = function(id) - internal.getAllCardsBag().call("getCardById", {id = id}) + return getAllCardsBag().call("getCardById", {id = id}) end -- Gets a random basic weakness from the bag. Once a given ID has been returned @@ -23,11 +23,11 @@ do -- weaknesses. ---@return id String ID of the selected weakness. AllCardsBagApi.getRandomWeaknessId = function() - internal.getAllCardsBag().call("getRandomWeaknessId") + return getAllCardsBag().call("getRandomWeaknessId") end AllCardsBagApi.isIndexReady = function() - internal.getAllCardsBag().call("isIndexReady") + return getAllCardsBag().call("isIndexReady") end -- Called by Hotfix bags when they load. If we are still loading indexes, then @@ -36,7 +36,7 @@ do -- called once indexing is complete it means the hotfix bag has been added -- later, and we should rebuild the index to integrate the hotfix bag. AllCardsBagApi.rebuildIndexForHotfix = function() - internal.getAllCardsBag().call("rebuildIndexForHotfix") + return getAllCardsBag().call("rebuildIndexForHotfix") end -- Searches the bag for cards which match the given name and returns a list. Note that this is @@ -44,11 +44,11 @@ do ---@param name String or string fragment to search for names ---@param exact Boolean Whether the name match should be exact AllCardsBagApi.getCardsByName = function(name, exact) - internal.getAllCardsBag().call("getCardsByName", {name = name, exact = exact}) + return getAllCardsBag().call("getCardsByName", {name = name, exact = exact}) end AllCardsBagApi.isBagPresent = function() - internal.getAllCardsBag() and true + return getAllCardsBag() and true end -- Returns a list of cards from the bag matching a class and level (0 or upgraded) @@ -59,15 +59,15 @@ do -- cardData: TTS object data, suitable for spawning the card -- cardMetadata: Table of parsed metadata AllCardsBagApi.getCardsByClassAndLevel = function(class, upgraded) - internal.getAllCardsBag().call("getCardsByClassAndLevel", {class = class, upgraded = upgraded}) + return getAllCardsBag().call("getCardsByClassAndLevel", {class = class, upgraded = upgraded}) end AllCardsBagApi.getCardsByCycle = function(cycle) - internal.getAllCardsBag().call("getCardsByCycle", cycle) + return getAllCardsBag().call("getCardsByCycle", cycle) end AllCardsBagApi.getUniqueWeaknesses = function() - internal.getAllCardsBag().call("getUniqueWeaknesses") + return getAllCardsBag().call("getUniqueWeaknesses") end return AllCardsBagApi diff --git a/src/playermat/ClueCounter.ttslua b/src/playermat/ClueCounter.ttslua index 45985fde..251fb070 100644 --- a/src/playermat/ClueCounter.ttslua +++ b/src/playermat/ClueCounter.ttslua @@ -7,13 +7,12 @@ local validCountItemList = { ["Clue"] = 1, [""] = 1 } -local MATCOLOR, TRASH exposedValue = 0 function onLoad() self.createButton({ label = "", - click_function = "removeAllClues", + click_function = "countItems", function_owner = self, position = { 0, 0.1, 0 }, height = 0, @@ -21,9 +20,6 @@ function onLoad() font_color = { 0, 0, 0 }, font_size = 2000 }) - -- set MATCOLOR based on memo - MATCOLOR = JSON.decode(self.getMemo()).matColor - TRASH = getObjectsWithAllTags({MATCOLOR, "Trash"}) loopID = Wait.time(countItems, 1, -1) end @@ -69,20 +65,8 @@ function findValidItemsInSphere() return retval end -function removeAllClues() - startLuaCoroutine(self, "clueRemovalCoroutine") -end - -function clueRemovalCoroutine() - for _, entry in ipairs(findValidItemsInSphere()) do - -- Do not put the table in the garbage - if entry.hit_object.getGUID() ~= "4ee1f2" then - -- delay for animation purposes - for k = 1, 10 do - coroutine.yield(0) - end - TRASH.putObject(entry.hit_object) - end +function removeAllClues(trash) + for _, obj in ipairs(findValidItemsInSphere()) do + trash.putObject(obj) end - return 1 -end +end \ No newline at end of file diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index dc5858a9..586fa356 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -4,6 +4,8 @@ local navigationOverlayApi = require("core/NavigationOverlayApi") local tokenChecker = require("core/token/TokenChecker") local tokenManager = require("core/token/TokenManager") +local guidHandler = getObjectsWithTag("GUIDs")[1] + -- set true to enable debug logging and show Physics.cast() local DEBUG = false @@ -83,7 +85,7 @@ activeInvestigatorId = "00000" -- table of type-object reference pairs of all owned objects local ownedObjects = {} -local matColor = JSON.decode(self.getMemo()).matColor +local matColor = self.getMemo() -- variable to track the status of the "Show Draw Button" option local isDrawButtonVisible = false @@ -103,7 +105,7 @@ function onLoad(saveState) self.interactable = DEBUG -- get object references to owned objects - getOwnedObjects() + ownedObjects = guidHandler.call("getObjectsByOwner", matColor) -- button creation for i = 1, 6 do @@ -152,13 +154,6 @@ function onLoad(saveState) math.randomseed(os.time()) end -function getOwnedObjects() - local objList = getObjectsWithTag(matColor) - for _, obj in ipairs(objList) do - - end -end - --------------------------------------------------------- -- utility functions --------------------------------------------------------- @@ -873,7 +868,7 @@ function clickableClues(showCounter) clueCount = ownedObjects.ClueCounter.getVar("exposedValue") -- remove clues - ownedObjects.ClueCounter.call("removeAllClues") + ownedObjects.ClueCounter.call("removeAllClues", ownedObjects.Trash) -- set value for clue clickers ownedObjects.ClickableClueCounter.call("updateVal", clueCount) @@ -900,7 +895,7 @@ end -- removes all clues (moving tokens to the trash and setting counters to 0) function removeClues() - ownedObjects.ClueCounter.call("removeAllClues") + ownedObjects.ClueCounter.call("removeAllClues", ownedObjects.Trash) ownedObjects.ClickableClueCounter.call("updateVal", 0) end diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 2250bbe0..656df813 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -163,7 +163,7 @@ do ---@param modifier Number If newValue is not provided, the existing value will be adjusted by this modifier PlaymatApi.updateCounter = function(matColor, type, newValue, modifier) for _, mat in ipairs(internal.getMatForColor(matColor)) do - mat.call("updateCounter", {type = type, newValue = newValue, modifier = modifier}) + mat.call("updateCounter", { type = type, newValue = newValue, modifier = modifier }) end end @@ -216,10 +216,11 @@ do ---@param matColor String Color of the playmat - White, Orange, Green, Red or All ---@return array Table Single-element if only single playmat is requested internal.getMatForColor = function(matColor) + local guidHandler = getObjectsWithTag("GUIDs")[1] if matColor == "All" then - return getObjectsWithTag("Playermat") + return guidHandler.call("getObjectsByType", "Playermat") else - return {matColor = getObjectsWithAllTags({matColor, "Playermat"}) } + return { matColor = guidHandler.call("getObjectByOwnerAndType", { owner = matColor, type = "Playermat" }) } end end