mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Fix gui element registration and iter removal
The top, left and relative element tables are keyed by the define, but the duplicate registration assert looked up `define.name`, so it never fired. GuiIter.remove_element indexed `registered_scopes` by player index instead of the scope elements it had just fetched, so it removed nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,7 @@ end
|
||||
--- @param define ExpElement
|
||||
--- @param visible Gui.VisibleCallback | boolean | nil
|
||||
function Gui.add_top_element(define, visible)
|
||||
assert(Gui.top_elements[define.name] == nil, "Element is already added to the top flow")
|
||||
assert(Gui.top_elements[define] == nil, "Element is already added to the top flow")
|
||||
Gui.top_elements[define] = visible or false
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ end
|
||||
--- @param define ExpElement
|
||||
--- @param visible Gui.VisibleCallback | boolean | nil
|
||||
function Gui.add_left_element(define, visible)
|
||||
assert(Gui.left_elements[define.name] == nil, "Element is already added to the left flow")
|
||||
assert(Gui.left_elements[define] == nil, "Element is already added to the left flow")
|
||||
Gui.left_elements[define] = visible or false
|
||||
|
||||
end
|
||||
@@ -105,7 +105,7 @@ end
|
||||
--- @param define ExpElement
|
||||
--- @param visible Gui.VisibleCallback | boolean | nil
|
||||
function Gui.add_relative_element(define, visible)
|
||||
assert(Gui.relative_elements[define.name] == nil, "Element is already added to the relative flow")
|
||||
assert(Gui.relative_elements[define] == nil, "Element is already added to the relative flow")
|
||||
Gui.relative_elements[define] = visible or false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user