This commit is contained in:
Cooldude2606
2019-07-22 17:53:13 +01:00
parent 0499ad35ab
commit 57b1c530bf
85 changed files with 4024 additions and 381 deletions

View File

@@ -1,4 +1,9 @@
--- Gui left frame define for a player list
--[[-- Gui Module - Player List
- Adds a player list to show names and play time; also includes action buttons which can apply to players
@gui Player-List
@alias player_list
]]
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Roles = require 'expcore.roles' --- @dep expcore.roles
local Store = require 'expcore.store' --- @dep expcore.store
@@ -33,6 +38,7 @@ Gui.on_click(zoom_to_map_name,function(event)
end)
--- Button used to open the action bar
-- @element open_action_bar
local open_action_bar =
Gui.new_button()
:set_sprites('utility/expand_dots_white')
@@ -56,6 +62,7 @@ end)
end)
--- Button used to close the action bar
-- @element close_action_bar
local close_action_bar =
Gui.new_button()
:set_sprites('utility/close_black','utility/close_white')
@@ -71,6 +78,7 @@ end)
end)
--- Button used to confirm a reason
-- @element reason_confirm
local reason_confirm =
Gui.new_button()
:set_sprites('utility/confirm_slot')
@@ -267,6 +275,7 @@ local function add_fake_players(list_table,count)
end
--- Registers the player list
-- @element player_list
local player_list =
Gui.new_left_frame('gui/player-list')
:set_sprites('entity/character')

View File

@@ -1,4 +1,9 @@
--- Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets
--[[-- Gui Module - Rocket Info
- Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets
@gui Rocket-Info
@alias rocket_info
]]
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Roles = require 'expcore.roles' --- @dep expcore.roles
local Event = require 'utils.event' --- @dep utils.event
@@ -25,6 +30,7 @@ local function player_allowed(player,action)
end
--- Used on the name label to allow zoom to map
-- @element zoom_to_map
local zoom_to_map_name = Gui.uid_name()
Gui.on_click(zoom_to_map_name,function(event)
local rocket_silo_name = event.element.parent.caption
@@ -33,6 +39,7 @@ Gui.on_click(zoom_to_map_name,function(event)
end)
--- Used to launch the rocket, when it is ready
-- @element launch_rocket
local launch_rocket =
Gui.new_button()
:set_sprites('utility/center')
@@ -60,6 +67,7 @@ end)
end)
--- Used to toggle the auto launch on a rocket
-- @element toggle_rocket
local toggle_rocket =
Gui.new_button()
:set_sprites('utility/play')
@@ -87,6 +95,7 @@ end)
end)
--- Used to toggle the visibility of the different sections
-- @element toggle_section
local toggle_section =
Gui.new_button()
:set_sprites('utility/expand_dark','utility/expand')
@@ -112,7 +121,7 @@ end)
--- Used to create the three different sections
local function create_section(container,section_name,table_size)
--- Header for the section
-- Header for the section
local header_area = Gui.create_header(
container,
{'rocket-info.section-caption-'..section_name},
@@ -121,11 +130,11 @@ local function create_section(container,section_name,table_size)
section_name..'-header'
)
--- Right aligned button to toggle the section
-- Right aligned button to toggle the section
header_area.caption = section_name
toggle_section(header_area)
--- Table used to store the data
-- Table used to store the data
local flow_table = Gui.create_scroll_table(container,table_size,215,section_name)
flow_table.parent.visible = false
@@ -437,7 +446,8 @@ local function generate_progress(player,frame)
end
end
--- Registers the new left gui
--- Registers the rocket info
-- @element rocket_info
local rocket_info =
Gui.new_left_frame('gui/rocket-info')
:set_sprites('entity/rocket-silo')

View File

@@ -1,4 +1,9 @@
--- Adds a science info gui that shows production usage and net for the different science packs as well as an eta
--[[-- Gui Module - Science Info
- Adds a science info gui that shows production usage and net for the different science packs as well as an eta
@gui Science-Info
@alias science_info
]]
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Event = require 'utils.event' --- @dep utils.event
local format_time = ext_require('expcore.common','format_time') --- @dep expcore.common
@@ -248,7 +253,8 @@ local function update_eta(player,element)
end
end
--- Registerse the new science info gui
--- Registers the science info
-- @element science_info
local science_info =
Gui.new_left_frame('gui/science-info')
:set_sprites('entity/lab')

View File

@@ -1,4 +1,9 @@
--- Adds a task list to the game which players can add remove and edit items on
--[[-- Gui Module - Task List
- Adds a task list to the game which players can add remove and edit items on
@gui Task-List
@alias task_list
]]
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Event = require 'utils.event' --- @dep utils.event
local Roles = require 'expcore.roles' --- @dep expcore.roles
@@ -31,6 +36,7 @@ local function player_allowed_edit(player,task_id)
end
--- Button in the header to add a new task
-- @element add_new_task
local update_all
local add_new_task =
Gui.new_button()
@@ -46,6 +52,7 @@ end)
end)
--- Used to save changes to a task
-- @element confirm_edit
local confirm_edit =
Gui.new_button()
:set_sprites('utility/downloaded')
@@ -63,6 +70,7 @@ end)
end)
--- Used to cancel any changes you made to a task
-- @element cancel_edit
local generate_task
local cancel_edit =
Gui.new_button()
@@ -80,6 +88,7 @@ end)
end)
--- Removes the task from the list
-- @element discard_task
local discard_task =
Gui.new_button()
:set_sprites('utility/trash')
@@ -96,6 +105,7 @@ end)
end)
--- Opens edit mode for the task
-- @element edit_task
local edit_task =
Gui.new_button()
:set_sprites('utility/rename_icon_normal')
@@ -292,6 +302,7 @@ local function generate_container(player,element)
end
--- Registers the task list
-- @element task_list
local task_list =
Gui.new_left_frame('gui/task-list')
:set_sprites('utility/not_enough_repair_packs_icon')

View File

@@ -1,3 +1,9 @@
--[[-- Gui Module - Warp List
- Adds a warp list gui which allows players to add and remove warp points
@gui Warps-List
@alias warp_list
]]
local Gui = require 'expcore.gui' --- @dep expcore.gui
local Store = require 'expcore.store' --- @dep expcore.store
local Global = require 'utils.global' --- @dep utils.global
@@ -10,7 +16,6 @@ local format_time,table_keys = ext_require('expcore.common','format_time','table
local Warps = require 'modules.control.warps' --- @dep modules.control.warps
local warp_player_in_range_store = 'gui.left.warps.in_range'
local warp_list
local keep_open = {}
Global.register(keep_open,function(tbl)
@@ -46,6 +51,7 @@ local function player_allowed_edit(player,warp_id)
end
--- Used on the name label to allow zoom to map
-- @element zoom_to_map
local zoom_to_map_name = Gui.uid_name()
Gui.on_click(zoom_to_map_name,function(event)
local warp_id = event.element.parent.name
@@ -56,6 +62,7 @@ end)
--- This timer controls when a player is able to warp, eg every 60 seconds
-- @element warp_timer
local warp_timer =
Gui.new_progressbar()
:set_tooltip{'warp-list.timer-tooltip',config.recharge_time}
@@ -72,6 +79,7 @@ end)
end)
--- When the button is clicked it will teleport the player
-- @element goto_warp
local goto_warp =
Gui.new_button()
:set_sprites('item/'..config.default_icon)
@@ -93,6 +101,7 @@ end)
end)
--- Will add a new warp to the list, checks if the player is too close to an existing one
-- @element add_new_warp
local add_new_warp =
Gui.new_button()
:set_sprites('utility/add')
@@ -122,6 +131,7 @@ end)
end)
--- Confirms the edit to name or icon of the warp
-- @element confirm_edit
local confirm_edit =
Gui.new_button()
:set_sprites('utility/downloaded')
@@ -140,6 +150,7 @@ end)
end)
--- Cancels the editing changes of the selected warp name or icon
-- @element cancel_edit
local generate_warp
local cancel_edit =
Gui.new_button()
@@ -157,6 +168,7 @@ end)
end)
--- Removes a warp from the list, including the physical area and map tag
-- @element discard_warp
local discard_warp =
Gui.new_button()
:set_sprites('utility/trash')
@@ -172,6 +184,7 @@ end)
end)
--- Opens edit mode for the warp
-- @element edit_warp
local edit_warp =
Gui.new_button()
:set_sprites('utility/rename_icon_normal')
@@ -391,7 +404,8 @@ local function generate_container(player,element)
end
--- Registers the warp list
warp_list =
-- @element warp_list
local warp_list =
Gui.new_left_frame('gui/warp-list')
:set_sprites('item/'..config.default_icon)
:set_tooltip{'warp-list.main-tooltip',config.activation_range}