From aad215984da1310ed55d97e36224717b5b74c9b0 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Sun, 25 Aug 2024 19:25:00 -0500 Subject: [PATCH 1/6] added teal --- xml/DoomCounter.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/DoomCounter.xml b/xml/DoomCounter.xml index 32cbbfca..3cbeed1e 100644 --- a/xml/DoomCounter.xml +++ b/xml/DoomCounter.xml @@ -1,16 +1,16 @@ - + - + - + From 5317e6786f0986c133f1d536e4ca66651537b3e6 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 27 Aug 2024 23:58:17 +0200 Subject: [PATCH 2/6] Added nil handling for scenario name to Clean Up Helper --- src/accessories/CleanUpHelper.ttslua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index 9be7d435..ff09033b 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -422,7 +422,7 @@ end -- get value with respect to override value function getOptionValue() -- don't clean up playermats if playing a prelude from the list - if preludeList[scenarioName] then + if scenarioName and preludeList[scenarioName] then return false else return options["tidyPlayermats"] From 52551373c7b8ff2a5e73b36fc089ed1f13b0c422 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Fri, 30 Aug 2024 03:46:06 -0500 Subject: [PATCH 3/6] more changes --- xml/DoomCounter.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/DoomCounter.xml b/xml/DoomCounter.xml index 3cbeed1e..75daef0a 100644 --- a/xml/DoomCounter.xml +++ b/xml/DoomCounter.xml @@ -1,16 +1,16 @@ - + - + - + From e08b0cfed469cb30e649e651f1f1a45b51ed4313 Mon Sep 17 00:00:00 2001 From: dscarpac Date: Sat, 31 Aug 2024 18:15:36 -0500 Subject: [PATCH 4/6] added changes --- objects/DoomCounter.85c4c6.json | 7 +++++++ src/core/DoomCounter.ttslua | 17 ++++++++++++++++- xml/DoomCounter.xml | 19 ++++++++++--------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/objects/DoomCounter.85c4c6.json b/objects/DoomCounter.85c4c6.json index 22922a95..e1b4d3bc 100644 --- a/objects/DoomCounter.85c4c6.json +++ b/objects/DoomCounter.85c4c6.json @@ -22,6 +22,13 @@ "ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/949592555964782208/CC876694A6684B3C2680CE2FE3259F574AE0AD97/", "WidthScale": 0 }, + "CustomUIAssets": [ + { + "Name": "font_teutonic-arkham", + "Type": 1, + "URL": "https://steamusercontent-a.akamaihd.net/ugc/2027213118467703445/89328E273B4C5180BF491516CE998DE3C604E162/" + } + ], "Description": "", "DragSelectable": true, "GMNotes": "", diff --git a/src/core/DoomCounter.ttslua b/src/core/DoomCounter.ttslua index 3bc07839..decfd636 100644 --- a/src/core/DoomCounter.ttslua +++ b/src/core/DoomCounter.ttslua @@ -10,6 +10,7 @@ local options = { } val = 0 +self.max_typed_number = 99 -- save current value and options function onSave() return JSON.encode({ val, options }) end @@ -22,7 +23,7 @@ function onLoad(savedData) -- restore state for option panel for key, bool in pairs(options) do - self.UI.setAttribute("option" .. key, "isOn", not bool) + if bool == false then changeLabel(key) end end end @@ -65,6 +66,10 @@ function updateVal(number) end end +function onNumberTyped(_, number) + updateVal(number) +end + -- called by updateVal and addVal to broadcast total doom in play, including doom threshold function broadcastDoom(val) local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter") @@ -122,6 +127,7 @@ end -- XML UI functions function optionClick(_, optionName) options[optionName] = not options[optionName] + changeLabel(optionName) printToAll("Doom removal of " .. optionName .. (options[optionName] and " enabled" or " disabled")) end @@ -134,3 +140,12 @@ function toggleOptions() self.UI.hide("Options") end end + +function changeLabel(optionName) + local label = self.UI.getAttribute("option" .. optionName, "text") + if options[optionName] == true then + self.UI.setAttribute("option" .. optionName, "text", string.gsub(label, "☐", "☑")) + else + self.UI.setAttribute("option" .. optionName, "text", string.gsub(label, "☑", "☐")) + end +end diff --git a/xml/DoomCounter.xml b/xml/DoomCounter.xml index 75daef0a..c1f26153 100644 --- a/xml/DoomCounter.xml +++ b/xml/DoomCounter.xml @@ -1,25 +1,26 @@ - + + - + - + - + - - - Doom on Agenda - Doom in Playarea - Doom on Playermats + + + + + From ed804d58e82ea90c06fe756fac1eec4d6774dc7b Mon Sep 17 00:00:00 2001 From: dscarpac Date: Sat, 31 Aug 2024 18:18:54 -0500 Subject: [PATCH 5/6] removed redundancy --- xml/DoomCounter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/DoomCounter.xml b/xml/DoomCounter.xml index c1f26153..de25da42 100644 --- a/xml/DoomCounter.xml +++ b/xml/DoomCounter.xml @@ -1,6 +1,6 @@ - + From 98f4fee537dfa660bc6eb5623b0b2e0cdf8fc25d Mon Sep 17 00:00:00 2001 From: dscarpac Date: Sat, 31 Aug 2024 19:19:21 -0500 Subject: [PATCH 6/6] added deselect features --- src/playercards/CardsThatSealTokens.ttslua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index 1dd95c98..a07e2891 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -250,6 +250,7 @@ function releaseOneToken(playerColor) putTokenAway(table.remove(sealedTokens)) updateSave() end + Player[playerColor].clearSelectedObjects() end -- release up to multiple tokens at once with no minimum @@ -269,6 +270,7 @@ function releaseMultipleTokens(playerColor) end updateSave() printToColor("Releasing " .. numRemoved .. " tokens", playerColor) + Player[playerColor].clearSelectedObjects() end -- releases all sealed tokens @@ -284,6 +286,7 @@ function releaseAllTokens(playerColor) sealedTokens = {} updateSave() end + Player[playerColor].clearSelectedObjects() end -- returns multiple tokens at once to the token pool @@ -297,6 +300,7 @@ function returnMultipleTokens(playerColor) else printToColor("Not enough tokens sealed.", playerColor) end + Player[playerColor].clearSelectedObjects() end -- returns the token (referenced by GUID) to the chaos bag @@ -328,7 +332,7 @@ function returnToken(guid) end -- resolves sealed token as if it came from the chaos bag -function resolveSealed() +function resolveSealed(playerColor) if #sealedTokens == 0 then broadcastToAll("No tokens sealed.", "Red") return @@ -341,6 +345,7 @@ function resolveSealed() updateStackSize() updateSave() chaosBagApi.drawChaosToken(mat, true, _, guidToBeResolved) + Player[playerColor].clearSelectedObjects() end function updateStackSize()