From a744b882ae282a78d3418a95a3cb15c3d47737ad Mon Sep 17 00:00:00 2001 From: Buhallin Date: Thu, 29 Dec 2022 16:35:55 -0800 Subject: [PATCH] SCED Intro Tour, Final Previous attempt got hosed with some merge conflicts, moving to a new branch to start clean --- config.json | 3 +- objects/SCEDTour.0e5aa8.json | 57 ++++++++++++++++++++++++++++++++ src/core/tour/TourStarter.ttslua | 35 ++++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 objects/SCEDTour.0e5aa8.json create mode 100644 src/core/tour/TourStarter.ttslua diff --git a/config.json b/config.json index 2ccfc194..5e47eb16 100644 --- a/config.json +++ b/config.json @@ -251,7 +251,8 @@ "ArkhamSCED240Page1-12102022.1dd55c", "TokenSpawnTracker.e3ffc9", "TokenSource.124381", - "GameData.3dbe47" + "GameData.3dbe47", + "SCEDTour.0e5aa8" ], "PlayArea": 1, "PlayerCounts": [ diff --git a/objects/SCEDTour.0e5aa8.json b/objects/SCEDTour.0e5aa8.json new file mode 100644 index 00000000..9acdfe3a --- /dev/null +++ b/objects/SCEDTour.0e5aa8.json @@ -0,0 +1,57 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomToken": { + "MergeDistancePixels": 5, + "Stackable": false, + "StandUp": false, + "Thickness": 0.1 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "", + "ImageURL": "https://i.imgur.com/Q1J2Dgl.png", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "0e5aa8", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "require(\"core/tour/TourStarter\")", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_Token", + "Nickname": "SCED Tour", + "Snap": true, + "Sticky": true, + "Tooltip": false, + "Transform": { + "posX": -23.677, + "posY": 1.57, + "posZ": -0.03, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 3.38, + "scaleY": 1, + "scaleZ": 3.38 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/src/core/tour/TourStarter.ttslua b/src/core/tour/TourStarter.ttslua new file mode 100644 index 00000000..62bd64e7 --- /dev/null +++ b/src/core/tour/TourStarter.ttslua @@ -0,0 +1,35 @@ +local tourManager = require("core/tour/TourManager") + +function onLoad() + self.createButton({ + click_function = "startTour", + function_owner = self, + position = { 1.27, 0.05, 0.035}, + width = 500, + height = 20, + color = { 0, 0, 0, 0 }, + -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size + scale = { 1, 1, 0.82 }, + tooltip = "Start the Tour", + }) + self.createButton({ + click_function = "deleteStarter", + function_owner = self, + position = { 1.27, 0.05, 0.309}, + width = 500, + height = 20, + color = { 0, 0, 0, 0 }, + -- TTS has a minium height for buttons, have to scale the Z-axis down to get the right size + scale = { 1, 1, 0.82 }, + tooltip = "Delete this Panel", + }) +end + +function startTour(_, playerColor, _) + broadcastToColor("Starting the tour, please wait", playerColor) + tourManager.startTour(playerColor) +end + +function deleteStarter(_, _, _) + self.destruct() +end