diff --git a/config/_file_loader.lua b/config/_file_loader.lua index 7629b905..fa73ff34 100644 --- a/config/_file_loader.lua +++ b/config/_file_loader.lua @@ -40,7 +40,7 @@ return { 'modules.addons.chat-reply', -- GUI --'modules.gui.rocket-info', - --'modules.gui.science-info', + 'modules.gui.science-info', 'modules.gui.warp-list', 'modules.gui.task-list', --'modules.gui.player-list', diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html index a94550d3..e06593f6 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 5104f56d..7cb0c9b2 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 12b2d4b7..6c368f68 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 eda52288..135ff83a 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 a9885689..df0b8737 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 20304e86..4f94aece 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 b5db145a..12bccc87 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 b6c03a49..0682c770 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 8a822e46..8ecf95bf 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 1beb5873..84ea1706 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 0545406e..9cd696ab 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 2cd5e62f..7967ea77 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 7ed81faf..f0b1fc7b 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 9fe4825c..680b91e8 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 d14c747d..7026f517 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 c774d4d6..6667e00b 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 5eae53a7..e95e5332 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 b69015ea..deb9aa2a 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 4f5e97b4..e9b13bfd 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 5f0aa397..89212f3b 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 15d03b28..2c670b45 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 d857f4de..f6e57348 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 a1e124e2..59c4534a 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 d81a5601..6c90fe3f 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 89d221c1..004ec4bd 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 68d1dbac..2f71921c 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 e76ebc00..ba0318c7 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 ae86a1c8..fda9f645 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 1308a173..9cf7157a 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 3766b23a..e9131888 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 f6b81295..ac587916 100644 --- a/docs/commands/Warnings.html +++ b/docs/commands/Warnings.html @@ -569,7 +569,7 @@ generated by LDoc diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html index edadff82..75ce3491 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 93bd8e14..cc4d5595 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 0dda65b9..d7ae726a 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 82cc7f4b..4a48d6da 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 f4b77ef8..ed1c5b7f 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 d72f5edf..e72d1a81 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 00353bdc..f9d62d80 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 5cd6e37d..d1d21e74 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 c1e53996..7dc0e1b5 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 e345fe69..ab9a69db 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 27950dfa..40ee9ed3 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 9f00aa0c..11aeb9af 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 c794811b..6329eb61 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 ae73091b..2d23727d 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 6251d78c..2c6dc312 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 c39118c6..bf97ecf9 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 af464cc2..3fd3eca5 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 858ae123..82dcaa12 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 d8c76b79..a318f0cd 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 f08ad41d..c324a6ac 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 0abe99c3..f5dca812 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 5c8300dc..f011372b 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 46f1ca96..fac7d663 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 4b21194e..4e84ef99 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 e1fb3569..09b6a980 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 723c7258..0353eba6 100644 --- a/docs/configs/Warps.html +++ b/docs/configs/Warps.html @@ -311,7 +311,7 @@

-

the amount of smoothing applied to updates to the cooldown timer, higher is better

+

the amount of smoothing applied to updates to the cooldown timer, higher is better, max is 60

@@ -774,7 +774,7 @@ generated by LDoc
diff --git a/docs/control/Jail.html b/docs/control/Jail.html index 65aeb8d0..4f02fcb1 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 252850bf..301380da 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 c722290a..349a872c 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 b53870c6..2f5efd39 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 64a3b413..440f1c35 100644 --- a/docs/control/Tasks.html +++ b/docs/control/Tasks.html @@ -998,7 +998,7 @@ Tasks.update_task(task_id,'We need more iron!',game. generated by LDoc diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html index 31e9150f..32c13b69 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 6580b84a..5a52b7df 100644 --- a/docs/control/Warps.html +++ b/docs/control/Warps.html @@ -1563,7 +1563,7 @@ Warps.make_warp_tag(warp_id) generated by LDoc diff --git a/docs/core/Commands.html b/docs/core/Commands.html index 3a2e7a33..26e2e30e 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 dab10ae9..6b2cd701 100644 --- a/docs/core/Common-Library.html +++ b/docs/core/Common-Library.html @@ -2746,7 +2746,7 @@ Common.table_insert(tbl,50,tbl2) generated by LDoc diff --git a/docs/core/Gui.html b/docs/core/Gui.html index 21d1c537..72fc7784 100644 --- a/docs/core/Gui.html +++ b/docs/core/Gui.html @@ -2851,7 +2851,7 @@ Gui.element{ generated by LDoc diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html index bf67317a..dc36167e 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 3beabbe4..25ceecf4 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 5cf287d0..fd876dbc 100644 --- a/docs/core/Store.html +++ b/docs/core/Store.html @@ -1481,7 +1481,7 @@ Store.set(player_scores,game.player,10) generated by LDoc diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html index 479ac70d..27c2542b 100644 --- a/docs/core/Sudo.html +++ b/docs/core/Sudo.html @@ -544,7 +544,7 @@ generated by LDoc diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html index be347756..0dbdaafd 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 2c0e4c87..3de18001 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 3ba61f51..5d2fbcd2 100644 --- a/docs/guis/Science-Info.html +++ b/docs/guis/Science-Info.html @@ -247,6 +247,9 @@ expcore.gui + expcore.gui + + utils.event @@ -267,8 +270,20 @@ - science_info - Registers the science info + production_label + Data label that contains the value and the surfix + + + science_pack_base + Adds 4 elements that show the data for a science pack + + + task_list_container + Main task list container for the left flow + + + task_list_toggle + Button on the top flow used to toggle the task list container @@ -297,6 +312,31 @@ + + + + + + + +
+
+
+ # + expcore.gui +
+
+
+
+ + + + + + + + + @@ -410,14 +450,95 @@
- # - science_info + # + production_label
-

Registers the science info

+

Data label that contains the value and the surfix

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + science_pack_base +
+
+
+
+ +

Adds 4 elements that show the data for a science pack

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + task_list_container +
+
+
+
+ +

Main task list container for the left flow

+

+ + + + + + + + + + + + + + +
+
+
+
+ # + task_list_toggle +
+
+
+
+ +

Button on the top flow used to toggle the task list container

@@ -449,7 +570,7 @@ generated by LDoc
diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html index 6136165e..8e546493 100644 --- a/docs/guis/Task-List.html +++ b/docs/guis/Task-List.html @@ -756,7 +756,7 @@ generated by LDoc diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html index db64af56..2f4ac049 100644 --- a/docs/guis/Warps-List.html +++ b/docs/guis/Warps-List.html @@ -961,7 +961,7 @@ generated by LDoc diff --git a/docs/index.html b/docs/index.html index 6154fead..2b553d42 100644 --- a/docs/index.html +++ b/docs/index.html @@ -511,7 +511,7 @@ see ./expcore/commands.lua for more details generated by LDoc diff --git a/docs/modules/control.html b/docs/modules/control.html index a712091a..4fc84050 100644 --- a/docs/modules/control.html +++ b/docs/modules/control.html @@ -351,7 +351,7 @@ generated by LDoc diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html index 3ffd68e8..fdb538e2 100644 --- a/docs/modules/utils.alien_evolution_progress.html +++ b/docs/modules/utils.alien_evolution_progress.html @@ -419,7 +419,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 48b74c3f..c94a85ca 100644 --- a/docs/modules/utils.core.html +++ b/docs/modules/utils.core.html @@ -1164,7 +1164,7 @@ generated by LDoc diff --git a/docs/modules/utils.debug.html b/docs/modules/utils.debug.html index b34baf22..d9fc0fa5 100644 --- a/docs/modules/utils.debug.html +++ b/docs/modules/utils.debug.html @@ -654,7 +654,7 @@ generated by LDoc diff --git a/docs/modules/utils.dump_env.html b/docs/modules/utils.dump_env.html index 42ee92fc..1a275d2f 100644 --- a/docs/modules/utils.dump_env.html +++ b/docs/modules/utils.dump_env.html @@ -323,7 +323,7 @@ generated by LDoc diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html index f851a4f8..0613535f 100644 --- a/docs/modules/utils.event.html +++ b/docs/modules/utils.event.html @@ -1292,7 +1292,7 @@ generated by LDoc diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html index aed7f3cf..4714e6ed 100644 --- a/docs/modules/utils.event_core.html +++ b/docs/modules/utils.event_core.html @@ -434,7 +434,7 @@ generated by LDoc diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html index f72252fd..24562934 100644 --- a/docs/modules/utils.math.html +++ b/docs/modules/utils.math.html @@ -353,7 +353,7 @@ generated by LDoc diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html index 20e6ef12..11b985c3 100644 --- a/docs/modules/utils.recipe_locker.html +++ b/docs/modules/utils.recipe_locker.html @@ -441,7 +441,7 @@ generated by LDoc diff --git a/docs/modules/utils.state_machine.html b/docs/modules/utils.state_machine.html index 9fe3a7ae..0166e736 100644 --- a/docs/modules/utils.state_machine.html +++ b/docs/modules/utils.state_machine.html @@ -752,7 +752,7 @@ generated by LDoc diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html index d7c02aa1..f5c0e283 100644 --- a/docs/modules/utils.table.html +++ b/docs/modules/utils.table.html @@ -1418,7 +1418,7 @@ generated by LDoc diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html index dda2c43f..4d025c24 100644 --- a/docs/modules/utils.task.html +++ b/docs/modules/utils.task.html @@ -651,7 +651,7 @@ generated by LDoc diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html index 98b6d7f3..ffcfd375 100644 --- a/docs/modules/utils.timestamp.html +++ b/docs/modules/utils.timestamp.html @@ -442,7 +442,7 @@ generated by LDoc diff --git a/docs/topics/license.html b/docs/topics/license.html index 2d42a575..6d78546c 100644 --- a/docs/topics/license.html +++ b/docs/topics/license.html @@ -789,7 +789,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 4284e0e5..488a3235 100644 --- a/docs/topics/readme.md.html +++ b/docs/topics/readme.md.html @@ -338,7 +338,7 @@ Please report these errors to [the issues page](issues). generated by LDoc diff --git a/modules/gui/science-info.lua b/modules/gui/science-info.lua index 9ecce6e2..a3d74b33 100644 --- a/modules/gui/science-info.lua +++ b/modules/gui/science-info.lua @@ -5,6 +5,7 @@ ]] local Gui = require 'expcore.gui' --- @dep expcore.gui +local Roles = require 'expcore.roles' --- @dep expcore.gui local Event = require 'utils.event' --- @dep utils.event local format_time = ext_require('expcore.common','format_time') --- @dep expcore.common local config = require 'config.science' --- @dep config.science @@ -13,275 +14,414 @@ local Production = require 'modules.control.production' --- @dep modules.control local null_time_short = {'science-info.eta-time',format_time(0,{hours=true,minutes=true,seconds=true,time=true,null=true})} local null_time_long = format_time(0,{hours=true,minutes=true,seconds=true,long=true,null=true}) ---[[ Generates the main structure for the gui - element - > container - >> header - >> scroll - >>> non_made - >>> table - >> footer (when eta is enabled) - >>> eta-label - >>> eta - >>>> label -]] -local function generate_container(element) - Gui.set_padding(element,1,2,2,2) - element.style.minimal_width = 200 +--- Data label that contains the value and the surfix +-- @element production_label +local production_label = +Gui.element(function(_,parent,production_label_data) + local name = production_label_data.name + local tooltip = production_label_data.tooltip + local color = production_label_data.color - -- main container which contains the other elements - local container = - element.add{ - name='container', - type='frame', - direction='vertical', - style='window_content_frame_packed' + -- Add an alignment for the number + local alignment = Gui.alignment(parent,nil,nil,name) + + -- Add the main value label + local element = + alignment.add{ + name = 'label', + type = 'label', + caption = production_label_data.caption, + tooltip = tooltip } - Gui.set_padding(container) - -- main header for the gui - Gui.create_header( + -- Change the style + element.style.font_color = color + + -- Add the surfix label + local surfix_element = + parent.add{ + name = 'surfix-'..name, + type = 'label', + caption = {'science-info.unit',production_label_data.surfix}, + tooltip = tooltip + } + + -- Change the style + surfix_element.style.font_color = color + + -- Return the value label + return element +end) + +-- Get the data that is used with the production label +local function get_production_label_data(name,tooltip,value,secondary) + local data_colour = Production.get_color(config.color_clamp, value, secondary) + local surfix,caption = Production.format_number(value) + + return { + name = name, + caption = caption, + surfix = surfix, + tooltip = tooltip, + color = data_colour + } +end + +-- Updates a prodution label to match the current data +local function update_production_label(parent,production_label_data) + local name = production_label_data.name + local tooltip = production_label_data.tooltip + local color = production_label_data.color + + -- Update the production label + local production_label_element = parent[name] and parent[name].label or production_label(parent,production_label_data) + production_label_element.caption = production_label_data.caption + production_label_element.tooltip = production_label_data.tooltip + production_label_element.style.font_color = color + + -- Update the surfix label + local surfix_element = parent['surfix-'..name] + surfix_element.caption = {'science-info.unit',production_label_data.surfix} + surfix_element.tooltip = tooltip + surfix_element.style.font_color = color + +end + +--- Adds 4 elements that show the data for a science pack +-- @element science_pack_base +local science_pack_base = +Gui.element(function(_,parent,science_pack_data) + local science_pack = science_pack_data.science_pack + + -- Draw the icon for the science pack + local icon_style = science_pack_data.icon_style + local pack_icon = + parent.add{ + name = 'icon-'..science_pack, + type = 'sprite-button', + sprite = 'item/'..science_pack, + tooltip = {'item-name.'..science_pack}, + style = icon_style + } + + -- Change the style of the icon + local pack_icon_style = pack_icon.style + pack_icon_style.height = 55 + if icon_style == 'quick_bar_slot_button' then + pack_icon_style.padding = {0,-2} + pack_icon_style.width = 36 + end + + -- Draw the delta flow + local delta_flow = + parent.add{ + name = 'delta-'..science_pack, + type = 'frame', + style = 'bordered_frame' + } + + -- Change the style of the delta flow + delta_flow.style.padding = {0,3} + + -- Draw the delta flow table + local delta_table = + delta_flow.add{ + name = 'table', + type = 'table', + column_count = 2 + } + + -- Change the style of the delta flow table + delta_table.style.padding = 0 + + -- Draw the production labels + update_production_label(delta_table,science_pack_data.positive) + update_production_label(delta_table,science_pack_data.negative) + update_production_label(parent,science_pack_data.net) + + -- Return the pack icon + return pack_icon +end) + +local function get_science_pack_data(player,science_pack) + local force = player.force + + -- Check that some packs have been made + local total = Production.get_production_total(force, science_pack) + local minute = Production.get_production(force, science_pack, defines.flow_precision_index.one_minute) + if total.made == 0 then + return + end + + -- Get the icon style + local icon_style = 'quick_bar_slot_button' + local flux = Production.get_fluctuations(force, science_pack, defines.flow_precision_index.one_minute) + if minute.net > 0 and flux.net > -config.color_flux/2 then + icon_style = 'green_slot_button' + elseif flux.net < -config.color_flux then + icon_style = 'red_slot_button' + elseif minute.made > 0 then + icon_style = 'selected_slot_button' + end + + -- Return the pack data + return { + science_pack = science_pack, + icon_style = icon_style, + positive = get_production_label_data( + 'pos-'..science_pack, + {'science-info.pos-tooltip', total.made}, + minute.made + ), + negative = get_production_label_data( + 'neg-'..science_pack, + {'science-info.neg-tooltip', total.used}, + -minute.used + ), + net = get_production_label_data( + 'net-'..science_pack, + {'science-info.net-tooltip', total.net}, + minute.net, + minute.made+minute.used + ) + } + +end + +local function update_science_pack(pack_table,science_pack_data) + if not science_pack_data then return end + local science_pack = science_pack_data.science_pack + pack_table.parent.non_made.visible = false + + -- Update the icon + local pack_icon = pack_table['icon-'..science_pack] or science_pack_base(pack_table,science_pack_data) + local icon_style = science_pack_data.icon_style + pack_icon.style = icon_style + + local pack_icon_style = pack_icon.style + pack_icon_style.height = 55 + if icon_style == 'quick_bar_slot_button' then + pack_icon_style.padding = {0,-2} + pack_icon_style.width = 36 + end + + -- Update the production labels + local delta_table = pack_table['delta-'..science_pack].table + update_production_label(delta_table,science_pack_data.positive) + update_production_label(delta_table,science_pack_data.negative) + update_production_label(pack_table,science_pack_data.net) + +end + +--- Gets the data that is used with the eta label +local function get_eta_label_data(player) + local force = player.force + + -- If there is no current research then return no research + local research = force.current_research + if not research then + return { research = false } + end + + local progress = force.research_progress + local remaining = research.research_unit_count*(1-progress) + local limit + + -- Check for the limiting science pack + for _,ingredient in pairs(research.research_unit_ingredients) do + local pack_name = ingredient.name + local required = ingredient.amount * remaining + local time = Production.get_consumsion_eta(force, pack_name, defines.flow_precision_index.one_minute, required) + if not limit or limit < time then + limit = time + end + end + + -- Return the caption and tooltip + return limit and limit > 0 and { + research = true, + caption = format_time(limit,{hours=true,minutes=true,seconds=true,time=true}), + tooltip = format_time(limit,{hours=true,minutes=true,seconds=true,long=true}) + } or { research = false } + +end + +-- Updates the eta label +local function update_eta_label(element,eta_label_data) + -- If no research selected show null + if not eta_label_data.research then + element.caption = null_time_short + element.tooltip = null_time_long + return + end + + -- Update the element + element.caption = {'science-info.eta-time',eta_label_data.caption} + element.tooltip = eta_label_data.tooltip +end + +--- Main task list container for the left flow +-- @element task_list_container +local science_info_container = +Gui.element(function(event_trigger,parent) + local player = Gui.get_player_from_element(parent) + + -- Draw the external container + local frame = + parent.add{ + name = event_trigger, + type = 'frame' + } + + -- Set the frame style + local frame_style = frame.style + frame_style.padding = 2 + frame_style.minimal_width = 200 + + -- Draw the internal container + local container = + frame.add{ + name = 'container', + type = 'frame', + direction = 'vertical', + style = 'window_content_frame_packed' + } + + -- Set the container style + local style = container.style + style.vertically_stretchable = false + + -- Draw the header + Gui.header( container, {'science-info.main-caption'}, {'science-info.main-tooltip'} ) - -- table that stores all the data - local flow_table = Gui.create_scroll_table(container,4,185) + -- Draw the scroll table for the tasks + local scroll_table = Gui.scroll_table(container,185,4) - -- message to say that you have not made any packs yet - local non_made = - flow_table.parent.add{ - name='non_made', - type='label', - caption={'science-info.no-packs'} + -- Draw the no packs label + local no_packs_label = + scroll_table.parent.add{ + name = 'non_made', + type = 'label', + caption = {'science-info.no-packs'} } - non_made.style.width = 200 - non_made.style.single_line = false - local eta + -- Change the style of the no packs label + local no_packs_style = no_packs_label.style + no_packs_style.padding = {2,4} + no_packs_style.single_line = false + no_packs_style.width = 200 + + -- Add the footer and eta if config.show_eta then - -- footer used to store the eta - local footer = - container.add{ - name='footer', - type='frame', - style='subheader_frame' - } - Gui.set_padding(footer,2,2,4,4) - footer.style.horizontally_stretchable = true + -- Draw the footer + local footer = Gui.header( + container, + {'science-info.eta-caption'}, + {'science-info.eta-tooltip'}, + true, + 'footer' + ) - -- label for the footer + -- Set the style + footer.parent.style = 'subheader_frame' + local footer_style = footer.parent.style + footer_style.padding = {2,4} + footer_style.use_header_filler = false + footer_style.horizontally_stretchable = true + + -- Draw the eta label + local eta_label = footer.add{ - name='eta-label', - type='label', - caption={'science-info.eta-caption'}, - tooltip={'science-info.eta-tooltip'}, - style='heading_1_label' + name = 'label', + type = 'label', + caption = null_time_short, + tooltip = null_time_long, + style = 'heading_1_label' } - -- data for the footer - local right_align = Gui.create_alignment(footer,'eta') - eta = - right_align.add{ - name='label', - type='label', - caption=null_time_short, - tooltip=null_time_long, - style='heading_1_label' - } + -- Update the eta + update_eta_label(eta_label,get_eta_label_data(player)) + end - return flow_table, eta -end - ---[[ Adds two labels where one is right aligned and the other is a unit - element - > "name" - >> label - > spm-"name" -]] -local function add_data_label(element,name,value,secondary,tooltip) - local data_colour = Production.get_color(config.color_clamp, value, secondary) - local surfix,caption = Production.format_number(value) - - if element[name] then - local data = element[name].label - data.caption = caption - data.tooltip = tooltip - data.style.font_color = data_colour - local label = element['spm-'..name] - label.caption = {'science-info.unit',surfix} - label.tooltip = tooltip - label.style.font_color = data_colour - - else - -- right aligned number - local right_align = Gui.create_alignment(element,name) - local data = - right_align.add{ - name='label', - type='label', - caption=caption, - tooltip=tooltip - } - data.style.font_color = data_colour - - -- adds the unit onto the end - local label = - element.add{ - name='spm-'..name, - type='label', - caption={'science-info.unit',surfix}, - tooltip=tooltip - } - label.style.font_color = data_colour - end -end - ---[[ Adds a science pack to the list - element - > icon-"science_pack" - > delta-"science_pack" - >> table - >>> pos-"science_pack" (add_data_label) - >>> neg-"science_pack" (add_data_label) - > net-"science_pack" (add_data_label) -]] -local function generate_science_pack(player,element,science_pack) - local total = Production.get_production_total(player.force, science_pack) - local minute = Production.get_production(player.force, science_pack, defines.flow_precision_index.one_minute) - if total.made > 0 then - element.parent.non_made.visible = false - - local icon_style = 'quick_bar_slot_button' - local flux = Production.get_fluctuations(player.force, science_pack, defines.flow_precision_index.one_minute) - if flux.net > -config.color_flux/2 then - icon_style = 'green_slot_button' - elseif flux.net < -config.color_flux then - icon_style = 'red_slot_button' - elseif minute.made > 0 then - icon_style = 'selected_slot_button' - end - - local icon = element['icon-'..science_pack] - - if icon then - icon.style = icon_style - icon.style.height = 55 - if icon_style == 'quick_bar_slot_button' then - icon.style.width = 36 - Gui.set_padding(icon,0,0,-2,-2) - end - - else - icon = - element.add{ - name='icon-'..science_pack, - type='sprite-button', - sprite='item/'..science_pack, - tooltip={'item-name.'..science_pack}, - style=icon_style - } - icon.style.height = 55 - if icon_style == 'quick_bar_slot_button' then - icon.style.width = 36 - Gui.set_padding(icon,0,0,-2,-2) - end - - end - - local delta = element['delta-'..science_pack] - - if not delta then - delta = - element.add{ - name='delta-'..science_pack, - type='frame', - style='bordered_frame' - } - Gui.set_padding(delta,0,0,3,3) - - local delta_table = - delta.add{ - name='table', - type='table', - column_count=2 - } - Gui.set_padding(delta_table) - end - - add_data_label(delta.table,'pos-'..science_pack,minute.made,nil,{'science-info.pos-tooltip',total.made}) - add_data_label(delta.table,'neg-'..science_pack,-minute.used,nil,{'science-info.neg-tooltip',total.used}) - add_data_label(element,'net-'..science_pack,minute.net,minute.made+minute.used,{'science-info.net-tooltip',total.net}) - end -end - ---- Updates the eta label that was created with generate_container -local function update_eta(player,element) - if not config.show_eta then return end - local force = player.force - local research = force.current_research - if not research then - element.caption = null_time_short - element.tooltip = null_time_long - - else - local progress = force.research_progress - local remaining = research.research_unit_count*(1-progress) - local limit - - local stats = player.force.item_production_statistics - for _,ingredient in pairs(research.research_unit_ingredients) do - local pack_name = ingredient.name - local required = ingredient.amount * remaining - local time = Production.get_consumsion_eta(force, pack_name, defines.flow_precision_index.one_minute, required) - if not limit or limit < time then - limit = time - end - end - - if not limit or limit == -1 then - element.caption = null_time_short - element.tooltip = null_time_long - - else - element.caption = {'science-info.eta-time',format_time(limit,{hours=true,minutes=true,seconds=true,time=true})} - element.tooltip = format_time(limit,{hours=true,minutes=true,seconds=true,long=true}) - - end - end -end - ---- Registers the science info --- @element science_info -local science_info = -Gui.new_left_frame('gui/science-info') -:set_sprites('entity/lab') -:set_direction('vertical') -:set_tooltip{'science-info.main-tooltip'} -:on_creation(function(player,element) - local table, eta = generate_container(element) - + -- Add packs which have been made for _,science_pack in ipairs(config) do - generate_science_pack(player,table,science_pack) + update_science_pack(scroll_table,get_science_pack_data(player,science_pack)) end - update_eta(player,eta) + -- Return the exteral container + return frame end) -:on_update(function(player,element) - local container = element.container - local table = container.scroll.table - local eta = container.footer.eta.label +:add_to_left_flow() - for _,science_pack in ipairs(config) do - generate_science_pack(player,table,science_pack) - end - - update_eta(player,eta) +--- Button on the top flow used to toggle the task list container +-- @element task_list_toggle +Gui.element{ + type = 'sprite-button', + sprite = 'entity/lab', + tooltip = {'science-info.main-tooltip'}, + style = Gui.top_flow_button_style +} +:style{ + padding = -2 +} +:add_to_top_flow(function(player) + return Roles.player_allowed(player,'gui/science-info') +end) +:on_click(function(player,_,_) + Gui.toggle_left_element(player, science_info_container) end) --- Updates the gui every 1 second -Event.on_nth_tick(60,science_info 'update_all') +Event.on_nth_tick(60,function() + local force_pack_data = {} + local force_eta_data = {} + for _,player in pairs(game.connected_players) do + local force_name = player.force.name + local left_flow = Gui.get_left_flow(player) + local frame = left_flow[science_info_container.name] + local container = frame.container -return science_info \ No newline at end of file + -- Update the science packs + local scroll_table = container.scroll.table + local pack_data = force_pack_data[force_name] + if not pack_data then + -- No data in chache so it needs to be generated + pack_data = {} + force_pack_data[force_name] = pack_data + for _,science_pack in ipairs(config) do + local next_data = get_science_pack_data(player,science_pack) + pack_data[science_pack] = next_data + update_science_pack(scroll_table,next_data) + end + + else + -- Data found in chache is no need to generate it + for _,next_data in ipairs(pack_data) do + update_science_pack(scroll_table,next_data) + end + + end + + -- Update the eta times + if not config.show_eta then return end + local eta_label = container.footer.alignment.label + local eta_data = force_eta_data[force_name] + if not eta_data then + -- No data in chache so it needs to be generated + eta_data = get_eta_label_data(player) + force_eta_data[force_name] = eta_data + update_eta_label(eta_label,eta_data) + + else + -- Data found in chache is no need to generate it + update_eta_label(eta_label,eta_data) + + end + + end +end) \ No newline at end of file