redraw the slot XML when a player joins

This commit is contained in:
Chr1Z93 2024-05-25 11:44:46 +02:00
parent 831a4fd4c9
commit 326b021b4a
2 changed files with 13 additions and 0 deletions

View File

@ -222,6 +222,11 @@ function onObjectNumberTyped(hoveredObject, playerColor, number)
end
end
-- TTS event, used to redraw the playmat slot symbols after a small delay to account for the custom font loading
function onPlayerConnect()
Wait.time(function() playmatApi.redrawSlotSymbols("All") end, 0.2)
end
---------------------------------------------------------
-- chaos token drawing
---------------------------------------------------------

View File

@ -258,6 +258,14 @@ do
end
end
-- Redraws the XML for the slot symbols based on the slotData table
---@param matColor string Color of the playmat - White, Orange, Green, Red or All
PlaymatApi.redrawSlotSymbols = function(matColor)
for _, mat in pairs(getMatForColor(matColor)) do
mat.call("redrawSlotSymbols")
end
end
-- Finds all objects on the playmat and associated set aside zone and returns a table
---@param matColor string Color of the playmat - White, Orange, Green, Red or All
---@param filter string Name of the filte function (see util/SearchLib)