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:
@@ -350,7 +350,7 @@ local function move_toolbar_button(player, item, offset)
|
||||
|
||||
-- Swap the position in the list
|
||||
local list = assert(item.parent)
|
||||
local other_item = list.children[new_index]
|
||||
local other_item = assert(list.children[new_index])
|
||||
list.swap_children(old_index, new_index)
|
||||
|
||||
-- Swap the position in the top flow, offset by 1 because of settings button
|
||||
@@ -499,7 +499,8 @@ function Toolbar._create_elements(player)
|
||||
-- Reset the state of the previous last child
|
||||
local children = toolbar_list.children
|
||||
if previous_last_index > 0 then
|
||||
elements.toolbar_list_item.data[children[previous_last_index]].move_item_down.enabled = true
|
||||
local previous_last = assert(children[previous_last_index])
|
||||
elements.toolbar_list_item.data[previous_last].move_item_down.enabled = true
|
||||
end
|
||||
|
||||
-- Set the state of the move buttons for the first and last element
|
||||
|
||||
Reference in New Issue
Block a user