expcore.gui.concepts.left module

Gui structure define for left frames [[

Dependencies

expcore.gui.core
expcore.gui.prototype
expcore.gui.concepts.toolbar
expcore.gui.elements.buttons
mod-gui
utils.game
utils.event

Functions

LeftFrames.get_flow(player) Gets the left frame flow for a player
LeftFrames.get_frame(name, player) Gets one frame from the left flow by its name
LeftFrames.get_open(player) Gets all open frames for a player, if non are open it will remove the close all button
LeftFrames.toggle_frame(name, player[, state]) Toggles the visibility of a left frame, or sets its visibility state
LeftFrames.new_frame(permission_name) Creates a new left frame define
LeftFrames._prototype:set_open_by_default([state=true]) Sets if the frame is visible when a player joins, can also be a function to return a boolean
LeftFrames._prototype:set_direction(direction) Sets the direction of the frame, either vertical or horizontal
LeftFrames._prototype:_internal_draw(player) Creates the gui for the first time, used internally
LeftFrames._prototype:get_frame(player) Gets the frame for this define from the left frame flow
LeftFrames._prototype:is_open(player) Returns if the player currently has this define visible
LeftFrames._prototype:toggle(player) Toggles the visibility of the left frame
LeftFrames._prototype:update(player) Updates the contents of the left frame, first tries update callback, other wise will clear and redraw
LeftFrames._prototype:update_all([update_offline=false]) Updates the frame for all players, see update
LeftFrames._prototype:redraw(player) Redraws the frame by calling on_draw, will always clear the frame
LeftFrames._prototype:redraw_all([update_offline=false]) Redraws the frame for all players, see redraw
LeftFrames._prototype:event_handler([action=update]) Creates an event handler that will trigger one of its functions, use with Event.add

Dependencies

# expcore.gui.core
# expcore.gui.prototype
# expcore.gui.concepts.toolbar
# expcore.gui.elements.buttons
# mod-gui
# utils.game
# utils.event

Functions

# LeftFrames.get_flow(player)

Gets the left frame flow for a player

Parameters:
  • player : (LuaPlayer) the player to get the flow of
Returns:
# LeftFrames.get_frame(name, player)

Gets one frame from the left flow by its name

Parameters:
  • name : (string) the name of the gui frame to get
  • player : (LuaPlayer) the player to get the frame of
Returns:
  • (LuaGuiElement) the frame in the left frame flow with that name
# LeftFrames.get_open(player)

Gets all open frames for a player, if non are open it will remove the close all button

Parameters:
  • player : (LuaPlayer) the player to get the flow of
Returns:
  • (table) contains all the open (and registered) frames for the player
# LeftFrames.toggle_frame(name, player[, state])

Toggles the visibility of a left frame, or sets its visibility state

Parameters:
  • name : (string) the name of the gui frame to toggle
  • player : (LuaPlayer) the player to get the frame of
  • state : (boolean) when given will be the state that the visibility is set to (optional)
Returns:
  • (boolean) the new state of the visibility
# LeftFrames.new_frame(permission_name)

Creates a new left frame define

Parameters:
  • permission_name : (string) the name that can be used with the permission system
Returns:
  • (table) the new left frame define
# LeftFrames._prototype:set_open_by_default([state=true])

Sets if the frame is visible when a player joins, can also be a function to return a boolean

Parameters:
  • state : (boolean or function) the default state of the visibility, can be a function state param - player LuaPlayer - the player that has joined the game state param - define_name string - the define name for the frame state return - boolean - false will hide the frame (default: true)
# LeftFrames._prototype:set_direction(direction)

Sets the direction of the frame, either vertical or horizontal

Parameters:
  • direction : (string) the direction to have the elements be added to the frame
# LeftFrames._prototype:_internal_draw(player)

Creates the gui for the first time, used internally

Parameters:
  • player : (LuaPlayer) the player to draw the frame to
Returns:
# LeftFrames._prototype:get_frame(player)

Gets the frame for this define from the left frame flow

Parameters:
  • player : (LuaPlayer) the player to get the frame of
Returns:
  • (LuaGuiElement) the frame in the left frame flow for this define
# LeftFrames._prototype:is_open(player)

Returns if the player currently has this define visible

Parameters:
  • player : (LuaPlayer) the player to get the frame of
Returns:
  • (boolean) true if it is open/visible
# LeftFrames._prototype:toggle(player)

Toggles the visibility of the left frame

Parameters:
  • player : (LuaPlayer) the player to toggle the frame of
Returns:
  • (boolean) the new state of the visibility
# LeftFrames._prototype:update(player)

Updates the contents of the left frame, first tries update callback, other wise will clear and redraw

Parameters:
  • player : (LuaPlayer) the player to update the frame of
# LeftFrames._prototype:update_all([update_offline=false])

Updates the frame for all players, see update

Parameters:
  • update_offline : (boolean) when true will update the frame for offline players (default: false)
# LeftFrames._prototype:redraw(player)

Redraws the frame by calling on_draw, will always clear the frame

Parameters:
  • player : (LuaPlayer) the player to update the frame of
# LeftFrames._prototype:redraw_all([update_offline=false])

Redraws the frame for all players, see redraw

Parameters:
  • update_offline : (boolean) when true will update the frame for offline players (default: false)
# LeftFrames._prototype:event_handler([action=update])

Creates an event handler that will trigger one of its functions, use with Event.add

Parameters:
  • action : (string) the action to take on this event (default: update)