From 83dd3ade5c569af5189911f19e73227d59df40a4 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Mon, 7 Oct 2024 09:10:53 -0500 Subject: [PATCH] added teal highlighting --- objects/TokenSpawningReference.f8b3a7.json | 2 +- src/core/Global.ttslua | 2 +- src/core/UniversalActionAbilityToken.ttslua | 5 +++++ src/util/TokenSpawnTool.ttslua | 7 ++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/objects/TokenSpawningReference.f8b3a7.json b/objects/TokenSpawningReference.f8b3a7.json index 760bd6ab..f26dc439 100644 --- a/objects/TokenSpawningReference.f8b3a7.json +++ b/objects/TokenSpawningReference.f8b3a7.json @@ -19,7 +19,7 @@ }, "ImageScalar": 1, "ImageSecondaryURL": "", - "ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2467486908540932616/8370C75D2789E1332836D8C2A31D32542153DE85/", + "ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2503529021846579660/223F10EFA8B08AB25EC22181C3371161B5301F08/", "WidthScale": 0 }, "Description": "Press a numpad key to spawn the indicated token.", diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 316a2220..2d2f9728 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -2580,7 +2580,7 @@ end function updateUniversalActionAbilityToken(obj, params) obj.call("updateClassAndSymbol", params) if params.addTag then - obj.addTag(params.addTag) + obj.call("addTemporaryStatus") end end diff --git a/src/core/UniversalActionAbilityToken.ttslua b/src/core/UniversalActionAbilityToken.ttslua index 138575db..3adf93d6 100644 --- a/src/core/UniversalActionAbilityToken.ttslua +++ b/src/core/UniversalActionAbilityToken.ttslua @@ -272,6 +272,11 @@ function updateClassAndSymbol(params) updateDisplay() end +function addTemporaryStatus() + self.addTag("Temporary") + self.highlightOn({0, 200/255, 200/255}) +end + function isClassName(str) for _, className in ipairs(listOfClasses) do if className == str then diff --git a/src/util/TokenSpawnTool.ttslua b/src/util/TokenSpawnTool.ttslua index 8e0918a3..5610d9c8 100644 --- a/src/util/TokenSpawnTool.ttslua +++ b/src/util/TokenSpawnTool.ttslua @@ -4,6 +4,7 @@ local tokenManagerApi = require("core/token/TokenManagerApi") local TOKEN_INDEX = {} TOKEN_INDEX[1] = "universalActionAbility" +TOKEN_INDEX[2] = "universalActionAbility" TOKEN_INDEX[3] = "resourceCounter" TOKEN_INDEX[4] = "damage" TOKEN_INDEX[5] = "path" @@ -65,7 +66,11 @@ function onScriptingButtonDown(index, playerColor) local activeInvestigatorData = playermatApi.getActiveInvestigatorData(matColor) rotation = playermatApi.returnRotation(matColor) callbackName = "updateUniversalActionAbilityToken" - callbackParams = { class = activeInvestigatorData.class, symbol = activeInvestigatorData.class } + if index == 2 then -- temporary version + callbackParams = { class = activeInvestigatorData.class, symbol = activeInvestigatorData.class, addTag = "Temporary" } + else + callbackParams = { class = activeInvestigatorData.class, symbol = activeInvestigatorData.class } + end end tokenManagerApi.spawnToken(position, tokenType, rotation, callbackName, callbackParams)