Merge pull request #699 from argonui/client-side

Redraw the playmat slot XML when a player joins
This commit is contained in:
dscarpac 2024-05-26 15:17:53 -05:00 committed by GitHub
commit b635ef1254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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

@ -277,6 +277,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)