mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-21 15:33:12 +09:00
elem data
This commit is contained in:
1 parent
b3e91220ff
commit
9f6da77b6e
1 file changed
+5
-2
@@ -213,7 +213,7 @@ end
|
|||||||
|
|
||||||
--- Dropdown listing the interfaces of the selected type by position
|
--- Dropdown listing the interfaces of the selected type by position
|
||||||
--- @class ExpGui_Vlayer.elements.interface_dropdown: ExpElement
|
--- @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")
|
Elements.interface_dropdown = Gui.define("vlayer/interface_dropdown")
|
||||||
:draw{
|
:draw{
|
||||||
type = "drop-down",
|
type = "drop-down",
|
||||||
@@ -221,6 +221,9 @@ Elements.interface_dropdown = Gui.define("vlayer/interface_dropdown")
|
|||||||
:style{
|
:style{
|
||||||
width = 200,
|
width = 200,
|
||||||
}
|
}
|
||||||
|
:element_data{
|
||||||
|
controls = Gui.from_argument(1),
|
||||||
|
}
|
||||||
:on_selection_state_changed(function(def, _, interface_dropdown)
|
:on_selection_state_changed(function(def, _, interface_dropdown)
|
||||||
--- @cast def ExpGui_Vlayer.elements.interface_dropdown
|
--- @cast def ExpGui_Vlayer.elements.interface_dropdown
|
||||||
local controls = def.data[interface_dropdown].controls
|
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 can_edit = Roles.player_has_permission(player, "exp_scenario.gui.vlayer_edit")
|
||||||
|
|
||||||
local type_dropdown = Elements.type_dropdown(controls, controls)
|
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.build_button(controls).visible = can_edit
|
||||||
Elements.remove_button(controls, controls).visible = can_edit
|
Elements.remove_button(controls, controls).visible = can_edit
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user