From 1422c3734473aacaecf059aa4884fd4c5f0032a8 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sun, 27 Oct 2024 23:45:00 +0100 Subject: [PATCH] made ability tokens small --- src/core/UniversalActionAbilityToken.ttslua | 15 ++++++++------- src/playermat/Playermat.ttslua | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/UniversalActionAbilityToken.ttslua b/src/core/UniversalActionAbilityToken.ttslua index 2cc0d08c..200e8eb7 100644 --- a/src/core/UniversalActionAbilityToken.ttslua +++ b/src/core/UniversalActionAbilityToken.ttslua @@ -74,6 +74,7 @@ function onLoad(savedData) end function updateDisplay() + local cleanedSymbol = symbol:gsub("Ability", "") local xml = { -- background on the front { @@ -101,7 +102,7 @@ function updateDisplay() { tag = "Image", attributes = { - image = "Bundle/" .. symbol, + image = "Bundle/" .. cleanedSymbol, height = "200", width = "200", position = "0 0 -10.3", @@ -135,7 +136,7 @@ function updateDisplay() { tag = "Image", attributes = { - image = "Bundle/" .. symbol, + image = "Bundle/" .. cleanedSymbol, color = "#000000", height = "200", width = "200", @@ -146,9 +147,9 @@ function updateDisplay() } -- handling for double symbols - if string.contains(symbol, "/") then + if string.contains(cleanedSymbol, "/") then local symbols = {} - for str in string.gmatch(symbol, "([^/]+)") do + for str in string.gmatch(cleanedSymbol, "([^/]+)") do table.insert(symbols, str) end @@ -183,14 +184,14 @@ function updateDisplay() self.setColorTint(colorsForClasses[class]) -- update name (only show symbol name if it isn't the class name) - if isClassName(symbol) then + if isClassName(cleanedSymbol) then self.setName(class) else - self.setName(class .. " " .. symbol) + self.setName(class .. " " .. cleanedSymbol) end -- update scale - if symbol == "FreeTrigger" or symbol == "Reaction" then + if cleanedSymbol == "FreeTrigger" or cleanedSymbol == "Reaction" or string.contains(symbol, "Ability") then self.setScale({ 0.35, 1, 0.35 }) else self.setScale({ 0.45, 1, 0.45 }) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 76f18f1f..fa96f887 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -1319,7 +1319,6 @@ function maybeUpdateActiveInvestigator(card, md) for str in string.gmatch(md.extraToken, "([^|]+)") do local type = "action" if str == "FreeTrigger" or str == "Reaction" or string.contains(str, "Ability") then - str = str:gsub("Ability", "") type = "ability" end