diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index 73fbfff1..99ffc5b4 100644 --- a/docs/addons/Advanced-Start.html +++ b/docs/addons/Advanced-Start.html @@ -349,7 +349,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html index 775e8d48..b06d2672 100644 --- a/docs/addons/Chat-Popups.html +++ b/docs/addons/Chat-Popups.html @@ -350,7 +350,7 @@ generated by LDoc diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html index e782e0bd..d45ea3c6 100644 --- a/docs/addons/Chat-Reply.html +++ b/docs/addons/Chat-Reply.html @@ -377,7 +377,7 @@ generated by LDoc diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html index 5fd8782d..6eb7d3fe 100644 --- a/docs/addons/Compilatron.html +++ b/docs/addons/Compilatron.html @@ -586,7 +586,7 @@ generated by LDoc diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html index 7cfdaca2..95607966 100644 --- a/docs/addons/Damage-Popups.html +++ b/docs/addons/Damage-Popups.html @@ -350,7 +350,7 @@ generated by LDoc diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html index 970adce4..3ab0419f 100644 --- a/docs/addons/Death-Logger.html +++ b/docs/addons/Death-Logger.html @@ -405,7 +405,7 @@ generated by LDoc diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html index 5e0947dc..7e7065bc 100644 --- a/docs/addons/Discord-Alerts.html +++ b/docs/addons/Discord-Alerts.html @@ -461,7 +461,7 @@ generated by LDoc diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html index d7b1e361..e2995d38 100644 --- a/docs/addons/Player-Colours.html +++ b/docs/addons/Player-Colours.html @@ -405,7 +405,7 @@ generated by LDoc diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html index c4a517fb..f257ab61 100644 --- a/docs/addons/Pollution-Grading.html +++ b/docs/addons/Pollution-Grading.html @@ -321,7 +321,7 @@ generated by LDoc diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html index 57b0ab74..6f6fc337 100644 --- a/docs/addons/Scorched-Earth.html +++ b/docs/addons/Scorched-Earth.html @@ -405,7 +405,7 @@ generated by LDoc diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html index be2099ef..b2b11a94 100644 --- a/docs/addons/Spawn-Area.html +++ b/docs/addons/Spawn-Area.html @@ -377,7 +377,7 @@ generated by LDoc diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html index 6025ff68..aafc0e4e 100644 --- a/docs/commands/Admin-Chat.html +++ b/docs/commands/Admin-Chat.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html index 0598e87c..9db97cf7 100644 --- a/docs/commands/Bonus.html +++ b/docs/commands/Bonus.html @@ -501,7 +501,7 @@ generated by LDoc diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html index cfd66e8b..1e4cc198 100644 --- a/docs/commands/Cheat-Mode.html +++ b/docs/commands/Cheat-Mode.html @@ -362,7 +362,7 @@ generated by LDoc diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html index 8981f9dc..03e6c886 100644 --- a/docs/commands/Clear-Inventory.html +++ b/docs/commands/Clear-Inventory.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html index b205bdb0..edfcdbb1 100644 --- a/docs/commands/Debug.html +++ b/docs/commands/Debug.html @@ -366,7 +366,7 @@ generated by LDoc diff --git a/docs/commands/Find.html b/docs/commands/Find.html index 7336767c..586d8d34 100644 --- a/docs/commands/Find.html +++ b/docs/commands/Find.html @@ -361,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Help.html b/docs/commands/Help.html index 67979913..25a8f115 100644 --- a/docs/commands/Help.html +++ b/docs/commands/Help.html @@ -405,7 +405,7 @@ generated by LDoc diff --git a/docs/commands/Home.html b/docs/commands/Home.html index c864e5c7..e88d2da7 100644 --- a/docs/commands/Home.html +++ b/docs/commands/Home.html @@ -459,7 +459,7 @@ generated by LDoc diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html index e730c1b9..2cf6091a 100644 --- a/docs/commands/Interface.html +++ b/docs/commands/Interface.html @@ -417,7 +417,7 @@ generated by LDoc diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html index a968ac2f..1d41e418 100644 --- a/docs/commands/Jail.html +++ b/docs/commands/Jail.html @@ -612,7 +612,7 @@ generated by LDoc diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html index 554c9a5b..6b7e21d8 100644 --- a/docs/commands/Kill.html +++ b/docs/commands/Kill.html @@ -390,7 +390,7 @@ generated by LDoc diff --git a/docs/commands/Me.html b/docs/commands/Me.html index 0ae4db9f..a071c0c1 100644 --- a/docs/commands/Me.html +++ b/docs/commands/Me.html @@ -361,7 +361,7 @@ generated by LDoc diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html index 90df5f7a..dc82cc79 100644 --- a/docs/commands/Rainbow.html +++ b/docs/commands/Rainbow.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html index aafce3f8..29437a17 100644 --- a/docs/commands/Repair.html +++ b/docs/commands/Repair.html @@ -322,7 +322,7 @@ generated by LDoc diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html index e799ff0d..65f2d825 100644 --- a/docs/commands/Reports.html +++ b/docs/commands/Reports.html @@ -586,7 +586,7 @@ generated by LDoc diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html index c7a69793..e0d338c1 100644 --- a/docs/commands/Roles.html +++ b/docs/commands/Roles.html @@ -558,7 +558,7 @@ generated by LDoc diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html index f30178d8..f8ef4787 100644 --- a/docs/commands/Spawn.html +++ b/docs/commands/Spawn.html @@ -390,7 +390,7 @@ generated by LDoc diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html index 00709274..ac1dd9e2 100644 --- a/docs/commands/Tag.html +++ b/docs/commands/Tag.html @@ -444,7 +444,7 @@ generated by LDoc diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html index 791563c0..efe6fe04 100644 --- a/docs/commands/Teleport.html +++ b/docs/commands/Teleport.html @@ -485,7 +485,7 @@ generated by LDoc diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html index 7efc06e3..4d8a95a6 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -570,7 +570,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index dea46b30..981debc7 100644 --- a/docs/configs/Advanced-Start.html +++ b/docs/configs/Advanced-Start.html @@ -507,7 +507,7 @@ generated by LDoc diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html index 9f5b1760..f42ddc42 100644 --- a/docs/configs/Bonuses.html +++ b/docs/configs/Bonuses.html @@ -238,7 +238,7 @@ generated by LDoc diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html index 518eb631..37c2a42d 100644 --- a/docs/configs/Chat-Reply.html +++ b/docs/configs/Chat-Reply.html @@ -486,7 +486,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html index 7b7427da..48724dfc 100644 --- a/docs/configs/Commands-Auth-Admin.html +++ b/docs/configs/Commands-Auth-Admin.html @@ -295,7 +295,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html index c30819c2..dc9614f2 100644 --- a/docs/configs/Commands-Auth-Roles.html +++ b/docs/configs/Commands-Auth-Roles.html @@ -321,7 +321,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html index 33386c16..c68b216a 100644 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ b/docs/configs/Commands-Auth-Runtime-Disable.html @@ -443,7 +443,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html index 71c1c783..f432ec70 100644 --- a/docs/configs/Commands-Parse-Roles.html +++ b/docs/configs/Commands-Parse-Roles.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html index 3987c8d6..d3c7c295 100644 --- a/docs/configs/Commands-Parse.html +++ b/docs/configs/Commands-Parse.html @@ -339,7 +339,7 @@ see ./expcore/commands.lua for more details

generated by LDoc diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html index 75d2f5bf..daeb3b5e 100644 --- a/docs/configs/Compilatron.html +++ b/docs/configs/Compilatron.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html index a6af1f2c..60c66414 100644 --- a/docs/configs/Death-Logger.html +++ b/docs/configs/Death-Logger.html @@ -417,7 +417,7 @@ generated by LDoc diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html index 2c4725b0..6cbff49c 100644 --- a/docs/configs/Discord-Alerts.html +++ b/docs/configs/Discord-Alerts.html @@ -238,7 +238,7 @@ generated by LDoc diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html index 98a8d207..f83ad879 100644 --- a/docs/configs/File-Loader.html +++ b/docs/configs/File-Loader.html @@ -241,7 +241,7 @@ generated by LDoc diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html index 74c617c3..8a41a0bb 100644 --- a/docs/configs/Permission-Groups.html +++ b/docs/configs/Permission-Groups.html @@ -296,7 +296,7 @@ generated by LDoc diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html index 3a63165b..abbd67bc 100644 --- a/docs/configs/Player-List.html +++ b/docs/configs/Player-List.html @@ -813,7 +813,7 @@ generated by LDoc diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html index 99d328d6..55ce2814 100644 --- a/docs/configs/Pollution-Grading.html +++ b/docs/configs/Pollution-Grading.html @@ -385,7 +385,7 @@ generated by LDoc diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html index 1679f71e..2a98b0b2 100644 --- a/docs/configs/Popup-Messages.html +++ b/docs/configs/Popup-Messages.html @@ -415,7 +415,7 @@ generated by LDoc diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html index 897866a4..5933597f 100644 --- a/docs/configs/Preset-Player-Colours.html +++ b/docs/configs/Preset-Player-Colours.html @@ -325,7 +325,7 @@ generated by LDoc diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html index 14d48983..1c90a44e 100644 --- a/docs/configs/Repair.html +++ b/docs/configs/Repair.html @@ -415,7 +415,7 @@ generated by LDoc diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html index d43a33c0..4478572f 100644 --- a/docs/configs/Rockets.html +++ b/docs/configs/Rockets.html @@ -835,7 +835,7 @@ generated by LDoc diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html index b311ca00..f503d293 100644 --- a/docs/configs/Roles.html +++ b/docs/configs/Roles.html @@ -293,7 +293,7 @@ generated by LDoc diff --git a/docs/configs/Science.html b/docs/configs/Science.html index 8feb5039..fc973191 100644 --- a/docs/configs/Science.html +++ b/docs/configs/Science.html @@ -355,7 +355,7 @@ generated by LDoc diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html index 44241b1e..b8e6ad74 100644 --- a/docs/configs/Scorched-Earth.html +++ b/docs/configs/Scorched-Earth.html @@ -389,7 +389,7 @@ generated by LDoc diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html index 7de1ef89..8ac57876 100644 --- a/docs/configs/Spawn-Area.html +++ b/docs/configs/Spawn-Area.html @@ -745,7 +745,7 @@ generated by LDoc diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html index a3054273..44ef1e74 100644 --- a/docs/configs/Tasks.html +++ b/docs/configs/Tasks.html @@ -385,7 +385,7 @@ generated by LDoc diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html index 10d950d3..1a874b76 100644 --- a/docs/configs/Warnings.html +++ b/docs/configs/Warnings.html @@ -356,7 +356,7 @@ generated by LDoc diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html index a5d78060..a8b05959 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -685,7 +685,7 @@ generated by LDoc diff --git a/docs/control/Jail.html b/docs/control/Jail.html index 761008db..4e10b7c8 100644 --- a/docs/control/Jail.html +++ b/docs/control/Jail.html @@ -1209,7 +1209,7 @@ generated by LDoc diff --git a/docs/control/Production.html b/docs/control/Production.html index b4134490..115f41c1 100644 --- a/docs/control/Production.html +++ b/docs/control/Production.html @@ -1330,7 +1330,7 @@ generated by LDoc diff --git a/docs/control/Reports.html b/docs/control/Reports.html index 4e7b0d49..f8c8e04b 100644 --- a/docs/control/Reports.html +++ b/docs/control/Reports.html @@ -1111,7 +1111,7 @@ generated by LDoc diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html index 337ee3a5..9c23440e 100644 --- a/docs/control/Rockets.html +++ b/docs/control/Rockets.html @@ -985,7 +985,7 @@ generated by LDoc diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html index 753dc6dc..b09d725e 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -1040,7 +1040,7 @@ generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index 04d31e52..e2f72325 100644 --- a/docs/control/Warnings.html +++ b/docs/control/Warnings.html @@ -1466,7 +1466,7 @@ generated by LDoc diff --git a/docs/control/Warps.html b/docs/control/Warps.html index cbf6f350..1a650f00 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -1414,7 +1414,7 @@ generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 303654a1..37d28eb4 100644 --- a/docs/core/Commands.html +++ b/docs/core/Commands.html @@ -1973,7 +1973,7 @@ generated by LDoc diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html index b1578aa4..e4c5c30d 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -2747,7 +2747,7 @@ Common.table_insert(tbl,50,tbl2) generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index b348ff81..67827252 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -762,7 +762,7 @@ Gui.new_concept('button') -- W : - (SpritePath) + (SpritePath) upto three sprites in the order: default, hovered, clicked @@ -5611,7 +5611,7 @@ Gui.get_concept('CustomButton') generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index 81649b1b..6095d508 100644 --- a/docs/core/Permissions-Groups.html +++ b/docs/core/Permissions-Groups.html @@ -1433,7 +1433,7 @@ generated by LDoc diff --git a/docs/core/Roles.html b/docs/core/Roles.html index 7edbaf8f..3e6a7fa4 100644 --- a/docs/core/Roles.html +++ b/docs/core/Roles.html @@ -3153,7 +3153,7 @@ generated by LDoc diff --git a/docs/core/Store.html b/docs/core/Store.html index f5a25b75..6fd3ab97 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -269,6 +269,11 @@ Store.register(team_scores,function(value,key) -- 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) + +-- 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) @@ -328,7 +333,7 @@ Store.register(team_scores,function(value,key) 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 +this is similar to Store.get but will always return a table even if it is empty is_registered(location) @@ -539,6 +544,14 @@ Store.register(team_scores,function(value,key) + 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)
@@ -613,6 +626,10 @@ Store.register(team_scores,function(value,key) + 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')
@@ -737,6 +754,10 @@ Store.register(team_scores,function(value,key) + 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!')
@@ -821,6 +842,21 @@ Store.register(team_scores,function(value,key) + 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)
@@ -888,6 +924,15 @@ Store.register(team_scores,function(value,key) + 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)
@@ -979,6 +1024,10 @@ Store.register(team_scores,function(value,key) + Usage: +
-- Clear the data at a location
+Store.clear(store_id_no_keys)
+Store.clear(store_id_with_keys,'key_one')
@@ -993,7 +1042,7 @@ Store.register(team_scores,function(value,key)

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

+this is similar to Store.get but will always return a table even if it is empty

@@ -1037,6 +1086,9 @@ Store.register(team_scores,function(value,key) + Usage: +
-- Get all keys at a store location
+local keys = Store.get_keys(store_id_with_keys)
@@ -1094,6 +1146,9 @@ Store.register(team_scores,function(value,key) + Usage: +
-- Check that a store is registered
+local registerd = Store.is_registered(store_id)
@@ -1128,6 +1183,9 @@ Store.register(team_scores,function(value,key) + Usage: +
-- Get a new unique store id
+local store_id = Store.uid_location()
@@ -1146,7 +1204,7 @@ Store.register(team_scores,function(value,key) generated by LDoc
diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 2b9a66e1..9f4c83f9 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -545,7 +545,7 @@ generated by LDoc diff --git a/docs/core/Toolbar.html b/docs/core/Toolbar.html index 0bcff3f0..2db838da 100644 --- a/docs/core/Toolbar.html +++ b/docs/core/Toolbar.html @@ -1185,6 +1185,7 @@ 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{ @@ -1205,6 +1206,7 @@ Gui.new_concept('toolbar-frame') } end end) + :on_update(function(event) local list_area = event.element.scroll list_area.clear() @@ -1658,7 +1660,7 @@ Gui.new_concept('toolbar-frame') generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index 51a5f3f6..e80e3022 100644 --- a/docs/guis/Player-List.html +++ b/docs/guis/Player-List.html @@ -627,7 +627,7 @@ generated by LDoc diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html index 5411b5a9..65b15a82 100644 --- a/docs/guis/Rocket-Info.html +++ b/docs/guis/Rocket-Info.html @@ -630,7 +630,7 @@ generated by LDoc diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html index 84d8d3c0..567731c0 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -450,7 +450,7 @@ generated by LDoc diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 576dcf2c..28d1ef22 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -633,7 +633,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index a0ee7c7d..91e2640e 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -838,7 +838,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index 2e6ac538..a2c82dd5 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/control.html b/docs/modules/control.html index b3ca5cec..4fb5d84e 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -352,7 +352,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index 974e41a8..de092da3 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -420,7 +420,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on generated by LDoc diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html index b5e42e86..7087a571 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -1165,7 +1165,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index e41f95c7..1d9e7fdc 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -655,7 +655,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index 1de42342..c4da3636 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -324,7 +324,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index fd2fb48b..bc1f5698 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -1293,7 +1293,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index c23f367c..b53537ea 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -435,7 +435,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index 38b0f253..b74b9490 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -354,7 +354,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index 2900f85f..59449178 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index 28ec9697..9a60f448 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -753,7 +753,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index 5be2d399..eaec6291 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -1419,7 +1419,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index 35fb4414..e853536f 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -652,7 +652,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index f85b4c01..97e2409e 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -443,7 +443,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index 7d2d1e66..219ecba4 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -790,7 +790,7 @@ Public License instead of this License. But first, please read generated by LDoc diff --git a/docs/topics/readme.md.html b/docs/topics/readme.md.html index 6257b341..24b2d167 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -334,7 +334,7 @@ generated by LDoc diff --git a/expcore/gui/concepts/button.lua b/expcore/gui/concepts/button.lua index 604e30c2..4cbcc6cd 100644 --- a/expcore/gui/concepts/button.lua +++ b/expcore/gui/concepts/button.lua @@ -14,7 +14,7 @@ local Gui = require 'expcore.gui.core' @tparam ?string|Concepts.LocalisedString caption the message that is shown on the button @tparam ?string|Concepts.LocalisedString tooltip the tooltip that shows when a player hovers over the button -@tparam SpritePath sprite upto three sprites in the order: default, hovered, clicked +@tparam Concepts.SpritePath sprite upto three sprites in the order: default, hovered, clicked @usage-- Making a basic button local basic_button = diff --git a/expcore/store.lua b/expcore/store.lua index d0b4dcbd..5d3f80ce 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -40,6 +40,11 @@ Store.register(team_scores,true,function(value,key) game.print('Team '..key..' now has a score of '..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) + ]] local Global = require 'utils.global' --- @dep utils.global @@ -67,11 +72,19 @@ local function error_not_table(value) end end ---- Registers a new location with an update callback which is triggered when the value updates --- @tparam[opt] string location string a unique that points to the data, string used rather than token to allow migration --- @tparam[opt=false] boolean synced when true will output changes to a file so it can be synced --- @tparam[opt] function callback when given the callback will be automatically registered to the update of the value --- @treturn string the location that is being used +--[[-- Registers a new location with an update callback which is triggered when the value updates +@tparam[opt] string location string a unique that points to the data, string used rather than token to allow migration +@tparam[opt=false] boolean synced when true will output changes to a file so it can be synced +@tparam[opt] function callback when given the callback will be automatically registered to the update of the value +@treturn string the location that is being used +@usage-- Registering a new store location +local store_id = Store.register() +@usage-- 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) +]] function Store.register(location,synced,callback) if _LIFECYCLE ~= _STAGE.control then return error('Can only be called during the control stage', 2) @@ -99,10 +112,14 @@ function Store.register(location,synced,callback) return location end ---- Gets the value stored at a location, this location must be registered --- @tparam string location the location to get the data from --- @tparam[opt] string key the key location if used --- @treturn any the data which was stored at the location +--[[-- Gets the value stored at a location, this location must be registered +@tparam string location the location to get the data from +@tparam[opt] string key the key location if used +@treturn any the data which was stored at the location +@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') +]] function Store.get(location,key) if not Store.registered[location] then return error('Location is not registered', 2) @@ -117,13 +134,17 @@ function Store.get(location,key) return data end ---- Sets the value at a location, this location must be registered --- @tparam string location the location to set the data to --- @tparam[opt] string key the key location if used --- @tparam any value the new value to set at the location, value may be reverted if there is a watch callback, cant be nil --- @tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file --- @tparam[opt=false] boolean from_internal set this true to add one to the error stack offset --- @treturn boolean true if it was successful +--[[-- Sets the value at a location, this location must be registered +@tparam string location the location to set the data to +@tparam[opt] string key the key location if used +@tparam any value the new value to set at the location, value may be reverted if there is a watch callback, cant be nil +@tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file +@tparam[opt=false] boolean from_internal set this true to add one to the error stack offset +@treturn boolean true if it was successful +@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!') +]] function Store.set(location,key,value,from_sync,from_internal) if not Store.registered[location] then return error('Location is not registered', from_internal and 3 or 2) @@ -157,10 +178,25 @@ function Store.set(location,key,value,from_sync,from_internal) return true end ---- Allows for updating a value based on the current value; only valid way to change tables in a store --- @tparam string location the location to set the data to --- @tparam[opt] string key the key location if required --- @tparam[opt] function update_callback the function called to update the value stored, rtn value to set new value +--[[-- Allows for updating a value based on the current value; only valid way to change tables in a store +@tparam string location the location to set the data to +@tparam[opt] string key the key location if required +@tparam[opt] function update_callback the function called to update the value stored, rtn value to set new value +@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) +@usage-- 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) +]] function Store.update(location,key,update_callback,...) local value = Store.get(location,key) @@ -194,9 +230,18 @@ function Store.update(location,key,update_callback,...) end ---- Allows for updating all values at a location based on the current value; only valid way to change tables in a store --- @tparam string location the location to set the data to --- @tparam[opt] function update_callback the function called to update the value stored +--[[-- Allows for updating all values at a location based on the current value; only valid way to change tables in a store +@tparam string location the location to set the data to +@tparam[opt] function update_callback the function called to update the value stored +@usage-- Updating all values at a location +Store.update(store_id_with_keys,function(value) + return value + 1 +end) +@usage-- Updating all tables at a location +Store.update(store_id_with_keys,function(value) + value.ctn = value.ctn + 1 +end) +]] function Store.update_all(location,update_callback,...) local data = Store.get(location) @@ -223,11 +268,15 @@ function Store.update_all(location,update_callback,...) end ---- Sets the value at a location to nil, this location must be registered --- @tparam string location the location to set the data to --- @tparam[opt] string key the key location if used --- @tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file --- @treturn boolean true if it was successful +--[[-- Sets the value at a location to nil, this location must be registered +@tparam string location the location to set the data to +@tparam[opt] string key the key location if used +@tparam[opt=false] boolean from_sync set this true to avoid an output to the sync file +@treturn boolean true if it was successful +@usage-- Clear the data at a location +Store.clear(store_id_no_keys) +Store.clear(store_id_with_keys,'key_one') +]] function Store.clear(location,key,from_sync) if not Store.callbacks[location] then return error('Location is not registered', 2) @@ -252,24 +301,33 @@ function Store.clear(location,key,from_sync) return true end ---- 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 --- @tparam string location the location to get the keys of --- @treturn table a table containing all the keys names +--[[-- 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 +@tparam string location the location to get the keys of +@treturn table a table containing all the keys names +@usage-- Get all keys at a store location +local keys = Store.get_keys(store_id_with_keys) +]] function Store.get_keys(location) local data = Store.get(location) return type(data) == 'table' and table_keys(data) or {} end ---- Check for if a location is registered --- @tparam string location the location to test for --- @treturn boolean true if registered +--[[-- Check for if a location is registered +@tparam string location the location to test for +@treturn boolean true if registered +@usage-- Check that a store is registered +local registerd = Store.is_registered(store_id) +]] function Store.is_registered(location) return Store.registered[location] end ---- Returns a unique name that can be used for a store --- @treturn string a unique name +--[[-- Returns a unique name that can be used for a store +@treturn string a unique name +@usage-- Get a new unique store id +local store_id = Store.uid_location() +]] function Store.uid_location() return tostring(Token.uid()) end diff --git a/expcore/toolbar.lua b/expcore/toolbar.lua index d30ee06f..da1b5d16 100644 --- a/expcore/toolbar.lua +++ b/expcore/toolbar.lua @@ -102,13 +102,16 @@ end --[[-- The base element to be used with the toolbar, others can be used but this is recomented @element toolbar-button + @tparam string permission_alias 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) + ]] Toolbar.button = Gui.new_concept('button') @@ -176,16 +179,20 @@ end --[[-- The base toolbar frame, others can be used but this is recomented @element toolbar-frame + @param on_update fired when the frame is to have its content updated + @tparam boolean open_by_default weather the frame should be open when a player first joins @tparam boolean use_container true by default and will place a container inside the frame for content @tparam string direction 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{ @@ -206,6 +213,7 @@ Gui.new_concept('toolbar-frame') } end end) + :on_update(function(event) local list_area = event.element.scroll list_area.clear() @@ -217,6 +225,7 @@ end) } end end) + ]] Toolbar.frame = Gui.new_concept('toolbar-button')