mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 04:21:41 +09:00
Updated docs
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
--[[-- Core Module - ExpStyle
|
||||
@module ExpStyle
|
||||
@core ExpStyle
|
||||
@alias expstyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'flow' --- @dep gui.concept.flow
|
||||
Gui.require_concept 'flow' -- @dep gui.concept.flow
|
||||
|
||||
--[[-- A flow which can be used to align text and other elements
|
||||
@see flow
|
||||
@see Gui.flow
|
||||
@element alignment
|
||||
@usage-- Concept Structure
|
||||
-- Root
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'frame' --- @dep gui.concept.frame
|
||||
Gui.require_concept 'frame' -- @dep gui.concept.frame
|
||||
|
||||
--[[-- A container frame that can be used to add a boader around your content
|
||||
@see frame
|
||||
@see Gui.frame
|
||||
@element container
|
||||
@usage-- Concept Structure
|
||||
-- Root
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'label' --- @dep gui.concept.frame
|
||||
Gui.require_concept 'label' -- @dep gui.concept.frame
|
||||
|
||||
local right_align =
|
||||
Gui.new_concept('alignment')
|
||||
|
||||
--[[-- A label pair which has a static label and a data label which can be changed
|
||||
@see label
|
||||
@see Gui.label
|
||||
@element data_label
|
||||
@usage-- Concept Structure
|
||||
-- Root
|
||||
@@ -64,6 +64,12 @@ end)
|
||||
return data_label_element
|
||||
end)
|
||||
|
||||
--[[-- Updates the caption and tooltip of the data label using the data format function
|
||||
@tparam LuaGuiElement element the data label element that you want to update
|
||||
@tparam any data the data that you want to pass to the format function
|
||||
@usage-- Updating the data to the current game tick
|
||||
data_label:update_data_element(element,game.tick)
|
||||
]]
|
||||
function data_label:update_data_element(element,data,...)
|
||||
local caption, tooltip = self.properties.data_format(self,element,data,...)
|
||||
if caption then
|
||||
@@ -74,6 +80,12 @@ function data_label:update_data_element(element,data,...)
|
||||
end
|
||||
end
|
||||
|
||||
--[[-- Updates the caption and tooltip of the data label using the data format function, given the parent of the data label
|
||||
@tparam LuaGuiElement parent the parent element to the data label element that you want to update
|
||||
@tparam any data the data that you want to pass to the format function
|
||||
@usage-- Updating the data to the current game tick
|
||||
data_label:update_from_parent(parent,game.tick)
|
||||
]]
|
||||
function data_label:update_from_parent(parent,data,...)
|
||||
local properties = self.properties
|
||||
local data_name = properties.data_label_name or properties.name..'_data'
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'frame' --- @dep gui.concept.table
|
||||
Gui.require_concept 'frame' -- @dep gui.concept.table
|
||||
|
||||
local right_align =
|
||||
Gui.new_concept('alignment')
|
||||
|
||||
--[[-- A frame that acts as a footer to a section of content
|
||||
@see frame
|
||||
@see Gui.frame
|
||||
@element footer
|
||||
@tparam string tooltip the tooltip to show on the title
|
||||
@usage-- Concept Structure
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'frame' --- @dep gui.concept.table
|
||||
Gui.require_concept 'frame' -- @dep gui.concept.table
|
||||
|
||||
local right_align =
|
||||
Gui.new_concept('alignment')
|
||||
|
||||
--[[-- A frame that acts as a header to a section of content
|
||||
@see frame
|
||||
@see Gui.frame
|
||||
@element header
|
||||
@tparam string tooltip the tooltip to show on the title
|
||||
@usage-- Concept Structure
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
--[[-- Core Module - ExpStyle
|
||||
@core ExpStyle
|
||||
@module ExpStyle
|
||||
@alias expstyle
|
||||
]]
|
||||
|
||||
--- @dep expcore.gui
|
||||
|
||||
--- @dep gui.concept.frame
|
||||
|
||||
--- @dep gui.concept.flow
|
||||
|
||||
--- @dep gui.concept.table
|
||||
|
||||
--- @dep gui.concept.scroll
|
||||
|
||||
local function r(name)
|
||||
require('expcore.gui.styles.expstyle.'..name)
|
||||
end
|
||||
@@ -9,5 +20,9 @@ end
|
||||
r 'container'
|
||||
r 'alignment'
|
||||
r 'header'
|
||||
r 'footer'
|
||||
r 'scroll_table'
|
||||
r 'time_label'
|
||||
r 'time_label'
|
||||
r 'data_label'
|
||||
r 'unit_label'
|
||||
r 'toggle_button'
|
||||
@@ -2,10 +2,10 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'table' --- @dep gui.concept.table
|
||||
Gui.require_concept 'scroll' --- @dep gui.concept.scroll
|
||||
Gui.require_concept 'table' -- @dep gui.concept.table
|
||||
Gui.require_concept 'scroll' -- @dep gui.concept.scroll
|
||||
|
||||
local scroll_area =
|
||||
Gui.new_concept('scroll')
|
||||
@@ -13,7 +13,7 @@ Gui.new_concept('scroll')
|
||||
:set_horizontal_scroll('never')
|
||||
|
||||
--[[-- A table that is inside a vertical scroll area
|
||||
@see table
|
||||
@see Gui.table
|
||||
@element scroll_table
|
||||
@tparam number hight the max hight of the scroll area
|
||||
@usage-- Concept Structure
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
local format_time = ext_require('expcore.common','format_time') --- @dep expcore.common
|
||||
|
||||
--- Converts a tick into string format with workds and symbols
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'button' --- @dep gui.concept.table
|
||||
Gui.require_concept 'button' -- @dep gui.concept.table
|
||||
|
||||
--[[-- A button that will toggle its caption each time it is pressed
|
||||
@see button
|
||||
@see Gui.button
|
||||
@element toggle_button
|
||||
@tparam string alt_caption the caption to show on the button in its true state
|
||||
@tparam string alt_tooltip the tooltip to show on the button in its true state
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
@module ExpStyle
|
||||
]]
|
||||
|
||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||
local Gui = require 'expcore.gui' -- @dep expcore.gui
|
||||
|
||||
Gui.require_concept 'label' --- @dep gui.concept.frame
|
||||
Gui.require_concept 'label' -- @dep gui.concept.frame
|
||||
|
||||
local right_align =
|
||||
Gui.new_concept('alignment')
|
||||
|
||||
--[[-- A label triplet which has a static label, a data label which can be changed, and a unit label
|
||||
@see label
|
||||
@see Gui.label
|
||||
@see data_label
|
||||
@element unit_label
|
||||
@usage-- Concept Structure
|
||||
@@ -60,6 +60,12 @@ end)
|
||||
return element
|
||||
end)
|
||||
|
||||
--[[-- Updates the caption and tooltip and unit of the data label using the data format function
|
||||
@tparam LuaGuiElement element the unit label element that you want to update
|
||||
@tparam any data the data that you want to pass to the format function
|
||||
@usage-- Updating the data to the current game tick
|
||||
unit_label:update_data_element(element,game.tick)
|
||||
]]
|
||||
function unit_label:update_data_element(element,data,...)
|
||||
local caption, unit, tooltip = self.properties.data_format(self,element,data,...)
|
||||
local unit_element = element.parent.parent[element.name..'_unit']
|
||||
@@ -75,6 +81,12 @@ function unit_label:update_data_element(element,data,...)
|
||||
end
|
||||
end
|
||||
|
||||
--[[-- Updates the caption and tooltip and unit of the unit label using the data format function, given the parent of the unit label
|
||||
@tparam LuaGuiElement parent the parent element to the unit label element that you want to update
|
||||
@tparam any data the data that you want to pass to the format function
|
||||
@usage-- Updating the data to the current game tick
|
||||
unit_label:update_from_parent(parent,game.tick)
|
||||
]]
|
||||
function unit_label:update_from_parent(parent,data,...)
|
||||
local properties = self.properties
|
||||
local data_name = properties.data_label_name or properties.name..'_data'
|
||||
|
||||
Reference in New Issue
Block a user