diff --git a/README.md b/README.md index 2c9d02e7..8ff71f05 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Explosive Gaming (often ExpGaming) is a server hosting community with a strong f ## Contributing -All are welcome to make pull requests and issues for this scenario, if you are in any doubt please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. Please keep in mind while making code changes: +All are welcome to make pull requests and issues for this scenario, if you are in any doubt please ask someone in our [discord]. If you do not know lua and don't feel like learning you can always make a [feature request]. All our docs can be found [here][docs]. Please keep in mind while making code changes: * New features should have the branch names: `feature/feature-name` * New features are merged into `dev` after it has been completed. @@ -111,6 +111,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i The Explosive Gaming codebase is licensed under the [GNU General Public License v3.0](LICENSE) +[docs]: https://explosivegaming.github.io/scenario/ [issues]: https://github.com/explosivegaming/scenario/issues/new/choose [website]: https://explosivegaming.nl [discord]: https://discord.explosivegaming.nl diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index 0b56fc11..17a11fd8 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -348,7 +348,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html index 75114dcc..ec447b0d 100644 --- a/docs/addons/Chat-Popups.html +++ b/docs/addons/Chat-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index be18394a..227a2701 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index 3ad91922..dc49b78b 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index 42cd4094..c5d5f078 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 01b1f797..71cc9bde 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index cce518e8..27d0af48 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -460,7 +460,7 @@ generated by LDoc diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html index d17bb676..7d67adeb 100644 --- a/docs/addons/Player-Colours.html +++ b/docs/addons/Player-Colours.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index bfc08f0d..d488a111 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index 09d37fe9..55bea826 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index 3ba5ee0d..13dfba39 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -376,7 +376,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index e8b3303d..731be00d 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html index 4b41076e..d49279c2 100644 --- a/docs/commands/Bonus.html +++ b/docs/commands/Bonus.html @@ -500,7 +500,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index cb0d0a09..accc40eb 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -361,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index 27f45940..e20883e3 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index e2f78d24..af847b74 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -365,7 +365,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index c727cd0e..fc61f8cf 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index d5178346..c5d73042 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -404,7 +404,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index a1ba8bce..05da9559 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -458,7 +458,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index c38850c0..bc2e0590 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index 2f087f4c..6ff4802e 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -611,7 +611,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index 33cd787e..a16c18b0 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index ee42acca..2f8cb3f4 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -360,7 +360,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index b7f2a851..83127954 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index 19e506ca..dfc8fde0 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -321,7 +321,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index c0f17772..bb852d95 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -585,7 +585,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index d9a1f285..338a0c5e 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -557,7 +557,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index bb58d8a9..9eba8a8f 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html index 43fab495..b8609e4a 100644 --- a/docs/commands/Tag.html +++ b/docs/commands/Tag.html @@ -443,7 +443,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index 42089cc1..eeed3aa0 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -484,7 +484,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index 0bb7d855..337f8b93 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -569,7 +569,7 @@ generated by LDoc diff --git a/docs/config.ld b/docs/config.ld index f5a7a308..d3b5fe24 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -1,5 +1,5 @@ file = '../' -dir = '../doc' +dir = '../docs' project = 'ExpGaming Scenario' title = 'ExpGaming Scenario' description = 'Explosive Gaming\'s server scenario for 0.17' @@ -10,8 +10,8 @@ not_luadoc = true no_lua_ref = true template_escape = ">" topics = {"../README.md", "../LICENSE"} -style = '../doc' -template = '../doc' +style = '../docs' +template = '../docs' no_space_before_args = true merge=true @@ -23,8 +23,8 @@ new_type("gui", "Guis", true) new_type("config", "Configs", true, "Settings") new_type("dep", "Dependencies", false) -new_type("element", "Elements", false) new_type("setting", "Settings", false) +new_type("element", "Elements", false, "Properties / Events") new_type("event", "Events", false, "Event Parameters") new_type("command", "Commands", false, "Command Parameters") diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index 46ef69a1..72c02f54 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -506,7 +506,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index e1806bce..31d8e33c 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index c8ef6dfa..da119978 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -485,7 +485,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index ffc290aa..fa578e05 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -294,7 +294,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index 1f3c18d9..2e83f8aa 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -320,7 +320,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index f68dc361..e908fa8c 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index d18424fa..3206b122 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 2f413722..14f65272 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -338,7 +338,7 @@ see ./expcore/commands.lua for more details

generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 5bf4b1ba..2d0f47b4 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index 76aec8f5..f03d13cd 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -416,7 +416,7 @@ generated by LDoc diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index 03ca2c6d..e7cc6d8b 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -237,7 +237,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index 58c755b1..25d76c3b 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -240,7 +240,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index 7043ae72..5798d322 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -295,7 +295,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index c6e1c748..28764dd5 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -812,7 +812,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index 9eb9892f..3f407af5 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index 39690dd2..e217cb89 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index 9d37a9a8..6ded0dd1 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -324,7 +324,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index 8625da88..04430dd7 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -414,7 +414,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index 9be2580d..2a142796 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -834,7 +834,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index c1aebec6..3fbacb0e 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -292,7 +292,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index d279267e..873dbf53 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index 508bde53..5f2f2131 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -388,7 +388,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index 9b9a9a5a..ebefadb6 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -744,7 +744,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index 6072ae03..2ea51a33 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -384,7 +384,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index f3edf5aa..1971da7d 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index 8800c822..c90c3b4f 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -684,7 +684,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index 5f68c34b..8b2073fa 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -1208,7 +1208,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index ccfd8f5f..cfc5135f 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -1329,7 +1329,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index ddcdfb3e..02a29320 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -1110,7 +1110,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 431f9815..4cd079d7 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -984,7 +984,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index 7fa706cc..0a82275c 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -1039,7 +1039,7 @@ generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index c1ac81e7..cca92779 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -1465,7 +1465,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index 5fa18a14..4af6171d 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -1413,7 +1413,7 @@ generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 683bf908..b6e82a2c 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -1972,7 +1972,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index 44c6136e..ee9e8780 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -357,6 +357,22 @@ format_chat_player_name(player[, raw_string=false]) Returns the players name in the players color + + get_file_path([offset=0]) + Returns a desync safe file path for the current file + + + array_insert(tbl[, start_index], values) + Much faster method for inserting items into an array + + + table_insert(tbl[, start_index], tbl2) + Much faster method for inserting keys into a table + + + resolve_value(value) + Used to resolve a value that could also be a function returning that value + @@ -2402,6 +2418,318 @@ + +
+
+
+ # + get_file_path([offset=0]) +
+
+
+
+ +

Returns a desync safe file path for the current file

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + + +
+
+
+
+ # + array_insert(tbl[, start_index], values) +
+
+
+
+ +

Much faster method for inserting items into an array

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Adding 1000 values into the middle of the array
+local tbl = {}
+local values = {}
+for i = 1,1000 do tbl[i] = i values[i] = i end
+Common.array_insert(tbl,500,values) -- around 0.4ms
+ + +
+
+
+
+ # + table_insert(tbl[, start_index], tbl2) +
+
+
+
+ +

Much faster method for inserting keys into a table

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Merging two tables
+local tbl = {}
+local tbl2 = {}
+for i = 1,100 do tbl[i] = i tbl['_'..i] = i tbl2[i] = i tbl2['__'..i] = i end
+Common.table_insert(tbl,50,tbl2)
+ + +
+
+
+
+ # + resolve_value(value) +
+
+
+
+ +

Used to resolve a value that could also be a function returning that value

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Default value handling
+-- if default value is not a function then it is returned
+-- if it is a function then it is called with the first argument being self
+local value = Common.resolve_value(self.defaut_value,self)
+ +
@@ -2418,7 +2746,7 @@ generated by LDoc diff --git a/docs/core/ExpStyle.html b/docs/core/ExpStyle.html new file mode 100644 index 00000000..f0baf989 --- /dev/null +++ b/docs/core/ExpStyle.html @@ -0,0 +1,1366 @@ + + + + + + + + ExpStyle core + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

ExpStyle core

+

Core Module - ExpStyle

+

+ + + + + + + + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + + + +
expcore.gui
gui.concept.frame
gui.concept.flow
gui.concept.table
gui.concept.scroll
expcore.common
+ + +

Elements

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
alignmentA flow which can be used to align text and other elements
containerA container frame that can be used to add a boader around your content
data_labelA label pair which has a static label and a data label which can be changed
footerA frame that acts as a footer to a section of content
headerA frame that acts as a header to a section of content
scroll_tableA table that is inside a vertical scroll area
time_labelA label that show time in a nice, user friendly way
toggle_buttonA button that will toggle its caption each time it is pressed
unit_labelA label triplet which has a static label, a data label which can be changed, and a unit label
+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + +
data_label:update_data_element(element, data)Updates the caption and tooltip of the data label using the data format function
data_label:update_from_parent(parent, data)Updates the caption and tooltip of the data label using the data format function, given the parent of the data label
time_label:update_time(element, time)Updates the time that is on a label
unit_label:update_data_element(element, data)Updates the caption and tooltip and unit of the data label using the data format function
unit_label:update_from_parent(parent, data)Updates the caption and tooltip and unit of the unit label using the data format function, given the parent of the unit label
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.frame +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.flow +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.table +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.scroll +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.common +
+
+
+
+ + + + + + + + + + + + + + + +
+
+

Elements

+
+
+
+
+ # + alignment +
+
+
+
+ +

A flow which can be used to align text and other elements

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [alignment] - the alignment area
+Gui.new_concept('alignment')
+:set_horizontal_align('center')
+ + +
+
+
+
+ # + container +
+
+
+
+ +

A container frame that can be used to add a boader around your content

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [container] - the outer frame
+-->> container - the content area
+Gui.new_concept('container')
+ + +
+
+
+
+ # + data_label +
+
+
+
+ +

A label pair which has a static label and a data label which can be changed

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [data_label] - the static label
+--> [properties.data_name] - the data label which can be updated
+Gui.new_concept('data_label')
+:set_data_label_name('game_ticks')
+:set_data_caption('0')
+:set_data_format(function(concept,element,data,...)
+    -- This is used with update_data_element and update_from_parent
+    local caption = tostirng('data')
+    local tooltip = 'This game has beeing running for: '..caption..' ticks'
+    return caption, tooltip
+end)
+ + +
+
+
+
+ # + footer +
+
+
+
+ +

A frame that acts as a footer to a section of content

+

+ + + Properties / Events: + +
    + + + + + +
  • + + tooltip + + : + + (string) + + the tooltip to show on the title + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [footer] - the footer frame
+-->> footer_caption - the lable with the title in it
+-->> footer_content - the area to contain butons
+Gui.new_concept('footer')
+:set_title('Example Footer')
+ + +
+
+
+
+ # + header +
+
+
+
+ +

A frame that acts as a header to a section of content

+

+ + + Properties / Events: + +
    + + + + + +
  • + + tooltip + + : + + (string) + + the tooltip to show on the title + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [header] - the header frame
+-->> header_caption - the lable with the title in it
+-->> header_content - the area to contain butons
+Gui.new_concept('header')
+:set_title('Example Header')
+ + +
+
+
+
+ # + scroll_table +
+
+
+
+ +

A table that is inside a vertical scroll area

+

+ + + Properties / Events: + +
    + + + + + +
  • + + hight + + : + + (number) + + the max hight of the scroll area + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [scroll_table] - the scroll area
+-->> table - the table area
+Gui.new_concept('scroll_table')
+:set_height(200)
+:set_column_count(2)
+ + +
+
+
+
+ # + time_label +
+
+
+
+ +

A label that show time in a nice, user friendly way

+

+ + + Properties / Events: + +
    + + + + + +
  • + + time + + : + + (number) + + the time to display in tick + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [time_label] - the label with the time
+local time_label =
+Gui.new_concept('time_label')
+:set_use_hours(true)
+:set_time(game.tick)
+
+time_label:update_time(element,game.tick)
+ + +
+
+
+
+ # + toggle_button +
+
+
+
+ +

A button that will toggle its caption each time it is pressed

+

+ + + Properties / Events: + +
    + + + + + +
  • + + alt_caption + + : + + (string) + + the caption to show on the button in its true state + +
  • + + + + + +
  • + + alt_tooltip + + : + + (string) + + the tooltip to show on the button in its true state + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [toggle_button] - the header button
+Gui.new_concept('toggle_button')
+:set_caption('<')
+:set_tooltip('Press to close.')
+:set_alt_caption('>')
+:set_alt_tooltip('Press to open.')
+:on_click(function(event)
+    local state = event.state and 'close' or 'open'
+    event.player.print('Toggle button is now: '..state)
+end)
+ + +
+
+
+
+ # + unit_label +
+
+
+
+ +

A label triplet which has a static label, a data label which can be changed, and a unit label

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [unit_label] - the static label
+--> [properties.data_name] - the data label which can be updated
+--> [properties.data_name..'_unit'] - the data label unit which can be updated
+Gui.new_concept('unit_label')
+:set_data_label_name('game_ticks')
+:set_data_caption('0')
+:set_data_unit('ticks')
+:set_data_format(function(concept,element,data,...)
+    -- This is used with update_data_element and update_from_parent
+    local caption = tostirng(data)
+    local unit = data > 1 and 'ticks' or 'tick'
+    local tooltip = 'This game has beeing running for: '..caption..' ticks'
+    return caption, unit, tooltip
+end)
+ + +
+
+

Functions

+
+
+
+
+ # + data_label:update_data_element(element, data) +
+
+
+
+ +

Updates the caption and tooltip of the data label using the data format function

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the data label element that you want to update + +
  • + + + + + +
  • + + data + + : + + (any) + + 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)
+ + +
+
+
+
+ # + data_label:update_from_parent(parent, data) +
+
+
+
+ +

Updates the caption and tooltip of the data label using the data format function, given the parent of the data label

+

+ + + Parameters: + +
    + + + + + +
  • + + parent + + : + + (LuaGuiElement) + + the parent element to the data label element that you want to update + +
  • + + + + + +
  • + + data + + : + + (any) + + 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)
+ + +
+
+
+
+ # + time_label:update_time(element, time) +
+
+
+
+ +

Updates the time that is on a label

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the label that you want to update + +
  • + + + + + +
  • + + time + + : + + (number) + + the number of tick you want it to show + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Update the time to show game time
+time_label:update_time(element,game.time)
+ + +
+
+
+
+ # + unit_label:update_data_element(element, data) +
+
+
+
+ +

Updates the caption and tooltip and unit of the data label using the data format function

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the unit label element that you want to update + +
  • + + + + + +
  • + + data + + : + + (any) + + 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)
+ + +
+
+
+
+ # + unit_label:update_from_parent(parent, data) +
+
+
+
+ +

Updates the caption and tooltip and unit of the unit label using the data format function, given the parent of the unit label

+

+ + + Parameters: + +
    + + + + + +
  • + + parent + + : + + (LuaGuiElement) + + the parent element to the unit label element that you want to update + +
  • + + + + + +
  • + + data + + : + + (any) + + 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)
+ + +
+
+ + + +
+
+
+ + + + diff --git a/docs/core/Gui.html b/docs/core/Gui.html index cc61f4e7..6533ff0e 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -10987,7 +10987,7 @@ generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index f2878f57..cffa89f8 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -1432,7 +1432,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index a6a994fb..3187a4f7 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -3152,7 +3152,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index eb815f53..97eda35f 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -234,73 +234,46 @@

Usage


----- Basic Use
-    -- At the most basic level this allows for the naming of locations to store in the global table, the second feature is that you are
-    -- able to listen for updates of this value, which means that when ever the set function is called it will trigger the update callback.
-
-    -- This may be useful when storing config values and when they get set you want to make sure it is taken care of, or maybe you want
-    -- to have a value that you can trigger an update of from different places.
-
-    -- This will register a new location called 'scenario.difficulty'
-    -- note that setting a start value is optional and we could take nil to mean normal
-    Store.register('scenario.difficulty',function(value)
-        game.print('The scenario difficulty has be set to: '..value)
-    end)
+-- The data store module is designed to be an alterative way to store data in the global table
+-- each piece of data is stored at a location and optional key of that location
+-- it is recomented that you use a local varible to store the location
+local scenario_difficuly = Store.uid_location()
+local team_scores = 'team-scores'
 
-    -- This will set the value in the store to 'hard' and will trigger the update callback which will print a message to the game
-    Store.set('scenario.difficulty','hard')
+-- Setting and getting data is then as simple as
+-- note that when storing a table you must use Store.update
+Store.set(scenario_difficuly,'Hard')
+Store.set(team_scores,game.player.force.name,20)
 
-    -- This will return 'hard'
-    Store.get('scenario.difficulty')
-

----- Using Children
-    -- One limitation of store is that all locations must be registered to avoid desyncs, to get round this issue "children" can be used.
-    -- When you set the value of a child it does not have its own update callback so rather the "parent" location which has been registered
-    -- will have its update value called with a second param of the name of that child.
+Store.get(scenario_difficuly) -- returns 'Hard'
+Store.get(team_scores,game.player.force.name) -- returns 20
 
-    -- This may be useful when you want a value of each player or force and since you cant register every player at the start you must use
-    -- the players name as the child name.
-
-    -- This will register the location 'scenario.score' where we plan to use force names as the child
-    Store.register('scenario.score',function(value,child)
-        game.print(child..' now has a score of '..value)
-    end)
+Store.update(team_scores,game.player.force.name,function(value,key)
+    return value + 10 -- add 10 to the score
+end)
 
-    -- This will return nil, but will not error as children don't need to be registered
-    Store.get('scenario.score','player')
+-- The reason for using stores over global is the abilty to watch for updates
+-- for stores to work you must register them, often at the end of the file
+Store.register(scenario_difficuly,function(value)
+    game.print('Scenario difficulty has been set to: '..value)
+end)
 
-    -- This will set 'player' to have a value of 10 for 'scenario.score' and trigger the game message print
-    Store.set('scenario.score','player',10)
+Store.register(team_scores,function(value,key)
+    game.print('Team '..key..' now has a score of '..value)
+end)
 
-    -- This would be the similar to Store.get however this will return the names of all the children
-    Store.get_children('scenario.score')
-

----- Using Sync
-    -- There is the option to use synced values which is the same as a normal value however you can combine this with an external script
-    -- which can read the output from 'script-output/log/store.log' and have it send rcon commands back to the game allowing for cross instance
-    -- syncing of values.
-
-    -- This may be useful when you want to have a value change effect multiple instances or even if you just want a database to store values so
-    -- you can sync data between map resets.
-
-    -- This example will register the location 'statistics.total-play-time' where we plan to use plan names as the child
-    -- note that the location must be the same across instances
-    Store.register('statistics.total-play-time',true,function(value,child)
-        game.print(child..' now has now played for '..value)
-    end)
+-- This can be very powerful when working with data that can be changed for a number of locations
+-- with this module you can enable any location to output its changes to a file
+-- say we wanted team scores to be synced across servers or between saves
+-- although you will need to set up a method of storing the data outside the game
+Store.register(team_scores,true,function(value,key)
+    game.print('Team '..key..' now has a score of '..value)
+end)
 
-    -- Use of set and are all the same as non synced but you should include from_sync as true
-
-

----- Alternative method
-    -- Some people may prefer to use a variable rather than a string for formating reasons here is an example. Also for any times when
-    -- there will be little external input Store.uid_location() can be used to generate non conflicting locations, uid_location will also
-    -- be used if you give a nil location.
-
-    local store_game_speed =
-    Store.register(function(value)
-        game.print('The game speed has been set to: '..value)
-    end)
+-- If you want multiple handlers on one store location then you can register to the raw event +Event.add(Store.events.on_value_changed,function(event) + game.print('Store '..event.location..'/'..event.key..' was updated to: '..event.value) +end) @@ -333,33 +306,41 @@ + register([location][, synced=false][, callback]) + Registers a new location with an update callback which is triggered when the value updates + + + get(location[, key]) + Gets the value stored at a location, this location must be registered + + + set(location[, key], value[, from_sync=false][, from_internal=false]) + Sets the value at a location, this location must be registered + + + update(location[, key][, update_callback]) + Allows for updating a value based on the current value; only valid way to change tables in a store + + + update_all(location[, update_callback]) + Allows for updating all values at a location based on the current value; only valid way to change tables in a store + + + clear(location[, key][, from_sync=false]) + Sets the value at a location to nil, this location must be registered + + + get_keys(location) + Gets all non nil keys at a location, keys can be added and removed during runtime +this is similar to Store.get but will always return a table even if it is empty + + is_registered(location) Check for if a location is registered uid_location() Returns a unique name that can be used for a store - - - register([location][, synced][, callback]) - Registers a new location with an update callback which is triggered when the value updates - - - get(location[, child][, allow_unregistered=false]) - Gets the value stored at a location, this location must be registered - - - set(location[, child], value[, from_sync]) - Sets the value at a location, this location must be registered - - - clear(location[, child][, from_sync]) - Sets the value at a location to nil, this location must be registered - - - get_children(location) - Gets all non nil children at a location, children can be added and removed during runtime - this is similar to Store.get but will always return a table even if it is empty @@ -476,6 +457,643 @@
+ # + register([location][, synced=false][, callback]) +
+
+
+
+ +

Registers a new location with an update callback which is triggered when the value updates

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Registering a new store location
+local store_id = Store.register()
+
-- Registering a new store location, with custom update callback
+local store_id = Store.uid_location()
+Store.register(store_id,function(value,key)
+    game.print('Store '..store_id..'/'..key..' was updated to: '..value)
+end)
+ + +
+
+
+
+ # + get(location[, key]) +
+
+
+
+ +

Gets the value stored at a location, this location must be registered

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Getting the data at a store location
+local data = Store.get(store_id_no_keys)
+local data = Store.get(store_id_with_keys,'key_one')
+ + +
+
+
+
+ # + set(location[, key], value[, from_sync=false][, from_internal=false]) +
+
+
+
+ +

Sets the value at a location, this location must be registered

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Setting the data at a store location
+Store.set(store_id_no_keys,'Hello, World!')
+Store.set(store_id_with_keys,'key_one','Hello, World!')
+ + +
+
+
+
+ # + update(location[, key][, update_callback]) +
+
+
+
+ +

Allows for updating a value based on the current value; only valid way to change tables in a store

+

+ + + Parameters: + + + + + + + + + + + + + + Usage: +
-- Updating a value stored at a location
+Store.update(store_id_no_keys,function(value)
+    return value + 1
+end)
+Store.update(store_id_with_keys,'key_one',function(value)
+    return value + 1
+end)
+
-- Updating a table stored at a location
+Store.update(store_id_no_keys,function(value)
+    value.ctn = value.ctn + 1
+end)
+Store.update(store_id_with_keys,'key_one',function(value)
+    value.ctn = value.ctn + 1
+end)
+ + +
+
+
+
+ # + update_all(location[, update_callback]) +
+
+
+
+ +

Allows for updating all values at a location based on the current value; only valid way to change tables in a store

+

+ + + Parameters: + + + + + + + + + + + + + + Usage: +
-- Updating all values at a location
+Store.update(store_id_with_keys,function(value)
+    return value + 1
+end)
+
-- Updating all tables at a location
+Store.update(store_id_with_keys,function(value)
+    value.ctn = value.ctn + 1
+end)
+ + +
+
+
+
+ # + clear(location[, key][, from_sync=false]) +
+
+
+
+ +

Sets the value at a location to nil, this location must be registered

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Clear the data at a location
+Store.clear(store_id_no_keys)
+Store.clear(store_id_with_keys,'key_one')
+ + +
+
+
+
+ # + get_keys(location) +
+
+
+
+ +

Gets all non nil keys at a location, keys can be added and removed during runtime +this is similar to Store.get but will always return a table even if it is empty

+

+ + + Parameters: + + + + + + + Returns: + + + + + + + + + Usage: +
-- Get all keys at a store location
+local keys = Store.get_keys(store_id_with_keys)
+ + +
+
+
+
# is_registered(location)
@@ -527,6 +1145,9 @@ + Usage: +
-- Check that a store is registered
+local registerd = Store.is_registered(store_id)
@@ -561,445 +1182,9 @@ - - - -
-
-
- # - register([location][, synced][, callback]) -
-
-
-
- -

Registers a new location with an update callback which is triggered when the value updates

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - get(location[, child][, allow_unregistered=false]) -
-
-
-
- -

Gets the value stored at a location, this location must be registered

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - set(location[, child], value[, from_sync]) -
-
-
-
- -

Sets the value at a location, this location must be registered

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - clear(location[, child][, from_sync]) -
-
-
-
- -

Sets the value at a location to nil, this location must be registered

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - get_children(location) -
-
-
-
- -

Gets all non nil children at a location, children can be added and removed during runtime - this is similar to Store.get but will always return a table even if it is empty

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - + Usage: +
-- Get a new unique store id
+local store_id = Store.uid_location()
@@ -1018,7 +1203,7 @@ generated by LDoc diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index b57f5340..53d24d08 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -544,7 +544,7 @@ generated by LDoc diff --git a/docs/core/Toolbar.html b/docs/core/Toolbar.html new file mode 100644 index 00000000..848922b5 --- /dev/null +++ b/docs/core/Toolbar.html @@ -0,0 +1,1669 @@ + + + + + + + + Toolbar core + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

Toolbar core

+

Core Module - Toolbar

+

+ + + + + + + + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + + + +
expcore.gui
expcore.roles
utils.event
utils.game
mod-gui
Gui.concept.button
+ + +

Permissions

+ + + + + + + + + + + + +
allowed(player, concept_name)Used to test if a player is allowed to use a button on the toolbar, if you are not using expcore.roles then change this function
set_permission_alias(concept_name, alias)Use to add an alias for the allowed test, alias is what is tested for rather than the concept name
+ + +

Buttons

+ + + + + + + + + + + + + + + + + + + + +
add_button_concept(concept)Adds a concept to be drawn to the button area and allows it to be toggled with the toggle toolbar button
update_buttons(player)Updates all the buttons for a player, this means hide and show buttons based on permissions
get_visible_buttons(player)Returns an array of buttons names that the given player is able to see, returns none if toolbar hidden
toolbar-buttonThe base element to be used with the toolbar, others can be used but this is recomented
+ + +

Frames

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
add_frame_concept(concept)Adds a frame concept to the toolbar frame area, this will not add a button to the toolbar
hide_frames(player)Hides all the frames for a player
get_visible_frames(player)Gets an array of the names of all the visible frames for a player
toolbar-frameThe base toolbar frame, others can be used but this is recomented
Toolbar.frame:get_content(player)Gets the content area of the frame concept for this player, each player only has one area
Toolbar.frame:toggle_visible_state(player)Toggles the visibilty of this concept for the given player
Toolbar.frame:get_visible_state(player)Gets the current visibilty state of this conept for this player
Toolbar.frame:update(player[, event])Triggers an update of the content within the concept for this player, uses on_update handlers
Toolbar.frame:update_all([event])Triggers an update of the content with in this frame for all players
+ + +

Other Elements

+ + + + + + + + + + + + + + + + +
toolbarThe main toolbar element, draws, updates, and controls the other concepts
toolbar-toggleButton which toggles the the visible state of all toolbar buttons, triggers on_button_update
toolbar-clearButton which hides all visible toolbar frames, triggers on_hide_frames
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.roles +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + utils.event +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + utils.game +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + mod-gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + Gui.concept.button +
+
+
+
+ + + + + + + + + + + + + + + +
+
+

Permissions

+
+
+
+
+ # + allowed(player, concept_name) +
+
+
+
+ +

Used to test if a player is allowed to use a button on the toolbar, if you are not using expcore.roles then change this function

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player you want ot test is allowed to use this button + +
  • + + + + + +
  • + + concept_name + + : + + (string) + + the name of the button concept that you want to see if the player is allowed to use + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + true if the player is allowed to use it +
  • +
+ + + + + + + + Usage: +
-- Test if a player can use 'test-player-list'
+local allowed = Toolbar.allowed(game.player,'test-player-list')
+ + +
+
+
+
+ # + set_permission_alias(concept_name, alias) +
+
+
+
+ +

Use to add an alias for the allowed test, alias is what is tested for rather than the concept name

+

+ + + Parameters: + +
    + + + + + +
  • + + concept_name + + : + + (string) + + the name of the concept that will point to this alias + +
  • + + + + + +
  • + + alias + + : + + (string) + + the permission string that will be tested when this concept is used with Toolbar.allowed + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Adding an alias for the 'test-player-list' concept
+Toolbar.set_permission_alias('test-player-list','gui/player-list')
+ + +
+
+

Buttons

+
+
+
+
+ # + add_button_concept(concept) +
+
+
+
+ +

Adds a concept to be drawn to the button area and allows it to be toggled with the toggle toolbar button

+

+ + + Parameters: + +
    + + + + + +
  • + + concept + + : + + (table) + + the gui concept that you want to add to the button area + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Adding a basic button to the toolbar
+local new_button =
+Gui.new_concept('button')
+:set_caption('Click Me')
+:on_click(function(event)
+    event.player.print('You Clicked Me!!')
+end)
+
+Toolbar.add_button_concept(new_button)
+ + +
+
+
+
+ # + update_buttons(player) +
+
+
+
+ +

Updates all the buttons for a player, this means hide and show buttons based on permissions

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to update the toolbar buttons for + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Updating your toolbar
+Toolbar.update_buttons(player)
+ + +
+
+
+
+ # + get_visible_buttons(player) +
+
+
+
+ +

Returns an array of buttons names that the given player is able to see, returns none if toolbar hidden

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player you want to get the visible buttons of + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of names of the visible buttons +
  • +
+ + + + + + + + Usage: +
-- Get a list of all your visible buttons
+Toolbar.get_visible_buttons(game.player)
+ + +
+
+
+
+ # + toolbar-button +
+
+
+
+ +

The base element to be used with the toolbar, others can be used but this is recomented

+

+ + + Properties / Events: + +
    + + + + + +
  • + + permission_alias + + : + + (string) + + the alias used with Toolbar.allowed + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Adding a basic button to the toolbar, note no need to call Toolbar.add_button_concept
+Gui.new_concept('toolbar-button')
+:set_caption('Click Me')
+:on_click(function(event)
+    event.player.print('You Clicked Me!!')
+end)
+ + +
+
+

Frames

+
+
+
+
+ # + add_frame_concept(concept) +
+
+
+
+ +

Adds a frame concept to the toolbar frame area, this will not add a button to the toolbar

+

+ + + Parameters: + +
    + + + + + +
  • + + concept + + : + + (table) + + the gui concept that you want to add to the toolbar frame area + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Adding a basic frame to the frame area
+local new_frame =
+Gui.new_concept('frame')
+:set_title('Test')
+
+Toolbar.add_frame_concept(new_frame)
+ + +
+
+
+
+ # + hide_frames(player) +
+
+
+
+ +

Hides all the frames for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to hide the frames for + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Hiding all your frames
+Toolbar.hide_frames(game.player)
+ + +
+
+
+
+ # + get_visible_frames(player) +
+
+
+
+ +

Gets an array of the names of all the visible frames for a player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that you want to get the visible frames of + +
  • + + +
+ + + + + Returns: +
    +
  • + (table) + an array of names of the visible frames for the given player +
  • +
+ + + + + + + + Usage: +
-- Get all your visible frames
+Toolbar.get_visible_frames(game.player)
+ + +
+
+
+
+ # + toolbar-frame +
+
+
+
+ +

The base toolbar frame, others can be used but this is recomented

+

+ + + Properties / Events: + +
    + + + + + +
  • + + on_update + + : + + + fired when the frame is to have its content updated + +
  • + + + + + +
  • + + open_by_default + + : + + (boolean) + + weather the frame should be open when a player first joins + +
  • + + + + + +
  • + + use_container + + : + + (boolean) + + true by default and will place a container inside the frame for content + +
  • + + + + + +
  • + + direction + + : + + (string) + + the direction that the items in the frame are added + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Adding a basic player list
+local player_list =
+Gui.new_concept('toolbar-frame')
+:set_permission_alias('player_list')
+:set_caption('Player List')
+:toggle_with_click()
+
+:define_draw(function(properties,parent,element)
+    local list_area =
+    element.add{
+        name = 'scroll',
+        type = 'scroll-pane',
+        direction = 'vertical',
+        horizontal_scroll_policy = 'never',
+        vertical_scroll_policy = 'auto-and-reserve-space'
+    }
+    Gui.set_padding(list_area,1,1,2,2)
+    list_area.style.horizontally_stretchable = true
+    list_area.style.maximal_height = 200
+
+    for _,player in pairs(game.connected_players) do
+        list_area.add{
+            type='label',
+            caption=player.name
+        }
+    end
+end)
+
+:on_update(function(event)
+    local list_area = event.element.scroll
+    list_area.clear()
+
+    for _,player in pairs(game.connected_players) do
+        list_area.add{
+            type='label',
+            caption=player.name
+        }
+    end
+end)
+ + +
+
+
+
+ # + Toolbar.frame:get_content(player) +
+
+
+
+ +

Gets the content area of the frame concept for this player, each player only has one area

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that you want to get the frame content for + +
  • + + +
+ + + + + Returns: +
    +
  • + (LuaGuiElement) + the content area of this concept for this player +
  • +
+ + + + + + + + Usage: +
-- Get the content area of a concept
+local frame = player_list:get_content(game.player)
+ + +
+
+
+
+ # + Toolbar.frame:toggle_visible_state(player) +
+
+
+
+ +

Toggles the visibilty of this concept for the given player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that you want to toggle the frame for + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + the new state of the visibilty of this concept for the player +
  • +
+ + + + + + + + Usage: +
-- Toggle the frame for your self
+player_list:toggle_visible_state(game.player)
+ + +
+
+
+
+ # + Toolbar.frame:get_visible_state(player) +
+
+
+
+ +

Gets the current visibilty state of this conept for this player

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player that you want the visibilty state for + +
  • + + +
+ + + + + Returns: +
    +
  • + (boolean) + the current visiblity state of this concept to the player +
  • +
+ + + + + + + + Usage: +
-- Getting the current visiblity state
+ + +
+
+
+
+ # + Toolbar.frame:update(player[, event]) +
+
+
+
+ +

Triggers an update of the content within the concept for this player, uses on_update handlers

+

+ + + Parameters: + +
    + + + + + +
  • + + player + + : + + (LuaPlayer) + + the player to update the concept content for + +
  • + + + + + +
  • + + event + + : + + (table) + + the event data that you want to pass to the update handlers + + (optional) +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Updating the frame for your player
+player_list:update(game.player)
+ + +
+
+
+
+ # + Toolbar.frame:update_all([event]) +
+
+
+
+ +

Triggers an update of the content with in this frame for all players

+

+ + + Parameters: + +
    + + + + + +
  • + + event + + : + + (table) + + the event data that you want to pass to the update handlers + + (optional) +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Update the grame for all players
+player_list:update_all()
+ + +
+
+

Other Elements

+
+
+
+
+ # + toolbar +
+
+
+
+ +

The main toolbar element, draws, updates, and controls the other concepts

+

+ + + Properties / Events: + +
    + + + + + +
  • + + on_button_update + + : + + + fired when the buttons are updated for a player + +
  • + + + + + +
  • + + on_hide_frames + + : + + + fired when the frames are hidden for a player + +
  • + + +
+ + + + + + + + + + + + + +
+
+
+
+ # + toolbar-toggle +
+
+
+
+ +

Button which toggles the the visible state of all toolbar buttons, triggers on_button_update

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + toolbar-clear +
+
+
+
+ +

Button which hides all visible toolbar frames, triggers on_hide_frames

+

+ + + + + + + + + + + + + + +
+
+ + + +
+
+
+ + + + diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index 15f04345..5d601cbe 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -626,7 +626,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index a0c8e321..e3d10a38 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -629,7 +629,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 46a7c6ba..59dc47ca 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -449,7 +449,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 044ce929..a97b0a3e 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -632,7 +632,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index 70ad4fae..75ae9c1d 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -837,7 +837,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index 8d881fce..6466ea5d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -514,7 +514,7 @@ see ./expcore/commands.lua for more details generated by LDoc diff --git a/docs/modules/ExpStyle.html b/docs/modules/ExpStyle.html new file mode 100644 index 00000000..fede875a --- /dev/null +++ b/docs/modules/ExpStyle.html @@ -0,0 +1,1343 @@ + + + + + + + + ExpStyle module + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + +

ExpStyle module

+

Core Module - ExpStyle

+

+ + + + + + + + + + + + + +

Dependencies

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
expcore.gui
gui.concept.frame
expcore.gui
gui.concept.frame
expcore.gui
gui.concept.table
expcore.gui
gui.concept.table
expcore.gui
gui.concept.table
gui.concept.scroll
expcore.gui
expcore.common
expcore.gui
gui.concept.table
expcore.gui
gui.concept.frame
+ + +

Elements

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
containerA container frame that can be used to add a boader around your content
data_labelA label pair which has a static label and a data label which can be changed
footerA frame that acts as a footer to a section of content
headerA frame that acts as a header to a section of content
scroll_tableA table that is inside a vertical scroll area
time_labelA label that show time in a nice, user friendly way
toggle_buttonA button that will toggle its caption each time it is pressed
unit_labelA label triplet which has a static label, a data label which can be changed, and a unit label
+ + +

Functions

+ + + + + + + + +
time_label:update_time(element, time)Updates the time that is on a label
+ + +
+ + +

Dependencies

+
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.frame +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.frame +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.table +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.table +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.table +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.scroll +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.common +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.table +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+
+ # + gui.concept.frame +
+
+
+
+ + + + + + + + + + + + + + + +
+
+

Elements

+
+
+
+
+ # + container +
+
+
+
+ +

A container frame that can be used to add a boader around your content

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [container] - the outer frame
+-->> container - the content area
+Gui.new_concept('container')
+ + +
+
+
+
+ # + data_label +
+
+
+
+ +

A label pair which has a static label and a data label which can be changed

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [data_label] - the static label
+--> [properties.data_name] - the data label which can be updated
+Gui.new_concept('data_label')
+:set_data_label_name('game_ticks')
+:set_data_caption('0')
+:set_data_format(function(concept,element,data,...)
+    -- This is used with update_data_element and update_from_parent
+    local caption = tostirng('data')
+    local tooltip = 'This game has beeing running for: '..caption..' ticks'
+    return caption, tooltip
+end)
+ + +
+
+
+
+ # + footer +
+
+
+
+ +

A frame that acts as a footer to a section of content

+

+ + + Properties / Events: + +
    + + + + + +
  • + + tooltip + + : + + (string) + + the tooltip to show on the title + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [footer] - the footer frame
+-->> footer_caption - the lable with the title in it
+-->> footer_content - the area to contain butons
+Gui.new_concept('footer')
+:set_title('Example Footer')
+ + +
+
+
+
+ # + header +
+
+
+
+ +

A frame that acts as a header to a section of content

+

+ + + Properties / Events: + +
    + + + + + +
  • + + tooltip + + : + + (string) + + the tooltip to show on the title + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [header] - the header frame
+-->> header_caption - the lable with the title in it
+-->> header_content - the area to contain butons
+Gui.new_concept('header')
+:set_title('Example Header')
+ + +
+
+
+
+ # + scroll_table +
+
+
+
+ +

A table that is inside a vertical scroll area

+

+ + + Properties / Events: + +
    + + + + + +
  • + + hight + + : + + (number) + + the max hight of the scroll area + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [scroll_table] - the scroll area
+-->> table - the table area
+Gui.new_concept('scroll_table')
+:set_height(200)
+:set_column_count(2)
+ + +
+
+
+
+ # + time_label +
+
+
+
+ +

A label that show time in a nice, user friendly way

+

+ + + Properties / Events: + +
    + + + + + +
  • + + time + + : + + (number) + + the time to display in tick + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [time_label] - the label with the time
+local time_label =
+Gui.new_concept('time_label')
+:set_use_hours(true)
+:set_time(game.tick)
+
+time_label:update_time(element,game.tick)
+ + +
+
+
+
+ # + toggle_button +
+
+
+
+ +

A button that will toggle its caption each time it is pressed

+

+ + + Properties / Events: + +
    + + + + + +
  • + + alt_caption + + : + + (string) + + the caption to show on the button in its true state + +
  • + + + + + +
  • + + alt_tooltip + + : + + (string) + + the tooltip to show on the button in its true state + +
  • + + +
+ + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [toggle_button] - the header button
+Gui.new_concept('toggle_button')
+:set_caption('<')
+:set_tooltip('Press to close.')
+:set_alt_caption('>')
+:set_alt_tooltip('Press to open.')
+:on_click(function(event)
+    local state = event.state and 'close' or 'open'
+    event.player.print('Toggle button is now: '..state)
+end)
+ + +
+
+
+
+ # + unit_label +
+
+
+
+ +

A label triplet which has a static label, a data label which can be changed, and a unit label

+

+ + + + + + + + + + See also: + + + + + Usage: +
-- Concept Structure
+-- Root
+--> [unit_label] - the static label
+--> [properties.data_name] - the data label which can be updated
+--> [properties.data_name..'_unit'] - the data label unit which can be updated
+Gui.new_concept('unit_label')
+:set_data_label_name('game_ticks')
+:set_data_caption('0')
+:set_data_unit('ticks')
+:set_data_format(function(concept,element,data,...)
+    -- This is used with update_data_element and update_from_parent
+    local caption = tostirng(data)
+    local unit = data > 1 and 'ticks' or 'tick'
+    local tooltip = 'This game has beeing running for: '..caption..' ticks'
+    return caption, unit, tooltip
+end)
+ + +
+
+

Functions

+
+
+
+
+ # + time_label:update_time(element, time) +
+
+
+
+ +

Updates the time that is on a label

+

+ + + Parameters: + +
    + + + + + +
  • + + element + + : + + (LuaGuiElement) + + the label that you want to update + +
  • + + + + + +
  • + + time + + : + + (number) + + the number of tick you want it to show + +
  • + + +
+ + + + + + + + + + + + Usage: +
-- Update the time to show game time
+time_label:update_time(element,game.time)
+ + +
+
+ + + +
+
+
+ + + + diff --git a/docs/modules/Gui.html b/docs/modules/Gui.html index 493c008e..7f2d9a40 100644 --- a/docs/modules/Gui.html +++ b/docs/modules/Gui.html @@ -41,8 +41,7 @@ @@ -52,20 +51,6 @@ @@ -237,9 +221,7 @@

Gui module

-

Core Module - Gui - - This file is used to require all the different elements of the gui module - - each module has an outline here but for more details see their separate files in ./gui

+

Core Module - Gui

@@ -254,71 +236,17 @@ -

Dependencies

+

Functions

- + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui.coreon_custom_event(handler)Adds a custom event handler, replace with the name of the event
expcore.gui.instances
expcore.gui.elements.buttons
expcore.gui.elements.checkbox
expcore.gui.elements.dropdown
expcore.gui.elements.slider
expcore.gui.elements.text
expcore.gui.elements.elem-button
expcore.gui.elements.progress-bar
expcore.gui.concepts.toolbar
expcore.gui.concepts.left
expcore.gui.concepts.center
expcore.gui.concepts.popups
- - -

Test

- - - - - - - - - - - - - - - - - + +
expcore.gui
expcore.common
resources.color_presets
utils.event
expcore.storeset_custom_property(value)Sets a new value for a property, triggers setter method if provided, replace with property name
@@ -327,23 +255,56 @@
-

Dependencies

+

Functions

- # - expcore.gui.core + # + on_custom_event(handler)
+

Adds a custom event handler, replace with the name of the event

+

+ Parameters: + +
    + + + + + +
  • + + handler + + : + + (function) + + the function which will recive the event + +
  • + + +
+ + Returns: +
    +
  • + (GuiConcept) + to allow chaing of functions +[[@usage +
  • +
@@ -357,421 +318,51 @@
- # - expcore.gui.instances -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.buttons -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.checkbox -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.dropdown -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.slider -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.text -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.elem-button -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.progress-bar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.toolbar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.left -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.center -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.popups -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Test

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store + # + set_custom_property(value)
+

Sets a new value for a property, triggers setter method if provided, replace with property name

+

+ Parameters: + +
    + + + + + +
  • + + value + + : + + (any) + + the value that you want to set for this property + +
  • + + +
+ + Returns: +
    +
  • + (GuiConcept) + to allow chaing of functions +[[@usage +
  • +
@@ -797,7 +388,7 @@ generated by LDoc
diff --git a/docs/modules/control.html b/docs/modules/control.html index 2e7d23d6..88f0ccce 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -351,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/expcore.gui.html b/docs/modules/expcore.gui.html index 580de83b..78739a7f 100644 --- a/docs/modules/expcore.gui.html +++ b/docs/modules/expcore.gui.html @@ -37,35 +37,13 @@ -