From ba6bd5e2228d40ebd4842eeb706a3234449b38ea Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 17 Apr 2023 22:53:05 +0200 Subject: [PATCH 1/2] added removal of Mythos data onCollisionExit --- .../ArkhamSCE300-1272023-Page1.f873a8.json | 137 ------------------ src/core/MythosArea.ttslua | 14 ++ 2 files changed, 14 insertions(+), 137 deletions(-) delete mode 100644 objects/ArkhamSCE300-1272023-Page1.f873a8.json diff --git a/objects/ArkhamSCE300-1272023-Page1.f873a8.json b/objects/ArkhamSCE300-1272023-Page1.f873a8.json deleted file mode 100644 index 25ac750e..00000000 --- a/objects/ArkhamSCE300-1272023-Page1.f873a8.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "Description": "- Revamped the entire table!\n- Revamped (almost) all official scenarios to use dynamic location marking!\n- Added an introductory tour by Joe Sargent and the Investigators of Arkham!\n- Revamped the deck construction! Cards and investigators can now be laid out by cycle as well as by class. (For now, Gloria Goldberg is with the Investigator Packs.)\n", - "DragSelectable": true, - "GMNotes": "", - "GUID": "f873a8", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Notecard", - "Nickname": "Arkham SCE 3.0.0 - 1/27/2023 - Page 1", - "Snap": true, - "States": { - "2": { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "Description": "- Doom Counter has been revised with new scripting allowing improved doom tracking.\n- An options menu has been added to the bottom right download list (visible to promoted/host players only).\n- Added dynamic snap points that only snap tags with the right tags.\n- Added scenario title splash display on setup.", - "DragSelectable": true, - "GMNotes": "", - "GUID": "42a97c", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Notecard", - "Nickname": "Arkham SCE 3.0.0 - 1/27/2023 - Page 2", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -59.47101, - "posY": 1.551499, - "posZ": -59.04777, - "rotX": -4.943345e-10, - "rotY": 89.99619, - "rotZ": -2.35820238e-7, - "scaleX": 3, - "scaleY": 1, - "scaleZ": 3 - }, - "Value": 0, - "XmlUI": "" - }, - "3": { - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "Description": "- Several miscellaneous options have been added to the options menu.\n- Slightly enlarged the threat area discard buttons.\n- Added Close Encounters of the LV-426 Kind fan campaign!\n- Extra-Special-Elder-Sign-Thank-You to everyone who helped make this truly transformative update!", - "DragSelectable": true, - "GMNotes": "", - "GUID": "f97e27", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": false, - "LuaScript": "", - "LuaScriptState": "", - "MeasureMovement": false, - "Name": "Notecard", - "Nickname": "Arkham SCE 3.0.0 - 1/27/2023 - Page 3", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -41.12479, - "posY": 1.551499, - "posZ": -64.53259, - "rotX": -2.12492921e-8, - "rotY": 89.99619, - "rotZ": -1.24092324e-7, - "scaleX": 3, - "scaleY": 1, - "scaleZ": 3 - }, - "Value": 0, - "XmlUI": "" - } - }, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -27, - "posY": 1.551, - "posZ": -71, - "rotX": 0, - "rotY": 90, - "rotZ": 0, - "scaleX": 3, - "scaleY": 1, - "scaleZ": 3 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index a28c42c8..9a423886 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -77,6 +77,20 @@ function onCollisionEnter(collisionInfo) end end +-- TTS event handler. Handles scenario name event triggering +function onCollisionExit(collisionInfo) + if not collisionEnabled then return end + local object = collisionInfo.collision_object + + -- reset data if scenario reference card is removed + if object.getName() == "Scenario" then + tokenData = {} + currentScenario = nil + useFrontData = nil + fireTokenDataChangedEvent() + end +end + -- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state -- for the cards when they do. function onObjectEnterContainer(container, object) From 500ddf6d9c93ba0262a5b67caef284985764a1a9 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 18 Apr 2023 09:36:04 +0200 Subject: [PATCH 2/2] keep scenarioName intact --- src/core/MythosArea.ttslua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 9a423886..61fd1ca6 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -82,10 +82,9 @@ function onCollisionExit(collisionInfo) if not collisionEnabled then return end local object = collisionInfo.collision_object - -- reset data if scenario reference card is removed + -- reset token metadata if scenario reference card is removed if object.getName() == "Scenario" then tokenData = {} - currentScenario = nil useFrontData = nil fireTokenDataChangedEvent() end