made ability tokens small

This commit is contained in:
Chr1Z93 2024-10-27 23:45:00 +01:00
parent 7cc6a0d14f
commit 1422c37344
2 changed files with 8 additions and 8 deletions

View File

@ -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 })

View File

@ -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