elem data

This commit is contained in:
phidias authored and GitHub committed 2026-11-11 01:05:04 +09:00
1 parent b3e91220ff
commit 9f6da77b6e
1 file changed
+5 -2
+5 -2
View File
@@ -213,7 +213,7 @@ end
--- Dropdown listing the interfaces of the selected type by position
--- @class ExpGui_Vlayer.elements.interface_dropdown: ExpElement
--- @overload fun(parent: LuaGuiElement): LuaGuiElement
--- @overload fun(parent: LuaGuiElement, controls: LuaGuiElement): LuaGuiElement
Elements.interface_dropdown = Gui.define("vlayer/interface_dropdown")
:draw{
type = "drop-down",
@@ -221,6 +221,9 @@ Elements.interface_dropdown = Gui.define("vlayer/interface_dropdown")
:style{
width = 200,
}
:element_data{
controls = Gui.from_argument(1),
}
:on_selection_state_changed(function(def, _, interface_dropdown)
--- @cast def ExpGui_Vlayer.elements.interface_dropdown
local controls = def.data[interface_dropdown].controls
@@ -322,7 +325,7 @@ Elements.controls = Gui.define("vlayer/controls")
local can_edit = Roles.player_has_permission(player, "exp_scenario.gui.vlayer_edit")
local type_dropdown = Elements.type_dropdown(controls, controls)
local interface_dropdown = Elements.interface_dropdown(controls)
local interface_dropdown = Elements.interface_dropdown(controls, controls)
Elements.build_button(controls).visible = can_edit
Elements.remove_button(controls, controls).visible = can_edit