No more warnings

This commit is contained in:
Cooldude2606
2024-09-28 03:46:14 +01:00
parent 32a8ba8f3a
commit 3145f7e904
43 changed files with 215 additions and 177 deletions

View File

@@ -133,10 +133,10 @@ local Event = _C.opt_require("modules/exp_legacy/utils/event")
if Roles and Event then
Event.add(Roles.events.on_role_assigned, function(e)
Gui.update_top_flow(game.get_player(e.player_index))
Gui.update_top_flow(game.players[e.player_index])
end)
Event.add(Roles.events.on_role_unassigned, function(e)
Gui.update_top_flow(game.get_player(e.player_index))
Gui.update_top_flow(game.players[e.player_index])
end)
end

View File

@@ -226,6 +226,7 @@ function Gui._prototype_element:triggers_events(element)
element.tags = { ExpGui_event_triggers = { self.uid } }
return element
elseif not tags.ExpGui_event_triggers then
--- @diagnostic disable-next-line: name-style-check
tags.ExpGui_event_triggers = { self.uid }
elseif table.array_contains(tags.ExpGui_event_triggers, self.uid) then
error("Element::triggers_events called multiple times on the same element with the same definition")