mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 04:06:39 +09:00
Migrate gui modules
This commit is contained in:
@@ -29,7 +29,8 @@ Gui.element{
|
||||
type = 'sprite-button',
|
||||
sprite = 'utility/expand_dots_white',
|
||||
tooltip = {'player-list.open-action-bar'},
|
||||
style = 'frame_button'
|
||||
style = 'frame_button',
|
||||
name = Gui.unique_static_name
|
||||
}
|
||||
:style{
|
||||
padding = -2,
|
||||
@@ -85,21 +86,21 @@ end)
|
||||
--- Set of elements that are used to make up a row of the player table
|
||||
-- @element add_player_base
|
||||
local add_player_base =
|
||||
Gui.element(function(event_trigger, parent, player_data)
|
||||
Gui.element(function(definition, parent, player_data)
|
||||
-- Add the button to open the action bar
|
||||
local toggle_action_bar_flow = parent.add{ type = 'flow', name = player_data.name }
|
||||
open_action_bar(toggle_action_bar_flow)
|
||||
|
||||
-- Add the player name
|
||||
local player_name_flow = parent.add{ type = 'flow', name = 'player-name-'..player_data.index }
|
||||
local player_name = player_name_flow.add{
|
||||
local player_name = parent.add{
|
||||
type = 'label',
|
||||
name = event_trigger,
|
||||
name = 'player-name-'..player_data.index,
|
||||
caption = player_data.name,
|
||||
tooltip = {'player-list.open-map', player_data.name, player_data.tag, player_data.role_name}
|
||||
}
|
||||
player_name.style.padding = {0, 2,0, 0}
|
||||
player_name.style.font_color = player_data.chat_color
|
||||
definition:triggers_events(player_name)
|
||||
|
||||
-- Add the time played label
|
||||
local alignment = Gui.alignment(parent, 'player-time-'..player_data.index)
|
||||
@@ -202,9 +203,9 @@ end
|
||||
--- Main player list container for the left flow
|
||||
-- @element player_list_container
|
||||
local player_list_container =
|
||||
Gui.element(function(event_trigger, parent)
|
||||
Gui.element(function(definition, parent)
|
||||
-- Draw the internal container
|
||||
local container = Gui.container(parent, event_trigger, 200)
|
||||
local container = Gui.container(parent, definition.name, 200)
|
||||
|
||||
-- Draw the scroll table for the players
|
||||
local scroll_table = Gui.scroll_table(container, 184, 3)
|
||||
@@ -255,6 +256,7 @@ Gui.element(function(event_trigger, parent)
|
||||
-- Return the exteral container
|
||||
return container.parent
|
||||
end)
|
||||
:static_name(Gui.unique_static_name)
|
||||
:add_to_left_flow(true)
|
||||
|
||||
--- Button on the top flow used to toggle the player list container
|
||||
|
||||
Reference in New Issue
Block a user