mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Renamed Gui.event to Gui.custom_event
This commit is contained in:
@@ -72,7 +72,7 @@ function Gui.left_toolbar_button(sprite,tooltip,element_define,authenticator)
|
||||
-- Raise custom event that tells listening elements if the element has changed visibility by a player clicking
|
||||
-- Used in warp gui to handle the keep open logic
|
||||
button:raise_custom_event{
|
||||
name = Gui.events.on_visibility_changed_by_click,
|
||||
name = Gui.custom_events.on_visibility_changed_by_click,
|
||||
element = element,
|
||||
state = visibility_state
|
||||
}
|
||||
@@ -168,7 +168,7 @@ function Gui.hide_left_flow(player)
|
||||
local button_define = Gui.defines[element_define.toolbar_button]
|
||||
-- Raise the custom event if all of the top checks have passed
|
||||
button_define:raise_custom_event{
|
||||
name = Gui.events.on_visibility_changed_by_click,
|
||||
name = Gui.custom_events.on_visibility_changed_by_click,
|
||||
element = button,
|
||||
state = false
|
||||
}
|
||||
|
||||
@@ -350,9 +350,9 @@ Gui._prototype_element.on_text_changed = event_handler_factory(defines.events.on
|
||||
-- @tparam function handler the event handler which will be called
|
||||
Gui._prototype_element.on_value_changed = event_handler_factory(defines.events.on_gui_value_changed)
|
||||
|
||||
--- Element Events.
|
||||
--- Custom element events.
|
||||
-- @section customEvents
|
||||
Gui.events = {
|
||||
Gui.custom_event = {
|
||||
-- Triggered when a user changed the visibility of a left flow element by clicking a button
|
||||
on_visibility_changed_by_click = 'on_visibility_changed_by_click'
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ end)
|
||||
Gui.left_toolbar_button('item/'..config.default_icon,{'warp-list.main-tooltip',config.standard_proximity_radius},warp_list_container, function(player)
|
||||
return Roles.player_allowed(player,'gui/warp-list')
|
||||
end)
|
||||
:on_custom_event(Gui.events.on_visibility_changed_by_click, function(player,_,event)
|
||||
:on_custom_event(Gui.custom_events.on_visibility_changed_by_click, function(player,_,event)
|
||||
local state = event.state -- true if visible, false if invisible
|
||||
-- Set gui keep open state for player that clicked the button
|
||||
keep_gui_open[player.name] = state
|
||||
|
||||
Reference in New Issue
Block a user