From 83dd3ade5c569af5189911f19e73227d59df40a4 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Mon, 7 Oct 2024 09:10:53 -0500 Subject: [PATCH 1/8] 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) From 98722d713510cb23e81d6228ffcbd81901349a97 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Mon, 7 Oct 2024 10:29:09 -0500 Subject: [PATCH 2/8] added highlighting to onLoad --- src/core/UniversalActionAbilityToken.ttslua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/UniversalActionAbilityToken.ttslua b/src/core/UniversalActionAbilityToken.ttslua index 3adf93d6..2cc0d08c 100644 --- a/src/core/UniversalActionAbilityToken.ttslua +++ b/src/core/UniversalActionAbilityToken.ttslua @@ -52,6 +52,8 @@ local colorsForClasses = { Survivor = Color.new(190 / 255, 30 / 255, 45 / 255) } +local highlightColor = { 0, 200 / 255, 200 / 255 } + function onSave() return JSON.encode({ class = class, symbol = symbol }) end @@ -63,6 +65,9 @@ function onLoad(savedData) updateDisplay() addContextMenu() + if self.hasTag("Temporary") then + self.highlightOn(highlightColor) + end -- get random seed from Global so all are different math.randomseed(Global.call("getRandomSeed")) @@ -274,7 +279,7 @@ end function addTemporaryStatus() self.addTag("Temporary") - self.highlightOn({0, 200/255, 200/255}) + self.highlightOn(highlightColor) end function isClassName(str) From 1f4ca49f30f60b6fa7aec71be35b6e306ec7d328 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Mon, 7 Oct 2024 10:34:19 -0500 Subject: [PATCH 3/8] simplified --- src/util/TokenSpawnTool.ttslua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/util/TokenSpawnTool.ttslua b/src/util/TokenSpawnTool.ttslua index 5610d9c8..df292d39 100644 --- a/src/util/TokenSpawnTool.ttslua +++ b/src/util/TokenSpawnTool.ttslua @@ -66,10 +66,9 @@ 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 } + callbackParams.addTag = "Temporary" end end From 2704465cc05094ae990e5dae9c21d920a96e9718 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 7 Oct 2024 23:49:27 +0200 Subject: [PATCH 4/8] added search bar and dropdown to XML --- xml/Global/DownloadWindow.xml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/xml/Global/DownloadWindow.xml b/xml/Global/DownloadWindow.xml index c91801f4..07d36b17 100644 --- a/xml/Global/DownloadWindow.xml +++ b/xml/Global/DownloadWindow.xml @@ -71,6 +71,29 @@ + + + + + + + + + PreviewDescription - +