mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Added main gui file
This commit is contained in:
@@ -39,17 +39,18 @@ return {
|
|||||||
'modules.addons.discord-alerts',
|
'modules.addons.discord-alerts',
|
||||||
'modules.addons.chat-reply',
|
'modules.addons.chat-reply',
|
||||||
-- GUI
|
-- GUI
|
||||||
'modules.gui.rocket-info',
|
--'modules.gui.rocket-info',
|
||||||
'modules.gui.science-info',
|
--'modules.gui.science-info',
|
||||||
'modules.gui.warp-list',
|
--'modules.gui.warp-list',
|
||||||
'modules.gui.task-list',
|
--'modules.gui.task-list',
|
||||||
'modules.gui.player-list',
|
--'modules.gui.player-list',
|
||||||
'modules.commands.debug',
|
--'modules.commands.debug',
|
||||||
|
'expcore.gui',
|
||||||
-- Config Files
|
-- Config Files
|
||||||
'config.expcore-commands.auth_admin', -- commands tagged with admin_only are blocked for non admins
|
'config.expcore-commands.auth_admin', -- commands tagged with admin_only are blocked for non admins
|
||||||
'config.expcore-commands.auth_roles', -- commands must be allowed via the role config
|
'config.expcore-commands.auth_roles', -- commands must be allowed via the role config
|
||||||
'config.expcore-commands.auth_runtime_disable', -- allows commands to be enabled and disabled during runtime
|
'config.expcore-commands.auth_runtime_disable', -- allows commands to be enabled and disabled during runtime
|
||||||
'config.permission_groups', -- loads some predefined permission groups
|
'config.permission_groups', -- loads some predefined permission groups
|
||||||
'config.roles', -- loads some predefined roles
|
'config.roles', -- loads some predefined roles
|
||||||
'expcore.gui.test' -- loads multiple gui defines to test the gui system
|
--'expcore.gui.test' -- loads multiple gui defines to test the gui system
|
||||||
}
|
}
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -349,7 +349,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -376,7 +376,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -585,7 +585,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -349,7 +349,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -404,7 +404,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -460,7 +460,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -404,7 +404,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -320,7 +320,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -404,7 +404,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -376,7 +376,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -388,7 +388,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -500,7 +500,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -361,7 +361,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -388,7 +388,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -365,7 +365,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -404,7 +404,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -458,7 +458,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -416,7 +416,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -611,7 +611,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -389,7 +389,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -388,7 +388,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -321,7 +321,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -585,7 +585,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -557,7 +557,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -389,7 +389,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -443,7 +443,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -484,7 +484,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -569,7 +569,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -506,7 +506,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -237,7 +237,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -485,7 +485,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -294,7 +294,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -320,7 +320,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -442,7 +442,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -354,7 +354,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ see ./expcore/commands.lua for more details</p>
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -354,7 +354,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -416,7 +416,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -237,7 +237,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -240,7 +240,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -295,7 +295,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -812,7 +812,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -384,7 +384,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -414,7 +414,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -324,7 +324,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -414,7 +414,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -834,7 +834,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -292,7 +292,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -354,7 +354,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -388,7 +388,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -744,7 +744,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -384,7 +384,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -355,7 +355,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -684,7 +684,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1208,7 +1208,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1329,7 +1329,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1110,7 +1110,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -984,7 +984,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -998,7 +998,7 @@ Tasks.update_task(task_id,<span class="string">'We need more iron!'</span>,game.
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1465,7 +1465,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1563,7 +1563,7 @@ Warps.make_warp_tag(warp_id)</code></pre>
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1972,7 +1972,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2746,7 +2746,7 @@ Common.table_insert(tbl,<span class="number">50</span>,tbl2)</code></pre>
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
11143
docs/core/Gui.html
11143
docs/core/Gui.html
File diff suppressed because it is too large
Load Diff
@@ -1432,7 +1432,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3152,7 +3152,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1464,7 +1464,7 @@ Store.set(player_scores,game.player,<span class="number">10</span>) <span class=
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -544,7 +544,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -626,7 +626,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -629,7 +629,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -449,7 +449,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -632,7 +632,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -837,7 +837,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -57,10 +57,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="name"><a href="core/Gui.html">Gui</a></td>
|
<td class="name"><a href="core/Gui.html">Gui</a></td>
|
||||||
<td class="summary"><span>Core Module - Gui
|
<td class="summary"><span>Core Module - Gui
|
||||||
- This file is used to require all the different elements of the gui module
|
- Used to define new gui elements and gui event handlers</span></td>
|
||||||
- each module has an outline here but for more details see their separate files in ./gui
|
|
||||||
- please read the files for more documentation that cant be shown here
|
|
||||||
- please note there is a rework planned but not started</span></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name"><a href="core/Permissions-Groups.html">Permissions-Groups</a></td>
|
<td class="name"><a href="core/Permissions-Groups.html">Permissions-Groups</a></td>
|
||||||
@@ -514,7 +511,7 @@ see ./expcore/commands.lua for more details</span></td>
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -351,7 +351,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1164,7 +1164,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -654,7 +654,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -323,7 +323,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1292,7 +1292,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -434,7 +434,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -353,7 +353,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -441,7 +441,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -752,7 +752,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1418,7 +1418,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -651,7 +651,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -442,7 +442,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ Public License instead of this License. But first, please read
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -228,26 +228,29 @@
|
|||||||
</p>
|
</p>
|
||||||
<h1 align="center">ExpGaming Scenario Repository</h2>
|
<h1 align="center">ExpGaming Scenario Repository</h2>
|
||||||
<p>## Explosive Gaming
|
<p>## Explosive Gaming
|
||||||
<p>Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible with in our reset schedule. Although these server tend to the more experienced players our server are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in factorio (ExpGaming S1).
|
<p>Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on Factorio and games that follow similar ideas. Our Factorio server are known for hosting large maps with the main goal of being a "mega base" which can produce as much as possible within our reset schedule. Although these servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], [wiki], or in the public games tab in Factorio (ExpGaming S1, ExpGaming S2, etc.).
|
||||||
<p>## Use and Installation
|
<p>## Use and Installation
|
||||||
<p>1) Download this [git repository](https://github.com/explosivegaming/scenario/archive/master.zip) for the stable release. The dev branch can be found [here](https://github.com/explosivegaming/scenario/archive/dev.zip) for those who want the latest features. See [releases](#releases) for other release branches.
|
<p>1) Download this [git repository](https://github.com/explosivegaming/scenario/archive/master.zip) for the stable release. The dev branch can be found [here](https://github.com/explosivegaming/scenario/archive/dev.zip) for those who want the latest features. See [releases](#releases) for other release branches.
|
||||||
<p>2) Extract the downloaded zip file from the branch you downloaded into factorio's scenario directory:
|
<p>2) Extract the downloaded zip file from the branch you downloaded into Factorio's scenario directory:
|
||||||
* Windows: `%appdata%\Factorio\scenarios`
|
* Windows: `%appdata%\Factorio\scenarios`
|
||||||
* Linux: `~/.factorio/scenarios`
|
* Linux: `~/.factorio/scenarios`
|
||||||
<p>3) Within the scenario you can find `./config/_file_loader.lua` which contains a list of all the modules that will be loaded by the scenario; simply comment out (or remove) features you do not want but note that some modules may load other modules as dependencies even when removed from the list.
|
<p>3) Within the scenario you can find `./config/_file_loader.lua` which contains a list of all the modules that will be loaded by the scenario; simply comment out (or remove) features you do not want but note that some modules may load other modules as dependencies even when removed from the list.
|
||||||
<p>4) More advanced users may want to play with the other configs files within `./config` but please be aware that some of the config files will require a basic understanding of lua while others may just be a list of values.
|
<p>4) More advanced users may want to play with the other configs files within `./config` but please be aware that some of the config files will require a basic understanding of lua while others may just be a list of values.
|
||||||
<p>5) Once you have made any config changes that you wish to make open factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name.
|
<p>5) Once you have made any config changes that you wish to make open Factorio, select play, then start scenario (or host scenario from within multiplayer tab), and select the scenario which will be called `scenario-master` if you have downloaded the latest stable release and have not changed the folder name.
|
||||||
<p>6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash so if any features don't work as expected then it may be returning an error in the log, please report these errors to [the issues page](issues).
|
<p>6) The scenario will now load all the selected modules and start the map, any errors or exceptions raised in the scenario should not cause a game/server crash, so if any features do not work as expected then it may be returning an error in the log.
|
||||||
|
Please report these errors to [the issues page](issues).
|
||||||
<p>## Contributing
|
<p>## Contributing
|
||||||
<p>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:
|
<p>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:
|
||||||
<p>* New features should have the branch names: `feature/feature-name`
|
<p>* New features should have the branch names: `feature/feature-name`
|
||||||
* New features are merged into `dev` after it has been completed.
|
* New features are merged into `dev` after it has been completed, this can be done through a pull request.
|
||||||
* After a number of features have been added a release branch is made: `release/X.Y.0`; this branch should have no new features and only bug fixes or localization.
|
* After a number of features have been added a release branch is made: `release/X.Y.0`
|
||||||
* A release is merged into `master` on the following friday in time for the the weekly reset.
|
* Bug fixes and localization can be made to the release branch with a pull request rather than into dev.
|
||||||
* Patches may be named `patch/X.Y.Z` and fill be merged into `master` and `dev` when appropriate.
|
* A release is merged into `master` on the following friday after it is considered stable.
|
||||||
|
* Patches may be named `patch/X.Y.Z` and will be merged into `dev` and then `master` when appropriate.
|
||||||
<p>## Releases
|
<p>## Releases
|
||||||
<p>| Scenario Version* | Version Name | Factorio Version** |
|
<p>| Scenario Version* | Version Name | Factorio Version** |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
| [v5.10][s5.10] | Data Store Rewrite | [v0.17.71][f0.17.71] |
|
||||||
| [v5.9][s5.9] | Control Modules and Documentation | [v0.17.63][f0.17.63] |
|
| [v5.9][s5.9] | Control Modules and Documentation | [v0.17.63][f0.17.63] |
|
||||||
| [v5.8][s5.8] | Home and Chat Bot | [v0.17.47][f0.17.49] |
|
| [v5.8][s5.8] | Home and Chat Bot | [v0.17.47][f0.17.49] |
|
||||||
| [v5.7][s5.7] | Warp System | [v0.17.47][f0.17.47] |
|
| [v5.7][s5.7] | Warp System | [v0.17.47][f0.17.47] |
|
||||||
@@ -265,7 +268,8 @@
|
|||||||
| [v0.1][s0.1] | First Tracked Version | [v0.14][f0.14] |
|
| [v0.1][s0.1] | First Tracked Version | [v0.14][f0.14] |
|
||||||
<p>\* Scenario patch versions have been omitted.
|
<p>\* Scenario patch versions have been omitted.
|
||||||
<p>\*\* Factorio versions show the version they were made for, often the minimum requirement.
|
<p>\*\* Factorio versions show the version they were made for, often the minimum requirement.
|
||||||
<p>[s5.9]: https://github.com/explosivegaming/scenario/releases/tag/5.9.0
|
<p>[s5.10]: https://github.com/explosivegaming/scenario/releases/tag/5.10.0
|
||||||
|
[s5.9]: https://github.com/explosivegaming/scenario/releases/tag/5.9.0
|
||||||
[s5.8]: https://github.com/explosivegaming/scenario/releases/tag/5.8.0
|
[s5.8]: https://github.com/explosivegaming/scenario/releases/tag/5.8.0
|
||||||
[s5.7]: https://github.com/explosivegaming/scenario/releases/tag/5.7.0
|
[s5.7]: https://github.com/explosivegaming/scenario/releases/tag/5.7.0
|
||||||
[s5.6]: https://github.com/explosivegaming/scenario/releases/tag/5.6.0
|
[s5.6]: https://github.com/explosivegaming/scenario/releases/tag/5.6.0
|
||||||
@@ -280,7 +284,8 @@
|
|||||||
[s2.0]: https://github.com/explosivegaming/scenario/releases/tag/v2.0
|
[s2.0]: https://github.com/explosivegaming/scenario/releases/tag/v2.0
|
||||||
[s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0
|
[s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0
|
||||||
[s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1
|
[s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1
|
||||||
<p>[f0.17.63]: https://wiki.factorio.com/Version_history/0.17.0#0.17.63
|
<p>[f0.17.71]: https://wiki.factorio.com/Version_history/0.17.0#0.17.71
|
||||||
|
[f0.17.63]: https://wiki.factorio.com/Version_history/0.17.0#0.17.63
|
||||||
[f0.17.49]: https://wiki.factorio.com/Version_history/0.17.0#0.17.49
|
[f0.17.49]: https://wiki.factorio.com/Version_history/0.17.0#0.17.49
|
||||||
[f0.17.47]: https://wiki.factorio.com/Version_history/0.17.0#0.17.47
|
[f0.17.47]: https://wiki.factorio.com/Version_history/0.17.0#0.17.47
|
||||||
[f0.17.44]: https://wiki.factorio.com/Version_history/0.17.0#0.17.44
|
[f0.17.44]: https://wiki.factorio.com/Version_history/0.17.0#0.17.44
|
||||||
@@ -333,7 +338,7 @@
|
|||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-footer column col-9 col-sm-12">
|
<div class="content-footer column col-9 col-sm-12">
|
||||||
<i>Last updated 2019-10-15 22:37:40 UTC</i>
|
<i>Last updated 2019-10-21 22:17:42 UTC</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
659
expcore/gui.lua
659
expcore/gui.lua
@@ -1,284 +1,489 @@
|
|||||||
--[[-- Core Module - Gui
|
--[[-- Core Module - Gui
|
||||||
- This file is used to require all the different elements of the gui module
|
- Used to define new gui elements and gui event handlers
|
||||||
- each module has an outline here but for more details see their separate files in ./gui
|
@core Gui
|
||||||
- please read the files for more documentation that cant be shown here
|
@alias Gui
|
||||||
- please note there is a rework planned but not started
|
|
||||||
@core Gui
|
@usage-- Defining a button that prints the player's name
|
||||||
@alias Gui
|
local example_button =
|
||||||
|
Gui.new_element{
|
||||||
|
type = 'button',
|
||||||
|
caption = 'Example Button'
|
||||||
|
}
|
||||||
|
:on_click(function(event)
|
||||||
|
local player = event.player
|
||||||
|
player.print(player.name)
|
||||||
|
end)
|
||||||
|
|
||||||
|
@usage-- Defining using a custom function
|
||||||
|
local example_flow_with_button =
|
||||||
|
Gui.new_element(function(event_trigger,parent)
|
||||||
|
local flow =
|
||||||
|
parent.add{
|
||||||
|
name = 'example_flow',
|
||||||
|
type = 'flow'
|
||||||
|
}
|
||||||
|
|
||||||
|
local element =
|
||||||
|
flow.add{
|
||||||
|
name = event_trigger,
|
||||||
|
type = 'button',
|
||||||
|
caption = 'Example Button'
|
||||||
|
}
|
||||||
|
|
||||||
|
return element
|
||||||
|
end)
|
||||||
|
:on_click(function(event)
|
||||||
|
local player = event.player
|
||||||
|
player.print(player.name)
|
||||||
|
end)
|
||||||
|
|
||||||
|
@usage-- Drawing an element
|
||||||
|
local exmple_button_element = example_button(parent)
|
||||||
|
local example_flow_with_button = example_flow_with_button(parent)
|
||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
local Event = require 'utils.event' --- @dep utils.event
|
||||||
|
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
||||||
|
|
||||||
--[[
|
local Gui = {
|
||||||
Core
|
--- The current highest uid that is being used, will not increase during runtime
|
||||||
|
-- @field uid
|
||||||
|
uid = 0,
|
||||||
|
--- Contains the uids of the elements that will show on the top flow and the auth function
|
||||||
|
-- @table top_elements
|
||||||
|
top_elements = {},
|
||||||
|
--- Contains the uids of the elements that will show on the left flow and the open on join function
|
||||||
|
-- @table left_elements
|
||||||
|
left_elements = {},
|
||||||
|
--- Table of all the elements which have been registed with the draw function and event handlers
|
||||||
|
-- @table defines
|
||||||
|
defines = {},
|
||||||
|
--- An index used for debuging to find the file where different elements where registered
|
||||||
|
-- @table file_paths
|
||||||
|
file_paths = {},
|
||||||
|
--- The element prototype which is returned from Gui.new_element
|
||||||
|
-- @table _prototype_element
|
||||||
|
_prototype_element = {},
|
||||||
|
--- The prototype metatable applied to new element defines
|
||||||
|
-- @table _mt_element
|
||||||
|
_mt_element = {
|
||||||
|
__call = function(self,parent,...)
|
||||||
|
return self._draw(self.name,parent,...)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Gui.new_define(prototype) --- Used internally to create new element defines from a class prototype
|
Gui._mt_element.__index = Gui._prototype_element
|
||||||
Gui.draw(name,element) --- Draws a copy of the element define to the parent element, see draw_to
|
|
||||||
|
|
||||||
Gui.categorize_by_player(element) --- A categorize function to be used with add_store, each player has their own value
|
--- Element Define.
|
||||||
Gui.categorize_by_force(element) --- A categorize function to be used with add_store, each force has its own value
|
-- @section elementDefine
|
||||||
Gui.categorize_by_surface(element) --- A categorize function to be used with add_store, each surface has its own value
|
|
||||||
|
|
||||||
Gui.toggle_enabled(element) --- Will toggle the enabled state of an element
|
--[[-- Base function used to define new elements, can be used with a table or with a function
|
||||||
Gui.toggle_visible(element) --- Will toggle the visibility of an element
|
@tparam ?table|function element_define used to define how the element is draw, using a table is the simplist way of doing this
|
||||||
Gui.set_padding(element,up,down,left,right) --- Sets the padding for a gui element
|
@treturn table the new element define that is used to register events to this element
|
||||||
Gui.set_padding_style(style,up,down,left,right) --- Sets the padding for a gui style
|
|
||||||
Gui.create_alignment(element,flow_name) --- Allows the creation of a right align flow to place elements into
|
|
||||||
Gui.destroy_if_valid(element) --- Destroys an element but tests for it being present and valid first
|
|
||||||
Gui.create_scroll_table(element,table_size,maximal_height,name) --- Creates a scroll area with a table inside, table can be any size
|
|
||||||
Gui.create_header(element,caption,tooltip,right_align,name) --- Creates a header section with a label and button area
|
|
||||||
|
|
||||||
Prototype Constructor
|
@usage-- Defining an element with a table
|
||||||
|
local example_button =
|
||||||
|
Gui.new_element{
|
||||||
|
type = 'button',
|
||||||
|
caption = 'Example Button'
|
||||||
|
}
|
||||||
|
|
||||||
Constructor.event(event_name) --- Creates a new function to add functions to an event handler
|
@usage-- Defining an element with a function
|
||||||
Constructor.extend(new_prototype) --- Extents a prototype with the base functions of all gui prototypes, no metatables
|
local example_flow_with_button =
|
||||||
Constructor.store(sync,callback) --- Creates a new function which adds a store to a gui define
|
Gui.new_element(function(event_trigger,parent)
|
||||||
Constructor.setter(value_type,key,second_key) --- Creates a setter function that checks the type when a value is set
|
local flow =
|
||||||
|
parent.add{
|
||||||
|
name = 'example_flow',
|
||||||
|
type = 'flow'
|
||||||
|
}
|
||||||
|
|
||||||
Base Prototype
|
local element =
|
||||||
|
flow.add{
|
||||||
|
name = event_trigger,
|
||||||
|
type = 'button',
|
||||||
|
caption = 'Example Button'
|
||||||
|
}
|
||||||
|
|
||||||
Prototype:uid() --- Gets the uid for the element define
|
return element
|
||||||
Prototype:debug_name(value) --- Sets a debug alias for the define
|
end)
|
||||||
Prototype:set_caption(value) --- Sets the caption for the element define
|
|
||||||
Prototype:set_tooltip(value) --- Sets the tooltip for the element define
|
|
||||||
Prototype:set_style(style,callback) --- Sets the style for the element define
|
|
||||||
Prototype:set_embedded_flow(state) --- Sets the element to be drawn inside a nameless flow, can be given a name using a function
|
|
||||||
|
|
||||||
Prototype:set_pre_authenticator --- Sets an authenticator that blocks the draw function if check fails
|
|
||||||
Prototype:set_post_authenticator --- Sets an authenticator that disables the element if check fails
|
|
||||||
|
|
||||||
Prototype:raise_event(event_name,...) --- Raises a custom event for this define, any number of params can be given
|
|
||||||
Prototype:draw_to(element,...) --- The main function for defines, when called will draw an instance of this define to the given element
|
|
||||||
|
|
||||||
Prototype:get_store(category) --- Gets the value in this elements store, category needed if categorize function used
|
|
||||||
Prototype:set_store(category,value) --- Sets the value in this elements store, category needed if categorize function used
|
|
||||||
Prototype:clear_store(category) --- Sets the value in this elements store to nil, category needed if categorize function used
|
|
||||||
]]
|
]]
|
||||||
|
function Gui.new_element(element_define)
|
||||||
|
-- Set the metatable to allow access to register events
|
||||||
|
local element = setmetatable({}, Gui._mt_element)
|
||||||
|
|
||||||
local Instances = require 'expcore.gui.instances' --- @dep expcore.gui.instances
|
-- Increment the uid counter
|
||||||
Gui.new_instance_group = Instances.registers
|
local uid = Gui.uid + 1
|
||||||
Gui.get_instances = Instances.get_elements
|
Gui.uid = uid
|
||||||
Gui.add_instance = Instances.get_elements
|
local name = tostring(uid)
|
||||||
Gui.update_instances = Instances.apply_to_elements
|
element.name = name
|
||||||
Gui.classes.instances = Instances
|
|
||||||
--[[
|
|
||||||
Instances.has_categories(name) --- Returns if a instance group has a categorise function; must be registered
|
|
||||||
Instances.is_registered(name) --- Returns if the given name is a registered instance group
|
|
||||||
Instances.register(name,categorise) --- Registers the name of an instance group to allow for storing element instances
|
|
||||||
|
|
||||||
Instances.add_element(name,element) --- Adds an element to the instance group under the correct category; must be registered
|
-- Add the defination function
|
||||||
Instances.get_elements_raw(name,category) --- Gets all element instances without first removing any invalid ones; used internally and must be registered
|
if type(element_define) == 'table' then
|
||||||
Instances.get_valid_elements(name,category,callback) --- Gets all valid element instances and has the option of running a callback on those that are valid
|
element_define.name = name
|
||||||
|
element._draw = function(_,parent)
|
||||||
|
return parent.add(element_define)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
element._draw = element_define
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add the define to the base module
|
||||||
|
local file_path = debug.getinfo(2, 'S').source:match('^.+/currently%-playing/(.+)$'):sub(1, -5)
|
||||||
|
Gui.file_paths[name] = file_path
|
||||||
|
Gui.defines[name] = element
|
||||||
|
|
||||||
|
-- Return the element so event handers can be accessed
|
||||||
|
return element
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[-- Adds an element to be drawn to the top flow when a player joins
|
||||||
|
@tparam[opt] function authenticator called during toggle or update to decide if the element should be visible
|
||||||
|
|
||||||
|
@usage-- Adding the example button
|
||||||
|
example_button:add_to_top_flow(function(player)
|
||||||
|
-- example button will only show when game time is less than 1 minute
|
||||||
|
return player.online_time < 3600
|
||||||
|
end)
|
||||||
|
|
||||||
Instances.unregistered_add_element(name,category,element) --- A version of add_element that does not require the group to be registered
|
|
||||||
Instances.unregistered_get_elements(name,category,callback) --- A version of get_elements that does not require the group to be registered
|
|
||||||
]]
|
]]
|
||||||
|
function Gui._prototype_element:add_to_top_flow(authenticator)
|
||||||
|
Gui.top_elements[self.name] = authenticator or true
|
||||||
|
end
|
||||||
|
|
||||||
local Button = require 'expcore.gui.elements.buttons' --- @dep expcore.gui.elements.buttons
|
--[[-- Adds an element to be drawn to the left flow when a player joins
|
||||||
Gui.new_button = Button.new_button
|
@tparam[opt] ?boolean|function open_on_join called during first darw to decide if the element is visible
|
||||||
Gui.classes.button = Button
|
|
||||||
--[[
|
|
||||||
Button.new_button(name) --- Creates a new button element define
|
|
||||||
|
|
||||||
Button._prototype:on_click(player,element) --- Registers a handler for when the button is clicked
|
@usage-- Adding the example button
|
||||||
Button._prototype:on_left_click(player,element) --- Registers a handler for when the button is clicked with the left mouse button
|
example_flow_with_button:add_to_left_flow(true)
|
||||||
Button._prototype:on_right_click(player,element) --- Registers a handler for when the button is clicked with the right mouse button
|
|
||||||
|
|
||||||
Button._prototype:set_sprites(sprite,hovered_sprite,clicked_sprite) --- Adds sprites to a button making it a sprite button
|
|
||||||
Button._prototype:set_click_filter(filter,...) --- Adds a click / mouse button filter to the button
|
|
||||||
Button._prototype:set_key_filter(filter,...) --- Adds a control key filter to the button
|
|
||||||
]]
|
]]
|
||||||
|
function Gui._prototype_element:add_to_left_flow(open_on_join)
|
||||||
|
Gui.left_elements[self.name] = open_on_join or false
|
||||||
|
end
|
||||||
|
|
||||||
local Checkbox = require 'expcore.gui.elements.checkbox' --- @dep expcore.gui.elements.checkbox
|
-- This function is called for event event
|
||||||
Gui.new_checkbox = Checkbox.new_checkbox
|
local function general_event_handler(event)
|
||||||
Gui.new_radiobutton = Checkbox.new_radiobutton
|
-- Check the element is valid
|
||||||
Gui.new_radiobutton_option_set = Checkbox.new_option_set
|
local element = event.element
|
||||||
Gui.draw_option_set = Checkbox.draw_option_set
|
if not element or not element.valid then
|
||||||
Gui.classes.checkbox = Checkbox
|
return
|
||||||
--[[
|
end
|
||||||
Checkbox.new_checkbox(name) --- Creates a new checkbox element define
|
|
||||||
Checkbox._prototype_checkbox:on_element_update(callback) --- Registers a handler for when an element instance updates
|
|
||||||
Checkbox._prototype_checkbox:on_store_update(callback) --- Registers a handler for when the stored value updates
|
|
||||||
|
|
||||||
Checkbox.new_radiobutton(name) --- Creates a new radiobutton element define
|
-- Get the event handler for this element
|
||||||
Checkbox._prototype_radiobutton:on_element_update(callback) --- Registers a handler for when an element instance updates
|
local handlers = Gui.defines[element.name]
|
||||||
Checkbox._prototype_radiobutton:on_store_update(callback) --- Registers a handler for when the stored value updates
|
local handler = handlers and handlers[event.name]
|
||||||
Checkbox._prototype_radiobutton:add_as_option(option_set,option_name) --- Adds this radiobutton to be an option in the given option set (only one can be true at a time)
|
if not handler then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
Checkbox.new_option_set(callback,categorize) --- Registers a new option set that can be linked to radiobuttons (only one can be true at a time)
|
-- Get the player for this event
|
||||||
Checkbox.draw_option_set(name,element) --- Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
|
local player = game.players[event.player_index]
|
||||||
|
if not player or not player.valid then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
event.player = player
|
||||||
|
|
||||||
|
local success, err = pcall(handler,event)
|
||||||
|
if not success then
|
||||||
|
error('There as been an error with an event handler for a gui element:\n\t'..err)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- This function returns the event handler adder and registeres the general handler
|
||||||
|
local function event_handler_factory(event_name)
|
||||||
|
Event.add(event_name, general_event_handler)
|
||||||
|
|
||||||
|
return function(self,handler)
|
||||||
|
self[event_name] = handler
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Element Events.
|
||||||
|
-- @section elementEvents
|
||||||
|
|
||||||
|
--- Called when the player opens a GUI.
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_opened = event_handler_factory(defines.events.on_gui_opened)
|
||||||
|
|
||||||
|
--- Called when the player closes the GUI they have open.
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_closed = event_handler_factory(defines.events.on_gui_closed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement is clicked.
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_click = event_handler_factory(defines.events.on_gui_click)
|
||||||
|
|
||||||
|
--- Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_confirmed = event_handler_factory(defines.events.on_gui_confirmed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_checked_changed = event_handler_factory(defines.events.on_gui_checked_state_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement element value is changed (related to choose element buttons).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_elem_changed = event_handler_factory(defines.events.on_gui_elem_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement element location is changed (related to frames in player.gui.screen).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_location_changed = event_handler_factory(defines.events.on_gui_location_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement selected tab is changed (related to tabbed-panes).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_tab_changed = event_handler_factory(defines.events.on_gui_selected_tab_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement selection state is changed (related to drop-downs and listboxes).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_selection_changed = event_handler_factory(defines.events.on_gui_selection_state_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement switch state is changed (related to switches).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_switch_changed = event_handler_factory(defines.events.on_gui_switch_state_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement text is changed by the player.
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_text_change = event_handler_factory(defines.events.on_gui_text_changed)
|
||||||
|
|
||||||
|
--- Called when LuaGuiElement slider value is changed (related to the slider element).
|
||||||
|
-- @tparam function handler the event handler which will be called
|
||||||
|
Gui._prototype_element.on_value_changed = event_handler_factory(defines.events.on_gui_value_changed)
|
||||||
|
|
||||||
|
--- Top Flow.
|
||||||
|
-- @section topFlow
|
||||||
|
|
||||||
|
--- Button which toggles the top flow elements
|
||||||
|
-- @element toggle_top_flow
|
||||||
|
local toggle_top_flow =
|
||||||
|
Gui.new_element(function(event_trigger,parent)
|
||||||
|
-- Draw the element
|
||||||
|
local element =
|
||||||
|
parent.add{
|
||||||
|
name = event_trigger,
|
||||||
|
type = 'button',
|
||||||
|
style = mod_gui.button_style,
|
||||||
|
caption = '<',
|
||||||
|
tooltip = {'gui_util.button_tooltip'}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Change its style
|
||||||
|
local style = element.style
|
||||||
|
style.width = 18
|
||||||
|
style.height = 36
|
||||||
|
style.padding = 0
|
||||||
|
style.font = 'default-small-bold'
|
||||||
|
|
||||||
|
-- Return the element
|
||||||
|
return element
|
||||||
|
end)
|
||||||
|
:on_click(function(event)
|
||||||
|
Gui.toggle_top_flow(event.player)
|
||||||
|
end)
|
||||||
|
|
||||||
|
--[[-- Gets the flow which contains the elements for the top flow
|
||||||
|
@function Gui.get_top_flow(player)
|
||||||
|
@tparam LuaPlayer player the player that you want to get the flow for
|
||||||
|
@treturn LuaGuiElement the top element flow
|
||||||
|
|
||||||
|
@usage-- Geting your top element flow
|
||||||
|
local top_flow = Gui.get_top_flow(game.player)
|
||||||
|
|
||||||
Checkbox.reset_radiobutton(element,exclude,recursive) --- Sets all radiobuttons in a element to false (unless excluded) and can act recursively
|
|
||||||
]]
|
]]
|
||||||
|
Gui.get_top_flow = mod_gui.get_button_flow
|
||||||
|
|
||||||
local Dropdown = require 'expcore.gui.elements.dropdown' --- @dep expcore.gui.elements.dropdown
|
--[[-- Updates the visible states of all the elements on a players top flow
|
||||||
Gui.new_dropdown = Dropdown.new_dropdown
|
@tparam LuaPlayer player the player that you want to update the flow for
|
||||||
Gui.new_list_box = Dropdown.new_list_box
|
|
||||||
Gui.classes.dropdown = Dropdown
|
|
||||||
--[[
|
|
||||||
Dropdown.new_dropdown(name) --- Creates a new dropdown element define
|
|
||||||
Dropdown.new_list_box(name) --- Creates a new list box element define
|
|
||||||
|
|
||||||
Dropdown._prototype:on_element_update(callback) --- Registers a handler for when an element instance updates
|
@usage-- Update your flow
|
||||||
Dropdown._prototype:on_store_update(callback) --- Registers a handler for when the stored value updates
|
Gui.update_top_flow(game.player)
|
||||||
|
|
||||||
Dropdown._prototype:new_static_options(options,...) --- Adds new static options to the dropdown which will trigger the general callback
|
|
||||||
Dropdown._prototype:new_dynamic_options(callback) --- Adds a callback which should return a table of values to be added as options for the dropdown (appended after static options)
|
|
||||||
Dropdown._prototype:add_option_callback(option,callback) --- Adds a case specific callback which will only run when that option is selected (general case still triggered)
|
|
||||||
|
|
||||||
Dropdown.select_value(element,value) --- Selects the option from a dropdown or list box given the value rather than key
|
|
||||||
Dropdown.get_selected_value(element) --- Returns the currently selected value rather than index
|
|
||||||
]]
|
]]
|
||||||
|
function Gui.update_top_flow(player)
|
||||||
|
local top_flow = Gui.get_top_flow(player)
|
||||||
|
local toggle_button = top_flow[toggle_top_flow.name]
|
||||||
|
local is_visible = toggle_button.caption == '<'
|
||||||
|
|
||||||
local Slider = require 'expcore.gui.elements.slider' --- @dep expcore.gui.elements.slider
|
-- Set the visible state of all elements in the flow
|
||||||
Gui.new_slider = Slider.new_slider
|
for name,authenticator in pairs(Gui.top_elements) do
|
||||||
Gui.classes.slider = Slider
|
-- Ensure the element exists
|
||||||
--[[
|
local element = top_flow[name]
|
||||||
Slider.new_slider(name) --- Creates a new slider element define
|
if not element then
|
||||||
|
element = Gui.defines[name](top_flow)
|
||||||
|
end
|
||||||
|
|
||||||
Slider._prototype:on_element_update(callback) --- Registers a handler for when an element instance updates
|
-- Set the visible state
|
||||||
Slider._prototype:on_store_update(callback) --- Registers a handler for when the stored value updates
|
element.visible = is_visible and authenticator(player) or false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[-- Toggles the visible states of all the elements on a players top flow
|
||||||
|
@tparam LuaPlayer player the player that you want to toggle the flow for
|
||||||
|
@tparam[opt] boolean state if given then the state will be set to this state
|
||||||
|
@treturn boolean the new visible state of the top flow
|
||||||
|
|
||||||
|
@usage-- Toggle your flow
|
||||||
|
Gui.toggle_top_flow(game.player)
|
||||||
|
|
||||||
|
@usage-- Open your top flow
|
||||||
|
Gui.toggle_top_flow(game.player,true)
|
||||||
|
|
||||||
Slider._prototype:set_range(min,max) --- Sets the range of a slider, if not used will use default values for a slider
|
|
||||||
Slider._prototype:draw_label(element) --- Draws a new label and links its value to the value of this slider, if no store then it will only show one value per player
|
|
||||||
Slider._prototype:enable_auto_draw_label(state) --- Enables auto draw of the label, the label will share the same parent element as the slider
|
|
||||||
]]
|
]]
|
||||||
|
function Gui.toggle_top_flow(player,state)
|
||||||
|
local top_flow = Gui.get_top_flow(player)
|
||||||
|
local toggle_button = top_flow[toggle_top_flow.name]
|
||||||
|
local new_state = state or toggle_button.caption == '>'
|
||||||
|
|
||||||
local Text = require 'expcore.gui.elements.text' --- @dep expcore.gui.elements.text
|
-- Set the visible state of all elements in the flow
|
||||||
Gui.new_text_filed = Text.new_text_field
|
for name,authenticator in pairs(Gui.top_elements) do
|
||||||
Gui.new_text_box = Text.new_text_box
|
top_flow[name].visible = new_state and authenticator(player) or false
|
||||||
Gui.classes.text = Text
|
end
|
||||||
--[[
|
|
||||||
Text.new_text_field(name) --- Creates a new text field element define
|
-- Change the style of the toggle button
|
||||||
Text._prototype_field:on_element_update(callback) --- Registers a handler for when an element instance updates
|
if new_state then
|
||||||
Text._prototype_field:on_store_update(callback) --- Registers a handler for when the stored value updates
|
toggle_button.caption = '<'
|
||||||
|
toggle_button.style.height = 34
|
||||||
|
else
|
||||||
|
toggle_button.caption = '>'
|
||||||
|
toggle_button.style.height = 24
|
||||||
|
end
|
||||||
|
|
||||||
|
return new_state
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Left Flow.
|
||||||
|
-- @section leftFlow
|
||||||
|
|
||||||
|
--- Button which hides the elements in the left flow
|
||||||
|
-- @element hide_left_flow
|
||||||
|
local hide_left_flow =
|
||||||
|
Gui.new_element(function(event_trigger,parent)
|
||||||
|
-- Draw the element
|
||||||
|
local element =
|
||||||
|
parent.add{
|
||||||
|
name = event_trigger,
|
||||||
|
type = 'button',
|
||||||
|
style = mod_gui.button_style,
|
||||||
|
caption = '<',
|
||||||
|
tooltip = {'expcore-gui.left-button-tooltip'}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Change its style
|
||||||
|
local style = element.style
|
||||||
|
style.width = 18
|
||||||
|
style.height = 36
|
||||||
|
style.padding = 0
|
||||||
|
style.font = 'default-small-bold'
|
||||||
|
|
||||||
|
-- Return the element
|
||||||
|
return element
|
||||||
|
end)
|
||||||
|
:on_click(function(event)
|
||||||
|
Gui.hide_left_flow(event.player)
|
||||||
|
end)
|
||||||
|
|
||||||
|
--[[-- Gets the flow which contains the elements for the left flow
|
||||||
|
@function Gui.get_left_flow(player)
|
||||||
|
@tparam LuaPlayer player the player that you want to get the flow for
|
||||||
|
@treturn LuaGuiElement the left element flow
|
||||||
|
|
||||||
|
@usage-- Geting your left element flow
|
||||||
|
local left_flow = Gui.get_left_flow(game.player)
|
||||||
|
|
||||||
Text.new_text_box(name) --- Creates a new text box element define
|
|
||||||
Text._prototype_field:on_element_update(callback) --- Registers a handler for when an element instance updates
|
|
||||||
Text._prototype_field:on_store_update(callback) --- Registers a handler for when the stored value updates
|
|
||||||
Text._prototype_box:set_selectable(state) --- Sets the text box to be selectable
|
|
||||||
Text._prototype_box:set_word_wrap(state) --- Sets the text box to have word wrap
|
|
||||||
Text._prototype_box:set_read_only(state) --- Sets the text box to be read only
|
|
||||||
]]
|
]]
|
||||||
|
Gui.get_left_flow = mod_gui.get_frame_flow
|
||||||
|
|
||||||
local ElemButton = require 'expcore.gui.elements.elem-button' --- @dep expcore.gui.elements.elem-button
|
--[[-- Hides all left elements for a player
|
||||||
Gui.new_elem_button = ElemButton.new_elem_button
|
@tparam LuaPlayer player the player to hide the elements for
|
||||||
Gui.classes.elem_button = ElemButton
|
|
||||||
--[[
|
|
||||||
ElemButton.new_elem_button(name) --- Creates a new elem button element define
|
|
||||||
|
|
||||||
ElemButton._prototype:on_element_update(callback) --- Registers a handler for when an element instance updates
|
@usage-- Hide your left elements
|
||||||
ElemButton._prototype:on_store_update(callback) --- Registers a handler for when the stored value updates
|
Gui.hide_left_flow(game.player)
|
||||||
|
|
||||||
ElemButton._prototype:set_type(type) --- Sets the type of the elem button, the type is required so this must be called at least once
|
|
||||||
ElemButton._prototype:set_default(value) --- Sets the default value for the elem button, this may be a function or a string
|
|
||||||
]]
|
]]
|
||||||
|
function Gui.hide_left_flow(player)
|
||||||
|
local left_flow = Gui.get_left_flow(player)
|
||||||
|
local hide_button = left_flow[hide_left_flow.name]
|
||||||
|
|
||||||
local ProgressBar = require 'expcore.gui.elements.progress-bar' --- @dep expcore.gui.elements.progress-bar
|
-- Set the visible state of all elements in the flow
|
||||||
Gui.new_progressbar = ProgressBar.new_progressbar
|
hide_button.visible = false
|
||||||
Gui.set_progressbar_maximum = ProgressBar.set_maximum
|
for name,_ in pairs(Gui.left_elements) do
|
||||||
Gui.increment_progressbar = ProgressBar.increment
|
left_flow[name].visible = false
|
||||||
Gui.decrement_progressbar = ProgressBar.decrement
|
end
|
||||||
Gui.classes.progressbar = ProgressBar
|
end
|
||||||
--[[
|
|
||||||
ProgressBar.set_maximum(element,amount,count_down) --- Sets the maximum value that represents the end value of the progress bar
|
|
||||||
ProgressBar.increment(element,amount) --- Increases the value of the progressbar, if a define is given all of its instances are incremented
|
|
||||||
ProgressBar.decrement(element,amount) --- Decreases the value of the progressbar, if a define is given all of its instances are decreased
|
|
||||||
|
|
||||||
ProgressBar.new_progressbar(name) --- Creates a new progressbar element define
|
--[[-- Toggles the visible state of all a left element for a player
|
||||||
ProgressBar._prototype:set_maximum(amount,count_down) --- Sets the maximum value that represents the end value of the progress bar
|
@tparam LuaPlayer player the player that you want to toggle the element for
|
||||||
ProgressBar._prototype:use_count_down(state) --- Will set the progress bar to start at 1 and trigger when it hits 0
|
@tparam table element_define the element that you want to toggle for the player
|
||||||
ProgressBar._prototype:increment(amount,category) --- Increases the value of the progressbar
|
@tparam[opt] boolean state if given then the state will be set to this state
|
||||||
ProgressBar._prototype:increment_filtered(amount,filter) --- Increases the value of the progressbar, if the filter condition is met, does not work with store
|
@treturn boolean the new visible state of the element
|
||||||
ProgressBar._prototype:decrement(amount,category) --- Decreases the value of the progressbar
|
|
||||||
ProgressBar._prototype:decrement_filtered(amount,filter) --- Decreases the value of the progressbar, if the filter condition is met, does not work with store
|
@usage-- Toggle your example button
|
||||||
ProgressBar._prototype:add_element(element,maximum) --- Adds an element into the list of instances that will are waiting to complete, does not work with store
|
Gui.toggle_top_flow(game.player,example_flow_with_button)
|
||||||
ProgressBar._prototype:reset_element(element) --- Resets an element, or its store, to be back at the start, either 1 or 0
|
|
||||||
|
@usage-- Open your example button
|
||||||
|
Gui.toggle_top_flow(game.player,example_flow_with_button,true)
|
||||||
|
|
||||||
ProgressBar._prototype:on_complete(callback) --- Triggers when a progress bar element completes (hits 0 or 1)
|
|
||||||
ProgressBar._prototype:on_complete(callback) --- Triggers when a store value completes (hits 0 or 1)
|
|
||||||
ProgressBar._prototype:event_counter(filter) --- Event handler factory that counts up by 1 every time the event triggers, can filter which elements are incremented
|
|
||||||
ProgressBar._prototype:event_countdown(filter) --- Event handler factory that counts down by 1 every time the event triggers, can filter which elements are decremented
|
|
||||||
]]
|
]]
|
||||||
|
function Gui.toggle_left_element(player,element_define,state)
|
||||||
|
local left_flow = Gui.get_left_flow(player)
|
||||||
|
local hide_button = left_flow[hide_left_flow.name]
|
||||||
|
|
||||||
local Toolbar = require 'expcore.gui.concepts.toolbar' --- @dep expcore.gui.concepts.toolbar
|
-- Set the visible state
|
||||||
Gui.new_toolbar_button = Toolbar.new_button
|
local element = left_flow[element_define.name]
|
||||||
Gui.add_button_to_toolbar = Toolbar.add_button
|
local new_state = state or not element.visible
|
||||||
Gui.update_toolbar = Toolbar.update
|
element.visible = new_state
|
||||||
Gui.classes.toolbar = Toolbar
|
|
||||||
--[[
|
|
||||||
Toolbar.new_button(name) --- Adds a new button to the toolbar
|
|
||||||
Toolbar.add_button(button) --- Adds an existing buttton to the toolbar
|
|
||||||
Toolbar.update(player) --- Updates the player's toolbar with an new buttons or expected change in auth return
|
|
||||||
]]
|
|
||||||
|
|
||||||
local LeftFrames = require 'expcore.gui.concepts.left' --- @dep expcore.gui.concepts.left
|
-- Check if the hide button should be visible
|
||||||
Gui.get_left_frame_flow = LeftFrames.get_flow
|
local show_hide_button = false
|
||||||
Gui.toggle_left_frame = LeftFrames.toggle_frame
|
for name,_ in pairs(Gui.left_elements) do
|
||||||
Gui.new_left_frame = LeftFrames.new_frame
|
if left_flow[name].visible then
|
||||||
Gui.classes.left_frames = LeftFrames
|
show_hide_button = true
|
||||||
--[[
|
break
|
||||||
LeftFrames.get_flow(player) --- Gets the left frame flow for a player
|
end
|
||||||
LeftFrames.get_frame(name,player) --- Gets one frame from the left flow by its name
|
end
|
||||||
LeftFrames.get_open(player) --- Gets all open frames for a player, if non are open it will remove the close all button
|
hide_button.visible = show_hide_button
|
||||||
LeftFrames.toggle_frame(name,player,state) --- Toggles the visibility of a left frame, or sets its visibility state
|
|
||||||
|
|
||||||
LeftFrames.new_frame(permission_name) --- Creates a new left frame define
|
return new_state
|
||||||
LeftFrames._prototype:set_open_by_default(state) --- Sets if the frame is visible when a player joins, can also be a function to return a boolean
|
end
|
||||||
LeftFrames._prototype:set_direction(direction) --- Sets the direction of the frame, either vertical or horizontal
|
|
||||||
LeftFrames._prototype:get_frame(player) --- Gets the frame for this define from the left frame flow
|
|
||||||
LeftFrames._prototype:is_open(player) --- Returns if the player currently has this define visible
|
|
||||||
LeftFrames._prototype:toggle(player) --- Toggles the visibility of the left frame
|
|
||||||
|
|
||||||
LeftFrames._prototype:update(player) --- Updates the contents of the left frame, first tries update callback, other wise will clear and redraw
|
-- Draw the two flows when a player joins
|
||||||
LeftFrames._prototype:update_all(update_offline) --- Updates the frame for all players, see update
|
Event.add(defines.events.on_player_joined_game,function(event)
|
||||||
LeftFrames._prototype:redraw(player) --- Redraws the frame by calling on_draw, will always clear the frame
|
local player = game.players[event.player_index]
|
||||||
LeftFrames._prototype:redraw_all(update_offline) --- Redraws the frame for all players, see redraw
|
|
||||||
|
|
||||||
LeftFrames._prototype:on_draw(player,frame) --- Use to draw your elements to the new frame
|
-- Draw the top flow
|
||||||
LeftFrames._prototype:on_update(player,frame) --- Use to edit your frame when there is no need to redraw it
|
local top_flow = Gui.get_top_flow(player)
|
||||||
LeftFrames._prototype:on_player_toggle(player,frame) --- Triggered when the player toggle the left frame
|
toggle_top_flow(top_flow)
|
||||||
LeftFrames._prototype:event_handler(action) --- Creates an event handler that will trigger one of its functions, use with Event.add
|
Gui.update_top_flow(player)
|
||||||
]]
|
|
||||||
|
|
||||||
local CenterFrames = require 'expcore.gui.concepts.center' --- @dep expcore.gui.concepts.center
|
-- Draw the left flow
|
||||||
Gui.get_center_flow = CenterFrames.get_flow
|
local left_flow = Gui.get_left_flow(player)
|
||||||
Gui.toggle_center_frame = CenterFrames.toggle_frame
|
local hide_left = hide_left_flow(left_flow)
|
||||||
Gui.draw_center_frame = CenterFrames.draw_frame
|
|
||||||
Gui.redraw_center_frame = CenterFrames.redraw_frames
|
|
||||||
Gui.new_center_frame = CenterFrames.new_frame
|
|
||||||
Gui.classes.center_frames = CenterFrames
|
|
||||||
--[[
|
|
||||||
CenterFrames.get_flow(player) --- Gets the center flow for a player
|
|
||||||
CenterFrames.clear_flow(player) --- Clears the center flow for a player
|
|
||||||
CenterFrames.draw_frame(player,name) --- Draws the center frame for a player, if already open then will do nothing
|
|
||||||
CenterFrames.redraw_frame(player,name) --- Draws the center frame for a player, if already open then will destroy it and redraw
|
|
||||||
CenterFrames.toggle_frame(player,name,state) --- Toggles if the frame is currently open or not, will open if closed and close if open
|
|
||||||
|
|
||||||
CenterFrames.new_frame(permission_name) --- Sets the frame to be the current active gui when opened and closes all other frames
|
-- Draw the elements on the left flow
|
||||||
CenterFrames._prototype:on_draw(player,frame) --- Use to draw your elements onto the new frame
|
local show_hide_left = false
|
||||||
CenterFrames._prototype:set_auto_focus(state) --- Sets the frame to be the current active gui when opened and closes all other frames
|
for name,open_on_join in pairs(Gui.left_elements) do
|
||||||
CenterFrames._prototype:draw_frame(player) --- Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)
|
local left_element = Gui.defines[name](left_flow)
|
||||||
CenterFrames._prototype:redraw_frame(player) --- Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)
|
|
||||||
CenterFrames._prototype:toggle_frame(player) --- Toggles if the frame is open, if open it will close it and if closed it will open it
|
|
||||||
CenterFrames._prototype:event_handler(action) --- Creates an event handler that will trigger one of its functions, use with Event.add
|
|
||||||
]]
|
|
||||||
|
|
||||||
local PopupFrames = require 'expcore.gui.concepts.popups' --- @dep expcore.gui.concepts.popups
|
-- Check if the element should be visible
|
||||||
Gui.get_popup_flow = PopupFrames.get_flow
|
local visible = type(open_on_join) == 'boolean' and open_on_join or false
|
||||||
Gui.open_popup = PopupFrames.open
|
if type(open_on_join) == 'function' then
|
||||||
Gui.new_popup = PopupFrames.new_popup
|
local success, err = pcall(open_on_join,player)
|
||||||
Gui.classes.popup_frames = PopupFrames
|
if not success then
|
||||||
--[[
|
error('There as been an error with an open on join hander for a gui element:\n\t'..err)
|
||||||
PopupFrames.get_flow(player) --- Gets the left flow that contains the popup frames
|
end
|
||||||
PopupFrames.open(define_name,player,open_time,...) --- Opens a popup for the player, can give the amount of time it is open as well as params for the draw function
|
visible = err
|
||||||
|
end
|
||||||
|
|
||||||
PopupFrames.close_progress --- Progress bar which when depleted will close the popup frame
|
left_element.visible = visible
|
||||||
PopupFrames.close_button --- A button which can be used to close the gui before the timer runs out
|
if visible then
|
||||||
|
show_hide_left = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
PopupFrames.new_popup(name) --- Creates a new popup frame define
|
hide_left.visible = show_hide_left
|
||||||
PopupFrames._prototype:set_default_open_time(amount) --- Sets the default open time for the popup, will be used if non is provided with open
|
end)
|
||||||
PopupFrames._prototype:open(player,open_time,...) --- Opens this define for a player, can be given open time and any other params for the draw function
|
|
||||||
]]
|
|
||||||
|
|
||||||
return Gui
|
return Gui
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Center Guis.
|
|
||||||
-- Gui structure define for center gui frames
|
|
||||||
-- @section center
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Functions
|
|
||||||
CenterFrames.get_flow(player) --- Gets the center flow for a player
|
|
||||||
CenterFrames.clear_flow(player) --- Clears the center flow for a player
|
|
||||||
CenterFrames.draw_frame(player,name) --- Draws the center frame for a player, if already open then will do nothing
|
|
||||||
CenterFrames.redraw_frame(player,name) --- Draws the center frame for a player, if already open then will destroy it and redraw
|
|
||||||
CenterFrames.toggle_frame(player,name,state) --- Toggles if the frame is currently open or not, will open if closed and close if open
|
|
||||||
|
|
||||||
CenterFrames.new_frame(permission_name) --- Sets the frame to be the current active gui when opened and closes all other frames
|
|
||||||
CenterFrames._prototype:on_draw(player,frame) --- Use to draw your elements onto the new frame
|
|
||||||
CenterFrames._prototype:set_auto_focus(state) --- Sets the frame to be the current active gui when opened and closes all other frames
|
|
||||||
CenterFrames._prototype:draw_frame(player) --- Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)
|
|
||||||
CenterFrames._prototype:redraw_frame(player) --- Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)
|
|
||||||
CenterFrames._prototype:toggle_frame(player) --- Toggles if the frame is open, if open it will close it and if closed it will open it
|
|
||||||
CenterFrames._prototype:event_handler(action) --- Creates an event handler that will trigger one of its functions, use with Event.add
|
|
||||||
]]
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
|
||||||
local Prototype = require 'expcore.gui.prototype' --- @dep expcore.gui.prototype
|
|
||||||
local Toolbar = require 'expcore.gui.concepts.toolbar' --- @dep expcore.gui.concepts.toolbar
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
|
|
||||||
local CenterFrames = {
|
|
||||||
_prototype = Prototype.extend{
|
|
||||||
on_creation = Prototype.event
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Gets the center flow for a player
|
|
||||||
-- @tparam LuaPlayer player the player to get the flow for
|
|
||||||
-- @treturn LuaGuiElement the center flow
|
|
||||||
function CenterFrames.get_flow(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
return player.gui.center
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Clears the center flow for a player
|
|
||||||
-- @tparam LuaPlayer player the player to clear the flow for
|
|
||||||
function CenterFrames.clear_flow(player)
|
|
||||||
local flow = CenterFrames.get_flow(player)
|
|
||||||
flow.clear()
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Draws the center frame for a player, if already open then will do nothing
|
|
||||||
-- @tparam LuaPlayer player the player that will have the frame drawn
|
|
||||||
-- @tparam string name the name of the hui that will drawn
|
|
||||||
-- @treturn LuaGuiElement the new frame that was made
|
|
||||||
function CenterFrames.draw_frame(player,name)
|
|
||||||
local define = Gui.get_define(name,true)
|
|
||||||
if define then
|
|
||||||
return define:draw_frame(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Draws the center frame for a player, if already open then will destroy it and redraw
|
|
||||||
-- @tparam LuaPlayer player the player that will have the frame drawn
|
|
||||||
-- @tparam string name the name of the hui that will drawn
|
|
||||||
-- @treturn LuaGuiElement the new frame that was made
|
|
||||||
function CenterFrames.redraw_frame(player,name)
|
|
||||||
local define = Gui.get_define(name,true)
|
|
||||||
if define then
|
|
||||||
return define:draw_frame(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Toggles if the frame is currently open or not, will open if closed and close if open
|
|
||||||
-- @tparam LuaPlayer player the player that will have the frame toggled
|
|
||||||
-- @tparam string name the name of the hui that will be toggled
|
|
||||||
-- @tparam[opt] boolean state when set will force a state for the frame
|
|
||||||
-- @treturn boolean if the frame if no open or closed
|
|
||||||
function CenterFrames.toggle_frame(player,name,state)
|
|
||||||
local define = Gui.get_define(name,true)
|
|
||||||
if define then
|
|
||||||
if state == true then
|
|
||||||
define:draw_frame(player)
|
|
||||||
return true
|
|
||||||
elseif state == false then
|
|
||||||
local flow = CenterFrames.get_flow(player)
|
|
||||||
if flow[define.name..'-frame'] then
|
|
||||||
flow[define.name..'-frame'].destroy()
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
else
|
|
||||||
return define:toggle_frame(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates a new center frame define
|
|
||||||
-- @tparam string permission_name the name that can be used with the permission system
|
|
||||||
-- @treturn table the new center frame define
|
|
||||||
function CenterFrames.new_frame(permission_name)
|
|
||||||
local self = Toolbar.new_button(permission_name)
|
|
||||||
|
|
||||||
self:on_click(function(player,element)
|
|
||||||
self:toggle_frame(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local mt = getmetatable(self)
|
|
||||||
mt.__index = CenterFrames._prototype
|
|
||||||
mt.__call = self.event_handler
|
|
||||||
|
|
||||||
Gui.on_custom_close(self.name..'-frame',function(event)
|
|
||||||
local element = event.element
|
|
||||||
if element and element.valid then element.destroy() end
|
|
||||||
end)
|
|
||||||
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets the frame to be the current active gui when opened and closes all other frames
|
|
||||||
-- @tparam[opt=true] boolean state when true will auto close other frames and set this frame as player.opened
|
|
||||||
function CenterFrames._prototype:set_auto_focus(state)
|
|
||||||
if state == false then
|
|
||||||
self.auto_focus = false
|
|
||||||
else
|
|
||||||
self.auto_focus = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Draws this frame to the player, if already open does nothing (will call on_draw to draw to the frame)
|
|
||||||
-- @tparam LuaPlayer player the player to draw the frame for
|
|
||||||
-- @treturn LuaGuiElement the new frame that was drawn
|
|
||||||
function CenterFrames._prototype:draw_frame(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
local flow = CenterFrames.get_flow(player)
|
|
||||||
|
|
||||||
if flow[self.name..'-frame'] then
|
|
||||||
return flow[self.name..'-frame']
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.auto_focus then
|
|
||||||
flow.clear()
|
|
||||||
end
|
|
||||||
|
|
||||||
local frame = flow.add{
|
|
||||||
type='frame',
|
|
||||||
name=self.name..'-frame'
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.auto_focus then
|
|
||||||
player.opened = frame
|
|
||||||
end
|
|
||||||
|
|
||||||
self:raise_event('on_creation',player,frame)
|
|
||||||
|
|
||||||
return frame
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Draws this frame to the player, if already open it will remove it and redraw it (will call on_draw to draw to the frame)
|
|
||||||
-- @tparam LuaPlayer player the player to draw the frame for
|
|
||||||
-- @treturn LuaGuiElement the new frame that was drawn
|
|
||||||
function CenterFrames._prototype:redraw_frame(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
local flow = CenterFrames.get_flow(player)
|
|
||||||
|
|
||||||
if flow[self.name..'-frame'] then
|
|
||||||
flow[self.name..'-frame'].destroy()
|
|
||||||
end
|
|
||||||
|
|
||||||
return self:draw_frame(player)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Toggles if the frame is open, if open it will close it and if closed it will open it
|
|
||||||
-- @tparam LuaPlayer player the player to draw the frame for
|
|
||||||
-- @treturn boolean with the gui frame is now open
|
|
||||||
function CenterFrames._prototype:toggle_frame(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
local flow = CenterFrames.get_flow(player)
|
|
||||||
|
|
||||||
if flow[self.name..'-frame'] then
|
|
||||||
flow[self.name..'-frame'].destroy()
|
|
||||||
return false
|
|
||||||
else
|
|
||||||
self:draw_frame(player)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates an event handler that will trigger one of its functions, use with Event.add
|
|
||||||
-- @tparam[opt=update] string action the action to take on this event
|
|
||||||
function CenterFrames._prototype:event_handler(action)
|
|
||||||
action = action or 'update'
|
|
||||||
return function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
self[action](self,player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return CenterFrames
|
|
||||||
@@ -1,322 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Left Guis.
|
|
||||||
-- Gui structure define for left frames
|
|
||||||
-- @section left
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Example formating
|
|
||||||
|
|
||||||
-- first we add config that relates to the button on the toolbar, all normal button functions are present
|
|
||||||
local left_frame =
|
|
||||||
Gui.new_left_frame('test-left-frame')
|
|
||||||
:set_caption('Test Left Gui')
|
|
||||||
:set_post_authenticator(function(player,button_name)
|
|
||||||
return global.show_test_gui
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- then we add the config for the left frame, on_draw should draw the gui from an empty frame, on_update should take a frame from on_draw on edit it
|
|
||||||
:set_open_by_default()
|
|
||||||
:on_draw(function(_player,frame)
|
|
||||||
for _,player in pairs(game.connected_players) do
|
|
||||||
frame.add{
|
|
||||||
type='label',
|
|
||||||
caption=player.name
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- now we can use the action factory to call events on the gui, actions are: 'update', 'update_all', 'redraw', 'redraw_all'
|
|
||||||
Event.add(defines.events.on_player_joined_game,left_frame 'update_all')
|
|
||||||
Event.add(defines.events.on_player_left_game,left_frame 'update_all')
|
|
||||||
|
|
||||||
>>>> Functions
|
|
||||||
LeftFrames.get_flow(player) --- Gets the left frame flow for a player
|
|
||||||
LeftFrames.get_frame(name,player) --- Gets one frame from the left flow by its name
|
|
||||||
LeftFrames.get_open(player) --- Gets all open frames for a player, if non are open it will remove the close all button
|
|
||||||
LeftFrames.toggle_frame(name,player,state) --- Toggles the visibility of a left frame, or sets its visibility state
|
|
||||||
|
|
||||||
LeftFrames.new_frame(permission_name) --- Creates a new left frame define
|
|
||||||
LeftFrames._prototype:set_open_by_default(state) --- Sets if the frame is visible when a player joins, can also be a function to return a boolean
|
|
||||||
LeftFrames._prototype:set_direction(direction) --- Sets the direction of the frame, either vertical or horizontal
|
|
||||||
LeftFrames._prototype:get_frame(player) --- Gets the frame for this define from the left frame flow
|
|
||||||
LeftFrames._prototype:is_open(player) --- Returns if the player currently has this define visible
|
|
||||||
LeftFrames._prototype:toggle(player) --- Toggles the visibility of the left frame
|
|
||||||
|
|
||||||
LeftFrames._prototype:update(player) --- Updates the contents of the left frame, first tries update callback, other wise will clear and redraw
|
|
||||||
LeftFrames._prototype:update_all(update_offline) --- Updates the frame for all players, see update
|
|
||||||
LeftFrames._prototype:redraw(player) --- Redraws the frame by calling on_draw, will always clear the frame
|
|
||||||
LeftFrames._prototype:redraw_all(update_offline) --- Redraws the frame for all players, see redraw
|
|
||||||
|
|
||||||
LeftFrames._prototype:on_draw(player,frame) --- Use to draw your elements to the new frame
|
|
||||||
LeftFrames._prototype:on_update(player,frame) --- Use to edit your frame when there is no need to redraw it
|
|
||||||
LeftFrames._prototype:on_player_toggle(player,frame) --- Is triggered when the player presses the toggle button
|
|
||||||
LeftFrames._prototype:event_handler(action) --- Creates an event handler that will trigger one of its functions, use with Event.add
|
|
||||||
]]
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
|
||||||
local Prototype = require 'expcore.gui.prototype' --- @dep expcore.gui.prototype
|
|
||||||
local Toolbar = require 'expcore.gui.concepts.toolbar' --- @dep expcore.gui.concepts.toolbar
|
|
||||||
local Buttons = require 'expcore.gui.elements.buttons' --- @dep expcore.gui.elements.buttons
|
|
||||||
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
|
||||||
|
|
||||||
local LeftFrames = {
|
|
||||||
frames={},
|
|
||||||
_prototype=Prototype.extend{
|
|
||||||
on_creation = Prototype.event,
|
|
||||||
on_update = Prototype.event,
|
|
||||||
on_player_toggle = Prototype.event
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setmetatable(LeftFrames._prototype, {
|
|
||||||
__index = Buttons._prototype
|
|
||||||
})
|
|
||||||
|
|
||||||
--- Gets the left frame flow for a player
|
|
||||||
-- @tparam LuaPlayer player the player to get the flow of
|
|
||||||
-- @treturn LuaGuiElement the left frame flow for the player
|
|
||||||
function LeftFrames.get_flow(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
return mod_gui.get_frame_flow(player)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets one frame from the left flow by its name
|
|
||||||
-- @tparam string name the name of the gui frame to get
|
|
||||||
-- @tparam LuaPlayer player the player to get the frame of
|
|
||||||
-- @treturn LuaGuiElement the frame in the left frame flow with that name
|
|
||||||
function LeftFrames.get_frame(name,player)
|
|
||||||
local define = LeftFrames.frames[name]
|
|
||||||
if not define then
|
|
||||||
return error('Left Frame '..name..' is not defined.',2)
|
|
||||||
end
|
|
||||||
return define:get_frame(player)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets all open frames for a player, if non are open it will remove the close all button
|
|
||||||
-- @tparam LuaPlayer player the player to get the flow of
|
|
||||||
-- @treturn table contains all the open (and registered) frames for the player
|
|
||||||
function LeftFrames.get_open(player)
|
|
||||||
local open = {}
|
|
||||||
local flow = LeftFrames.get_flow(player)
|
|
||||||
|
|
||||||
for _,define in pairs(LeftFrames.frames) do
|
|
||||||
if define:is_open(player) then
|
|
||||||
table.insert(open,define)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
flow[LeftFrames.toggle_button.name].visible = #open ~= 0
|
|
||||||
|
|
||||||
return open
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Toggles the visibility of a left frame, or sets its visibility state
|
|
||||||
-- @tparam string name the name of the gui frame to toggle
|
|
||||||
-- @tparam LuaPlayer player the player to get the frame of
|
|
||||||
-- @tparam[opt] boolean state when given will be the state that the visibility is set to
|
|
||||||
-- @treturn boolean the new state of the visibility
|
|
||||||
function LeftFrames.toggle_frame(name,player,state)
|
|
||||||
local define = LeftFrames.frames[name]
|
|
||||||
if not define then
|
|
||||||
return error('Left Frame '..name..' is not defined.',2)
|
|
||||||
end
|
|
||||||
|
|
||||||
local frame = LeftFrames.get_frame(name,player)
|
|
||||||
if state ~= nil then
|
|
||||||
frame.visible = state
|
|
||||||
else
|
|
||||||
Gui.toggle_visible(frame)
|
|
||||||
end
|
|
||||||
|
|
||||||
LeftFrames.get_open(player)
|
|
||||||
|
|
||||||
return frame.visible
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates a new left frame define
|
|
||||||
-- @tparam string permission_name the name that can be used with the permission system
|
|
||||||
-- @treturn table the new left frame define
|
|
||||||
function LeftFrames.new_frame(permission_name)
|
|
||||||
local self = Toolbar.new_button(permission_name)
|
|
||||||
|
|
||||||
local mt = getmetatable(self)
|
|
||||||
mt.__index = LeftFrames._prototype
|
|
||||||
mt.__call = self.event_handler
|
|
||||||
|
|
||||||
self:on_click(function(player,_element)
|
|
||||||
local visible = self:toggle(player)
|
|
||||||
local frame = self:get_frame(player)
|
|
||||||
self:raise_event('on_player_toggle',player,frame,visible)
|
|
||||||
end)
|
|
||||||
|
|
||||||
LeftFrames.frames[self.name] = self
|
|
||||||
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets if the frame is visible when a player joins, can also be a function to return a boolean
|
|
||||||
-- @tparam[opt=true] ?boolean|function state the default state of the visibility, can be a function
|
|
||||||
-- state param - player LuaPlayer - the player that has joined the game
|
|
||||||
-- state param - define_name string - the define name for the frame
|
|
||||||
-- state return - boolean - false will hide the frame
|
|
||||||
function LeftFrames._prototype:set_open_by_default(state)
|
|
||||||
if state == false then
|
|
||||||
self.open_by_default = false
|
|
||||||
elseif state == nil then
|
|
||||||
self.open_by_default = true
|
|
||||||
else
|
|
||||||
self.open_by_default = state
|
|
||||||
end
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets the direction of the frame, either vertical or horizontal
|
|
||||||
-- @tparam string direction the direction to have the elements be added to the frame
|
|
||||||
function LeftFrames._prototype:set_direction(direction)
|
|
||||||
self.direction = direction
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates the gui for the first time, used internally
|
|
||||||
-- @tparam LuaPlayer player the player to draw the frame to
|
|
||||||
-- @treturn LuaGuiElement the frame that was made
|
|
||||||
function LeftFrames._prototype:_internal_draw(player)
|
|
||||||
local flow = LeftFrames.get_flow(player)
|
|
||||||
local frame = flow.add{
|
|
||||||
type='frame',
|
|
||||||
name=self.name..'-frame',
|
|
||||||
direction=self.direction
|
|
||||||
}
|
|
||||||
|
|
||||||
self:raise_event('on_creation',player,frame)
|
|
||||||
|
|
||||||
if not self.open_by_default then
|
|
||||||
frame.visible = false
|
|
||||||
elseif type(self.open_by_default) == 'function' then
|
|
||||||
if not self.open_by_default(player,self.name) then
|
|
||||||
frame.visible = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not Toolbar.allowed(player,self.name) then
|
|
||||||
frame.visible = false
|
|
||||||
end
|
|
||||||
|
|
||||||
return frame
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets the frame for this define from the left frame flow
|
|
||||||
-- @tparam LuaPlayer player the player to get the frame of
|
|
||||||
-- @treturn LuaGuiElement the frame in the left frame flow for this define
|
|
||||||
function LeftFrames._prototype:get_frame(player)
|
|
||||||
local flow = LeftFrames.get_flow(player)
|
|
||||||
if flow[self.name..'-frame'] and flow[self.name..'-frame'].valid then
|
|
||||||
return flow[self.name..'-frame']
|
|
||||||
else
|
|
||||||
return self:_internal_draw(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Returns if the player currently has this define visible
|
|
||||||
-- @tparam LuaPlayer player the player to get the frame of
|
|
||||||
-- @treturn boolean true if it is open/visible
|
|
||||||
function LeftFrames._prototype:is_open(player)
|
|
||||||
local frame = self:get_frame(player)
|
|
||||||
return frame and frame.visible or false
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Toggles the visibility of the left frame
|
|
||||||
-- @tparam LuaPlayer player the player to toggle the frame of
|
|
||||||
-- @treturn boolean the new state of the visibility
|
|
||||||
function LeftFrames._prototype:toggle(player)
|
|
||||||
local frame = self:get_frame(player)
|
|
||||||
Gui.toggle_visible(frame)
|
|
||||||
LeftFrames.get_open(player)
|
|
||||||
return frame.visible
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Updates the contents of the left frame, first tries update callback, other wise will clear and redraw
|
|
||||||
-- @tparam LuaPlayer player the player to update the frame of
|
|
||||||
function LeftFrames._prototype:update(player)
|
|
||||||
local frame = self:get_frame(player)
|
|
||||||
if self:raise_event('on_update',player,frame) == 0 then
|
|
||||||
frame.clear()
|
|
||||||
self:raise_event('on_creation',player,frame)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Updates the frame for all players, see update
|
|
||||||
-- @tparam[opt=false] boolean update_offline when true will update the frame for offline players
|
|
||||||
function LeftFrames._prototype:update_all(update_offline)
|
|
||||||
local players = update_offline == true and game.players or game.connected_players
|
|
||||||
for _,player in pairs(players) do
|
|
||||||
self:update(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Redraws the frame by calling on_draw, will always clear the frame
|
|
||||||
-- @tparam LuaPlayer player the player to update the frame of
|
|
||||||
function LeftFrames._prototype:redraw(player)
|
|
||||||
local frame = self:get_frame(player)
|
|
||||||
frame.clear()
|
|
||||||
self:raise_event('on_creation',player,frame)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Redraws the frame for all players, see redraw
|
|
||||||
-- @tparam[opt=false] boolean update_offline when true will update the frame for offline players
|
|
||||||
function LeftFrames._prototype:redraw_all(update_offline)
|
|
||||||
local players = update_offline == true and game.players or game.connected_players
|
|
||||||
for _,player in pairs(players) do
|
|
||||||
self:redraw(player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates an event handler that will trigger one of its functions, use with Event.add
|
|
||||||
-- @tparam[opt=update] string action the action to take on this event
|
|
||||||
function LeftFrames._prototype:event_handler(action)
|
|
||||||
action = action or 'update'
|
|
||||||
return function(event)
|
|
||||||
local player
|
|
||||||
if event and event.player_index then
|
|
||||||
player = Game.get_player_by_index(event.player_index)
|
|
||||||
end
|
|
||||||
self[action](self,player)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
LeftFrames.toggle_button =
|
|
||||||
Buttons.new_button()
|
|
||||||
:set_tooltip{'expcore-gui.left-button-tooltip'}
|
|
||||||
:set_caption('<')
|
|
||||||
:on_click(function(player,element)
|
|
||||||
for _,define in pairs(LeftFrames.frames) do
|
|
||||||
local frame = LeftFrames.get_frame(define.name,player)
|
|
||||||
frame.visible = false
|
|
||||||
define:raise_event('on_player_toggle',player,frame,false)
|
|
||||||
end
|
|
||||||
element.visible = false
|
|
||||||
end)
|
|
||||||
|
|
||||||
Event.add(defines.events.on_player_created,function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
local flow = LeftFrames.get_flow(player)
|
|
||||||
|
|
||||||
local close_button = LeftFrames.toggle_button(flow)
|
|
||||||
Gui.set_padding(close_button)
|
|
||||||
local style = close_button.style
|
|
||||||
style.width = 18
|
|
||||||
style.height = 36
|
|
||||||
style.font = 'default-small-bold'
|
|
||||||
|
|
||||||
for _,define in pairs(LeftFrames.frames) do
|
|
||||||
define:_internal_draw(player)
|
|
||||||
end
|
|
||||||
|
|
||||||
LeftFrames.get_open(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
return LeftFrames
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Popups.
|
|
||||||
-- Gui structure define for popup gui
|
|
||||||
-- @section popups
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Functions
|
|
||||||
PopupFrames.get_flow(player) --- Gets the left flow that contains the popup frames
|
|
||||||
PopupFrames.open(define_name,player,open_time,...) --- Opens a popup for the player, can give the amount of time it is open as well as params for the draw function
|
|
||||||
|
|
||||||
PopupFrames.close_progress --- Progress bar which when depleted will close the popup frame
|
|
||||||
PopupFrames.close_button --- A button which can be used to close the gui before the timer runs out
|
|
||||||
|
|
||||||
PopupFrames.new_popup(name) --- Creates a new popup frame define
|
|
||||||
PopupFrames._prototype:set_default_open_time(amount) --- Sets the default open time for the popup, will be used if non is provided with open
|
|
||||||
PopupFrames._prototype:open(player,open_time,...) --- Opens this define for a player, can be given open time and any other params for the draw function
|
|
||||||
]]
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
|
||||||
local Prototype = require 'expcore.gui.prototype' --- @dep expcore.gui.prototype
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
|
||||||
local ProgressBar = require 'expcore.gui.elements.progress-bar' --- @dep expcore.gui.elements.progress-bar
|
|
||||||
local Button = require 'expcore.gui.elements.buttons' --- @dep expcore.gui.elements.buttons
|
|
||||||
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
|
||||||
local Color = require 'resources.color_presets' --- @dep resources.color_presets
|
|
||||||
local Global = require 'utils.global' --- @dep utils.global
|
|
||||||
|
|
||||||
local PopupFrames = {
|
|
||||||
paused_popups={},
|
|
||||||
popup_flow_name = Gui.uid_name(),
|
|
||||||
main_frame_name = Gui.uid_name(),
|
|
||||||
close_frame_name = Gui.uid_name(),
|
|
||||||
_prototype = Prototype.extend{
|
|
||||||
on_creation = Prototype.event
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Global.register(PopupFrames.paused_popups,function(tbl)
|
|
||||||
PopupFrames.paused_popups = tbl
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- Sets the state of the element in the paused list, nil or true
|
|
||||||
-- @tparam LuaGuiElement element the element to set the state of
|
|
||||||
-- @tparam[opt] boolean state the state to set it to, true will pause the the progress bar
|
|
||||||
local function set_paused_state(element,state)
|
|
||||||
local name = element.player_index..':'..element.index
|
|
||||||
PopupFrames.paused_popups[name] = state
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets the state of the element in the paused list, nil or true
|
|
||||||
-- @tparam LuaGuiElement element the element to get the state of
|
|
||||||
local function get_paused_state(element)
|
|
||||||
local name = element.player_index..':'..element.index
|
|
||||||
return PopupFrames.paused_popups[name]
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets the left flow that contains the popup frames
|
|
||||||
-- @tparam LuaPlayer player the player to get the flow for
|
|
||||||
-- @treturn LuaGuiElement the left flow that contains the popup frames
|
|
||||||
function PopupFrames.get_flow(player)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
local flow = mod_gui.get_frame_flow(player)
|
|
||||||
return flow[PopupFrames.popup_flow_name]
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Opens a popup for the player, can give the amount of time it is open as well as params for the draw function
|
|
||||||
-- @tparam string define_name the name of the define that you want to open for the player
|
|
||||||
-- @tparam LuaPlayer player the player to open the popup for
|
|
||||||
-- @tparam[opt] number open_time the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default
|
|
||||||
-- @tparam any ... the other params that you want to pass to your on_draw event
|
|
||||||
-- @treturn LuaGuiElement the frame that was drawn, the inner gui flow which contains the content
|
|
||||||
function PopupFrames.open(define_name,player,open_time,...)
|
|
||||||
local define = Gui.get_define(define_name,true)
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
return define:open(player,open_time,...)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Closes the popup, is called by progress bar and close button
|
|
||||||
-- @tparam LuaGuiElement element either the progress bar or the close button
|
|
||||||
local function close_popup(element)
|
|
||||||
local frame = element.parent.parent.parent
|
|
||||||
if not frame or not frame.valid then return end
|
|
||||||
set_paused_state(element.parent[PopupFrames.close_progress:uid()])
|
|
||||||
frame.destroy()
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Progress bar which when depleted will close the popup frame
|
|
||||||
PopupFrames.close_progress =
|
|
||||||
ProgressBar.new_progressbar()
|
|
||||||
:use_count_down()
|
|
||||||
:set_tooltip('Pause/Resume Auto-close')
|
|
||||||
:on_complete(function(player,element)
|
|
||||||
close_popup(element)
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- A button which can be used to close the gui before the timer runs out
|
|
||||||
PopupFrames.close_button =
|
|
||||||
Button.new_button()
|
|
||||||
:set_sprites('utility/close_white')
|
|
||||||
:set_tooltip('Close Popup')
|
|
||||||
:on_click(function(player,element)
|
|
||||||
close_popup(element)
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- When the progress bar is clicked it will pause its progress, or resume if previously paused
|
|
||||||
Gui.on_click(PopupFrames.close_progress:uid(),function(event)
|
|
||||||
local element = event.element
|
|
||||||
if get_paused_state(element) then
|
|
||||||
set_paused_state(element)
|
|
||||||
else
|
|
||||||
set_paused_state(element,true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- When the parent flow of the progress bar is clicked it will pause its progress, or resume if previously paused
|
|
||||||
Gui.on_click(PopupFrames.close_frame_name,function(event)
|
|
||||||
local element = event.element[PopupFrames.close_progress:uid()]
|
|
||||||
if get_paused_state(element) then
|
|
||||||
set_paused_state(element)
|
|
||||||
else
|
|
||||||
set_paused_state(element,true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- Creates a new popup frame define
|
|
||||||
-- @tparam[opt] string name the optional debug name that can be added
|
|
||||||
-- @treturn table the new popup frame define
|
|
||||||
function PopupFrames.new_popup(name)
|
|
||||||
local self = Gui.new_define(PopupFrames._prototype,name)
|
|
||||||
self.draw_data.type = 'flow'
|
|
||||||
self.draw_data.direction = 'vertical'
|
|
||||||
|
|
||||||
local mt = getmetatable(self)
|
|
||||||
mt.__call = function(tbl,player,open_time,...)
|
|
||||||
return tbl:open(player,open_time,...)
|
|
||||||
end
|
|
||||||
|
|
||||||
self:on_draw(function(player,element,maximum,...)
|
|
||||||
-- main content frame
|
|
||||||
local frame = element.add{
|
|
||||||
type='flow',
|
|
||||||
name=PopupFrames.main_frame_name
|
|
||||||
}
|
|
||||||
frame.style.horizontally_stretchable = true
|
|
||||||
|
|
||||||
-- flow for progress bar and close button
|
|
||||||
local close_flow = element.add{
|
|
||||||
type='flow',
|
|
||||||
name=PopupFrames.close_frame_name
|
|
||||||
}
|
|
||||||
close_flow.style.horizontally_stretchable = true
|
|
||||||
|
|
||||||
-- progress bar, when 0 then a static full one is drawn
|
|
||||||
local progress_style
|
|
||||||
if maximum == 0 then
|
|
||||||
progress_style = close_flow.add{
|
|
||||||
type='progressbar',
|
|
||||||
tooltip='No Auto-close',
|
|
||||||
value=1
|
|
||||||
}.style
|
|
||||||
else
|
|
||||||
progress_style = PopupFrames.close_progress(close_flow,maximum).style
|
|
||||||
end
|
|
||||||
progress_style.top_padding = 6
|
|
||||||
progress_style.bottom_padding = 3
|
|
||||||
progress_style.height = 11
|
|
||||||
progress_style.color = Color.grey
|
|
||||||
|
|
||||||
-- close button, will close the popup when clicked
|
|
||||||
local close_button = PopupFrames.close_button(close_flow)
|
|
||||||
Gui.set_padding(close_button)
|
|
||||||
local close_button_style = close_button.style
|
|
||||||
close_button_style.width = 20
|
|
||||||
close_button_style.height = 20
|
|
||||||
|
|
||||||
-- event trigger to draw the gui content
|
|
||||||
self:raise_event('on_creation',player,frame,...)
|
|
||||||
end)
|
|
||||||
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets the default open time for the popup, will be used if non is provided with open
|
|
||||||
-- @tparam number amount the number of ticks, by default, the popup will be open for
|
|
||||||
-- @treturn table the define to allow for chaining
|
|
||||||
function PopupFrames._prototype:set_default_open_time(amount)
|
|
||||||
self.default_open_time = amount
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Opens this define for a player, can be given open time and any other params for the draw function
|
|
||||||
-- @tparam LuaPlayer player the player to open the popup for
|
|
||||||
-- @tparam[opt] number open_time the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default
|
|
||||||
-- @tparam any ... the other params that you want to pass to your on_draw event
|
|
||||||
-- @treturn LuaGuiElement the frame that was drawn, the inner gui flow which contains the content
|
|
||||||
function PopupFrames._prototype:open(player,open_time,...)
|
|
||||||
open_time = open_time or self.default_open_time or 0
|
|
||||||
player = Game.get_player_from_any(player)
|
|
||||||
|
|
||||||
local flow = PopupFrames.get_flow(player)
|
|
||||||
local frame = flow.add{
|
|
||||||
type='frame',
|
|
||||||
style='blurry_frame'
|
|
||||||
}
|
|
||||||
|
|
||||||
Gui.set_padding(frame,3,3,4,4)
|
|
||||||
return self:draw_to(frame,open_time,...)[PopupFrames.main_frame_name]
|
|
||||||
end
|
|
||||||
|
|
||||||
--- When player is first created the popup flow is added to they left flow
|
|
||||||
Event.add(defines.events.on_player_created,function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
local flow = mod_gui.get_frame_flow(player)
|
|
||||||
|
|
||||||
flow.add{
|
|
||||||
type='flow',
|
|
||||||
direction='vertical',
|
|
||||||
name=PopupFrames.popup_flow_name
|
|
||||||
}
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- Every tick any, not paused, progress bars will go down by one tick
|
|
||||||
Event.add(defines.events.on_tick,PopupFrames.close_progress:event_countdown(function(element)
|
|
||||||
return not get_paused_state(element)
|
|
||||||
end))
|
|
||||||
|
|
||||||
return PopupFrames
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Toolbar.
|
|
||||||
-- Gui structure for the toolbar (top left)
|
|
||||||
-- @section toolbar
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Example format
|
|
||||||
-- this is the same as any other button define, this just automatically draws it
|
|
||||||
-- you can use add_button if you already defined the button
|
|
||||||
local toolbar_button =
|
|
||||||
Toolbar.new_button('print-click')
|
|
||||||
:on_click(function(player,_element)
|
|
||||||
player.print('You clicked a button!')
|
|
||||||
end)
|
|
||||||
|
|
||||||
>>>> Functions
|
|
||||||
Toolbar.new_button(name) --- Adds a new button to the toolbar
|
|
||||||
Toolbar.add_button(button) --- Adds an existing buttton to the toolbar
|
|
||||||
Toolbar.update(player) --- Updates the player's toolbar with an new buttons or expected change in auth return
|
|
||||||
]]
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
|
||||||
local Buttons = require 'expcore.gui.elements.buttons' --- @dep expcore.gui.elements.buttons
|
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
|
||||||
|
|
||||||
local Toolbar = {
|
|
||||||
permission_names = {},
|
|
||||||
buttons = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
function Toolbar.allowed(player,define_name)
|
|
||||||
local permission_name = Toolbar.permission_names[define_name] or define_name
|
|
||||||
return Roles.player_allowed(player,permission_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function Toolbar.permission_alias(define_name,permission_name)
|
|
||||||
Toolbar.permission_names[define_name] = permission_name
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Adds a new button to the toolbar
|
|
||||||
-- @tparam[opt] string name when given allows an alias to the button for the permission system
|
|
||||||
-- @treturn table the button define
|
|
||||||
function Toolbar.new_button(name)
|
|
||||||
local button =
|
|
||||||
Buttons.new_button()
|
|
||||||
:set_post_authenticator(Toolbar.allowed)
|
|
||||||
:set_style(mod_gui.button_style,function(style)
|
|
||||||
Gui.set_padding_style(style,-2,-2,-2,-2)
|
|
||||||
end)
|
|
||||||
Toolbar.add_button(button)
|
|
||||||
Toolbar.permission_alias(button.name,name)
|
|
||||||
return button
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Adds an existing buttton to the toolbar
|
|
||||||
-- @tparam table button the button define for the button to be added
|
|
||||||
function Toolbar.add_button(button)
|
|
||||||
table.insert(Toolbar.buttons,button)
|
|
||||||
Gui.allow_player_to_toggle_top_element_visibility(button.name)
|
|
||||||
Gui.on_player_show_top(button.name,function(event)
|
|
||||||
if not button.post_authenticator(event.player,button.name) then
|
|
||||||
event.element.visible = false
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
if not button.post_authenticator then
|
|
||||||
button:set_post_authenticator(function() return true end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Updates the player's toolbar with an new buttons or expected change in auth return
|
|
||||||
-- @tparam LuaPlayer player the player to update the toolbar for
|
|
||||||
function Toolbar.update(player)
|
|
||||||
local top = Gui.get_top_element_flow(player)
|
|
||||||
if not top then return end
|
|
||||||
local visible = top[Gui.top_toggle_button_name].caption == '<'
|
|
||||||
for _,button in pairs(Toolbar.buttons) do
|
|
||||||
local element
|
|
||||||
if top[button.name] then element = top[button.name]
|
|
||||||
else element = button:draw_to(top) end
|
|
||||||
if button.post_authenticator(player,button.name) then
|
|
||||||
element.visible = visible
|
|
||||||
element.enabled = true
|
|
||||||
else
|
|
||||||
element.visible = false
|
|
||||||
element.enabled = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- When there is a new player they will have the toolbar update
|
|
||||||
Event.add(defines.events.on_player_created,function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
Toolbar.update(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- When a player gets a new role they will have the toolbar updated
|
|
||||||
Event.add(Roles.events.on_role_assigned,function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
Toolbar.update(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
--- When a player loses a role they will have the toolbar updated
|
|
||||||
Event.add(Roles.events.on_role_unassigned,function(event)
|
|
||||||
local player = Game.get_player_by_index(event.player_index)
|
|
||||||
Toolbar.update(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
return Toolbar
|
|
||||||
@@ -1,368 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Core.
|
|
||||||
-- Core gui file for making element defines and element classes (use require 'expcore.gui')
|
|
||||||
-- see utils.gui for event handlering
|
|
||||||
-- see expcore.gui.test for examples for element defines
|
|
||||||
-- @section core
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Basic useage with no defines
|
|
||||||
This module can be igroned if you are only wanting only event handlers as utils.gui adds the following:
|
|
||||||
|
|
||||||
Gui.uid_name() --- Generates a unqiue name to register events to
|
|
||||||
Gui.on_checked_state_changed(callback) --- Register a handler for the on_gui_checked_state_changed event
|
|
||||||
Gui.on_click(callback) --- Register a handler for the on_gui_click event
|
|
||||||
Gui.on_elem_changed(callback) --- Register a handler for the on_gui_elem_changed
|
|
||||||
Gui.on_selection_state_changed(callback) --- Register a handler for the on_gui_selection_state_changed event
|
|
||||||
Gui.on_text_changed(callback) --- Register a handler for the on_gui_text_changed event
|
|
||||||
Gui.on_value_changed(callback) --- Register a handler for the on_gui_value_changed event
|
|
||||||
|
|
||||||
Note that all event handlers will include event.player as a valid player and that if the player or the
|
|
||||||
element is not valid then the callback will not be run.
|
|
||||||
|
|
||||||
>>>> Basic prototype functions (see expcore.gui.prototype)
|
|
||||||
Using a class defination you can create a new element dinfation in our examples we will be using the checkbox.
|
|
||||||
|
|
||||||
local checkbox_example = Gui.new_checkbox()
|
|
||||||
|
|
||||||
Although all class definations are stored in Gui.classes the main function used to make new element defination are
|
|
||||||
made aviable in the top level gui module. All functions which return a new element defination will accept a name argument
|
|
||||||
which is a name which is used while debuging and is not required to be used (has not been used in examples)
|
|
||||||
|
|
||||||
Every element define will accept a caption and tooltip (although some may not show) and to do this you would use the two
|
|
||||||
set function provided for the element defines:
|
|
||||||
|
|
||||||
checkbox_example:set_caption('Example Checkbox')
|
|
||||||
checkbox_example:set_tooltip('Example checkbox')
|
|
||||||
|
|
||||||
Each element define can have event handlers set, for our example checkbox we only have access to on_change which will trigger
|
|
||||||
when the state of the checkbox changes; if we want to assign handlers using the utils.gui methods then we can get the uid by calling
|
|
||||||
the uid function on the element define; however, each element can only have one handler (of each event) so it is not possible to use
|
|
||||||
Gui.on_checked_state_changed and on_change at the same time in our example.
|
|
||||||
|
|
||||||
checkbox_example:on_change(function(player,element,value)
|
|
||||||
player.print('Example checkbox is now: '..tostring(value))
|
|
||||||
end)
|
|
||||||
|
|
||||||
local checkbox_example_uid = checkbox_example:uid()
|
|
||||||
Gui.on_click(checkbox_example_uid,function(event)
|
|
||||||
event.player.print('You clicked the example checkbox!')
|
|
||||||
end)
|
|
||||||
|
|
||||||
Finally you will want to draw your element defines for which you can call deirectly on the deinfe or use Gui.draw to do; when Gui.draw is
|
|
||||||
used it can be given either the element define, the define's uid or the debug name of the define (if set):
|
|
||||||
|
|
||||||
checkbox_example:draw_to(parent_element)
|
|
||||||
Gui.draw(checkbox_example_uid,parent_element)
|
|
||||||
|
|
||||||
>>>> Using authenticators with draw
|
|
||||||
When an element is drawn to its parent it can always be used but if you want to limit who can use it then you can use an authenticator. There
|
|
||||||
are two types which can be used: post and pre; using a pre authenticator will mean that the draw function is stoped before the element is added
|
|
||||||
to the parent element while using a post authenticator will draw the element to the parent but will disable the element from interaction. Both may
|
|
||||||
be used if you have use for such.
|
|
||||||
|
|
||||||
-- unless global.checkbox_example_allow_pre_auth is true then the checkbox will not be drawn
|
|
||||||
checkbox_example:set_pre_authenticator(function(player,define_name)
|
|
||||||
player.print('Example checkbox pre auth callback ran')
|
|
||||||
return global.checkbox_example_allow_pre_auth
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- unless global.checkbox_example_allow_post_auth is true then the checkbox will be drawn but deactiveated (provided pre auth returns true)
|
|
||||||
checkbox_example:set_post_authenticator(function(player,define_name)
|
|
||||||
player.print('Example checkbox pre auth callback ran')
|
|
||||||
return global.checkbox_example_allow_post_auth
|
|
||||||
end)
|
|
||||||
|
|
||||||
>>>> Using store (see expcore.gui.prototype and expcore.gui.instances)
|
|
||||||
A powerful assept of this gui system is allowing an automatic store for the state of a gui element, this means that when a gui is closed and re-opened
|
|
||||||
the elements which have a store will retain they value even if the element was previously destroied. The store is not limited to only per player and can
|
|
||||||
be catergorised by any method you want such as one that is shared between all players or by all players on a force. Using a method that is not limited to
|
|
||||||
one player means that when one player changes the state of the element it will be automaticlly updated for all other player (even if the element is already drawn)
|
|
||||||
and so this is a powerful and easy way to sync gui elements.
|
|
||||||
|
|
||||||
-- note the example below is the same as checkbox_example:add_store(Gui.categorize_by_player)
|
|
||||||
checkbox_example:add_store(function(element)
|
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
return player.force.name
|
|
||||||
end)
|
|
||||||
|
|
||||||
Of course this tool is not limited to only player interactions; the current satate of a define can be gotten using a number of methods and the value can
|
|
||||||
even be updated by the script and have all instances of the element define be updated. When you use a category then we must give a category to the get
|
|
||||||
and set functions; in our case we used Gui.categorize_by_player which uses the player's name as the category which is why 'Cooldude2606' is given as a argument,
|
|
||||||
if we did not set a function for add_store then all instances for all players have the same value and so a category is not required.
|
|
||||||
|
|
||||||
checkbox_example:get_store('Cooldude2606')
|
|
||||||
Gui.get_store(name,'Cooldude2606')
|
|
||||||
|
|
||||||
checkbox_example:set_store('Cooldude2606',true)
|
|
||||||
Gui.set_store(name,'Cooldude2606',true)
|
|
||||||
|
|
||||||
These methods use the Store module which means that if you have the need to access these sotre location (for example if you want to add a watch function) then
|
|
||||||
you can get the store location of any define using checkbox_example.store
|
|
||||||
|
|
||||||
Important note about event handlers: when the store is updated it will also trigger the event handlers (such as on_element_update) for that define but only
|
|
||||||
for the valid instances of the define which means if a player does not have the element drawn on a gui then it will not trigger the events; if you want a
|
|
||||||
trigger for all updates then you can use on_store_update however you will be required to parse the category which may or may not be a
|
|
||||||
player name (depends what store categorize function you use)
|
|
||||||
|
|
||||||
>>>> Example formating
|
|
||||||
|
|
||||||
local checkbox_example =
|
|
||||||
Gui.new_checkbox()
|
|
||||||
:set_caption('Example Checkbox')
|
|
||||||
:set_tooltip('Example checkbox')
|
|
||||||
:add_store(Gui.categorize_by_player)
|
|
||||||
:on_element_update(function(player,element,value)
|
|
||||||
player.print('Example checkbox is now: '..tostring(value))
|
|
||||||
end)
|
|
||||||
|
|
||||||
>>>> Functions
|
|
||||||
Gui.new_define(prototype) --- Used internally to create new element defines from a class prototype
|
|
||||||
Gui.draw(name,element) --- Draws a copy of the element define to the parent element, see draw_to
|
|
||||||
|
|
||||||
Gui.categorize_by_player(element) --- A categorize function to be used with add_store, each player has their own value
|
|
||||||
Gui.categorize_by_force(element) --- A categorize function to be used with add_store, each force has its own value
|
|
||||||
Gui.categorize_by_surface(element) --- A categorize function to be used with add_store, each surface has its own value
|
|
||||||
|
|
||||||
Gui.toggle_enabled(element) --- Will toggle the enabled state of an element
|
|
||||||
Gui.toggle_visible(element) --- Will toggle the visiblity of an element
|
|
||||||
Gui.set_padding(element,up,down,left,right) --- Sets the padding for a gui element
|
|
||||||
Gui.set_padding_style(style,up,down,left,right) --- Sets the padding for a gui style
|
|
||||||
Gui.create_alignment(element,flow_name) --- Allows the creation of a right align flow to place elements into
|
|
||||||
Gui.destroy_if_valid(element) --- Destroies an element but tests for it being present and valid first
|
|
||||||
Gui.create_scroll_table(element,table_size,maximal_height,name) --- Creates a scroll area with a table inside, table can be any size
|
|
||||||
Gui.create_header(element,caption,tooltip,right_align,name) --- Creates a header section with a label and button area
|
|
||||||
]]
|
|
||||||
local Gui = require 'utils.gui' --- @dep utils.gui
|
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
|
||||||
|
|
||||||
Gui.classes = {} -- Stores the class definations used to create element defines
|
|
||||||
Gui.defines = {} -- Stores the indivdual element definations
|
|
||||||
Gui.names = {} -- Stores debug names to link to gui uids
|
|
||||||
|
|
||||||
--- Used to create new element defines from a class prototype, please use the own given by the class
|
|
||||||
-- @tparam table prototype the class prototype that will be used for the element define
|
|
||||||
-- @tparam[opt] string debug_name the name that you want to see while debuging
|
|
||||||
-- @treturn table the new element define with all functions accessed via __index metamethod
|
|
||||||
function Gui.new_define(prototype,debug_name)
|
|
||||||
local name = Gui.uid_name()
|
|
||||||
local define = setmetatable({
|
|
||||||
debug_name = debug_name,
|
|
||||||
name = name,
|
|
||||||
events = {},
|
|
||||||
draw_data = {
|
|
||||||
name = name
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
__index = prototype,
|
|
||||||
__call = function(self,...)
|
|
||||||
return self:draw_to(...)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
Gui.defines[define.name] = define
|
|
||||||
return define
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Gets an element define give the uid, debug name or a copy of the element define
|
|
||||||
-- @tparam ?string|table name the uid, debug name or define for the element define to get
|
|
||||||
-- @tparam[opt] boolean internal when true the error trace is one level higher (used internally)
|
|
||||||
-- @treturn table the element define that was found or an error
|
|
||||||
function Gui.get_define(name,internal)
|
|
||||||
if type(name) == 'table' then
|
|
||||||
if name.name and Gui.defines[name.name] then
|
|
||||||
return Gui.defines[name.name]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local define = Gui.defines[name]
|
|
||||||
|
|
||||||
if not define and Gui.names[name] then
|
|
||||||
return Gui.defines[Gui.names[name]]
|
|
||||||
|
|
||||||
elseif not define then
|
|
||||||
return error('Invalid name for element define, name not found.',internal and 3 or 2) or nil
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
return define
|
|
||||||
end
|
|
||||||
|
|
||||||
--- A categorize function to be used with add_store, each player has their own value
|
|
||||||
-- @tparam LuaGuiElement element the element that will be converted to a string
|
|
||||||
-- @treturn string the player's name who owns this element
|
|
||||||
function Gui.categorize_by_player(element)
|
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
return player.name
|
|
||||||
end
|
|
||||||
|
|
||||||
--- A categorize function to be used with add_store, each force has its own value
|
|
||||||
-- @tparam LuaGuiElement element the element that will be converted to a string
|
|
||||||
-- @treturn string the player's force name who owns this element
|
|
||||||
function Gui.categorize_by_force(element)
|
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
return player.force.name
|
|
||||||
end
|
|
||||||
|
|
||||||
--- A categorize function to be used with add_store, each surface has its own value
|
|
||||||
-- @tparam LuaGuiElement element the element that will be converted to a string
|
|
||||||
-- @treturn string the player's surface name who owns this element
|
|
||||||
function Gui.categorize_by_surface(element)
|
|
||||||
local player = Game.get_player_by_index(element.player_index)
|
|
||||||
return player.surface.name
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Draws a copy of the element define to the parent element, see draw_to
|
|
||||||
-- @tparam ?string|table name the uid, debug name or define for the element define to draw
|
|
||||||
-- @tparam LuaGuiEelement element the parent element that it the define will be drawn to
|
|
||||||
-- @treturn LuaGuiElement the new element that was created
|
|
||||||
function Gui.draw(name,element,...)
|
|
||||||
local define = Gui.get_define(name,true)
|
|
||||||
return define:draw_to(element,...)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Will toggle the enabled state of an element
|
|
||||||
-- @tparam LuaGuiElement element the gui element to toggle
|
|
||||||
-- @treturn boolean the new state that the element has
|
|
||||||
function Gui.toggle_enabled(element)
|
|
||||||
if not element or not element.valid then return end
|
|
||||||
if not element.enabled then
|
|
||||||
element.enabled = true
|
|
||||||
else
|
|
||||||
element.enabled = false
|
|
||||||
end
|
|
||||||
return element.enabled
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Will toggle the visiblity of an element
|
|
||||||
-- @tparam LuaGuiElement element the gui element to toggle
|
|
||||||
-- @treturn boolean the new state that the element has
|
|
||||||
function Gui.toggle_visible(element)
|
|
||||||
if not element or not element.valid then return end
|
|
||||||
if not element.visible then
|
|
||||||
element.visible = true
|
|
||||||
else
|
|
||||||
element.visible = false
|
|
||||||
end
|
|
||||||
return element.visible
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets the padding for a gui element
|
|
||||||
-- @tparam LuaGuiElement element the element to set the padding for
|
|
||||||
-- @tparam[opt=0] number up the amount of padding on the top
|
|
||||||
-- @tparam[opt=0] number down the amount of padding on the bottom
|
|
||||||
-- @tparam[opt=0] number left the amount of padding on the left
|
|
||||||
-- @tparam[opt=0] number right the amount of padding on the right
|
|
||||||
function Gui.set_padding(element,up,down,left,right)
|
|
||||||
local style = element.style
|
|
||||||
style.top_padding = up or 0
|
|
||||||
style.bottom_padding = down or 0
|
|
||||||
style.left_padding = left or 0
|
|
||||||
style.right_padding = right or 0
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Sets the padding for a gui style
|
|
||||||
-- @tparam LuaStyle style the element to set the padding for
|
|
||||||
-- @tparam[opt=0] number up the amount of padding on the top
|
|
||||||
-- @tparam[opt=0] number down the amount of padding on the bottom
|
|
||||||
-- @tparam[opt=0] number left the amount of padding on the left
|
|
||||||
-- @tparam[opt=0] number right the amount of padding on the right
|
|
||||||
function Gui.set_padding_style(style,up,down,left,right)
|
|
||||||
style.top_padding = up or 0
|
|
||||||
style.bottom_padding = down or 0
|
|
||||||
style.left_padding = left or 0
|
|
||||||
style.right_padding = right or 0
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Allows the creation of an alignment flow to place elements into
|
|
||||||
-- @tparam LuaGuiElement element the element to add this alignment into
|
|
||||||
-- @tparam[opt] string name the name to use for the alignment
|
|
||||||
-- @tparam[opt='right'] string horizontal_align the horizontal alignment of the elements in this flow
|
|
||||||
-- @tparam[opt='center'] string vertical_align the vertical alignment of the elements in this flow
|
|
||||||
-- @treturn LuaGuiElement the new flow that was created
|
|
||||||
function Gui.create_alignment(element,name,horizontal_align,vertical_align)
|
|
||||||
local flow = element.add{name=name,type='flow'}
|
|
||||||
local style = flow.style
|
|
||||||
Gui.set_padding(flow,1,1,2,2)
|
|
||||||
style.horizontal_align = horizontal_align or 'right'
|
|
||||||
style.vertical_align = vertical_align or 'center'
|
|
||||||
style.horizontally_stretchable =style.horizontal_align ~= 'center'
|
|
||||||
style.vertically_stretchable = style.vertical_align ~= 'center'
|
|
||||||
return flow
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Destroies an element but tests for it being present and valid first
|
|
||||||
-- @tparam LuaGuiElement element the element to be destroied
|
|
||||||
-- @treturn boolean true if it was destoried
|
|
||||||
function Gui.destroy_if_valid(element)
|
|
||||||
if element and element.valid then
|
|
||||||
element.destroy()
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates a scroll area with a table inside, table can be any size
|
|
||||||
-- @tparam LuaGuiElement element the element to add this scroll into
|
|
||||||
-- @tparam number table_size the number of columns in the table
|
|
||||||
-- @tparam number maximal_height the max hieght of the scroll
|
|
||||||
-- @tparam[opt='scroll'] string name the name of the scoll element
|
|
||||||
-- @treturn LuaGuiElement the table that was made
|
|
||||||
function Gui.create_scroll_table(element,table_size,maximal_height,name)
|
|
||||||
local list_scroll =
|
|
||||||
element.add{
|
|
||||||
name=name or 'scroll',
|
|
||||||
type='scroll-pane',
|
|
||||||
direction='vertical',
|
|
||||||
horizontal_scroll_policy='never',
|
|
||||||
vertical_scroll_policy='auto-and-reserve-space'
|
|
||||||
}
|
|
||||||
Gui.set_padding(list_scroll,1,1,2,2)
|
|
||||||
list_scroll.style.horizontally_stretchable = true
|
|
||||||
list_scroll.style.maximal_height = maximal_height
|
|
||||||
|
|
||||||
local list_table =
|
|
||||||
list_scroll.add{
|
|
||||||
name='table',
|
|
||||||
type='table',
|
|
||||||
column_count=table_size
|
|
||||||
}
|
|
||||||
Gui.set_padding(list_table)
|
|
||||||
list_table.style.horizontally_stretchable = true
|
|
||||||
list_table.style.vertical_align = 'center'
|
|
||||||
list_table.style.cell_padding = 0
|
|
||||||
|
|
||||||
return list_table
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Creates a header section with a label and button area
|
|
||||||
-- @tparam LuaGuiElement element the element to add this header into
|
|
||||||
-- @tparam localeString caption the caption that is used as the title
|
|
||||||
-- @tparam[opt] localeString tooltip the tooltip that is shown on the caption
|
|
||||||
-- @tparam[opt] boolean right_align when true will include the right align area
|
|
||||||
-- @tparam[opt='header'] string name the name of the header area
|
|
||||||
-- @treturn LuaGuiElement the header that was made, or the align area if that was created
|
|
||||||
function Gui.create_header(element,caption,tooltip,right_align,name)
|
|
||||||
local header =
|
|
||||||
element.add{
|
|
||||||
name=name or 'header',
|
|
||||||
type='frame',
|
|
||||||
style='subheader_frame'
|
|
||||||
}
|
|
||||||
Gui.set_padding(header,2,2,4,4)
|
|
||||||
header.style.horizontally_stretchable = true
|
|
||||||
header.style.use_header_filler = false
|
|
||||||
|
|
||||||
header.add{
|
|
||||||
type='label',
|
|
||||||
style='heading_1_label',
|
|
||||||
caption=caption,
|
|
||||||
tooltip=tooltip
|
|
||||||
}
|
|
||||||
|
|
||||||
return right_align and Gui.create_alignment(header,'header-align') or header
|
|
||||||
end
|
|
||||||
|
|
||||||
return Gui
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
--[[-- Core Module - Gui
|
|
||||||
@module Gui
|
|
||||||
@alias Prototype
|
|
||||||
]]
|
|
||||||
|
|
||||||
--- Buttons.
|
|
||||||
-- Gui class define for buttons and sprite buttons
|
|
||||||
-- @section Buttons
|
|
||||||
|
|
||||||
--[[
|
|
||||||
>>>> Functions
|
|
||||||
Button.new_button(name) --- Creates a new button element define
|
|
||||||
|
|
||||||
Button._prototype:on_click(player,element) --- Registers a handler for when the button is clicked
|
|
||||||
Button._prototype:on_left_click(player,element) --- Registers a handler for when the button is clicked with the left mouse button
|
|
||||||
Button._prototype:on_right_click(player,element) --- Registers a handler for when the button is clicked with the right mouse button
|
|
||||||
|
|
||||||
Button._prototype:set_sprites(sprite,hovered_sprite,clicked_sprite) --- Adds sprites to a button making it a sprite button
|
|
||||||
Button._prototype:set_click_filter(filter,...) --- Adds a click / mouse button filter to the button
|
|
||||||
Button._prototype:set_key_filter(filter,...) --- Adds a control key filter to the button
|
|
||||||
|
|
||||||
Other functions present from expcore.gui.core
|
|
||||||
]]
|
|
||||||
local mod_gui = require 'mod-gui' --- @dep mod-gui
|
|
||||||
local Gui = require 'expcore.gui.core' --- @dep expcore.gui.core
|
|
||||||
local Prototype = require 'expcore.gui.prototype' --- @dep expcore.gui.prototype
|
|
||||||
|
|
||||||
local Button = {
|
|
||||||
_prototype=Prototype.extend{
|
|
||||||
on_raw_click = Prototype.event,
|
|
||||||
on_click = Prototype.event,
|
|
||||||
on_left_click = Prototype.event,
|
|
||||||
on_right_click = Prototype.event,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Creates a new button element define
|
|
||||||
-- @tparam[opt] string name the optional debug name that can be added
|
|
||||||
-- @treturn table the new button element define
|
|
||||||
function Button.new_button(name)
|
|
||||||
|
|
||||||
local self = Gui.new_define(Button._prototype,name)
|
|
||||||
self.draw_data.type = 'button'
|
|
||||||
self.draw_data.style = mod_gui.button_style
|
|
||||||
|
|
||||||
Gui.on_click(self.name,function(event)
|
|
||||||
local mouse_button = event.button
|
|
||||||
local keys = {alt=event.alt,control=event.control,shift=event.shift}
|
|
||||||
local player,element = event.player,event.element
|
|
||||||
event.keys = keys
|
|
||||||
|
|
||||||
self:raise_event('on_raw_click',event)
|
|
||||||
|
|
||||||
if self.post_authenticator then
|
|
||||||
if not self.post_authenticator(event.player,self.name) then return end
|
|
||||||
end
|
|
||||||
|
|
||||||
if mouse_button == defines.mouse_button_type.left then
|
|
||||||
self:raise_event('on_left_click',player,element)
|
|
||||||
elseif mouse_button == defines.mouse_button_type.right and self.events.on_right_click then
|
|
||||||
self:raise_event('on_right_click',player,element)
|
|
||||||
end
|
|
||||||
|
|
||||||
if self.mouse_button_filter and not self.mouse_button_filter[mouse_button] then return end
|
|
||||||
if self.key_button_filter then
|
|
||||||
for key,state in pairs(self.key_button_filter) do
|
|
||||||
if state and not keys[key] then return end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:raise_event('on_click',player,element)
|
|
||||||
end)
|
|
||||||
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Adds sprites to a button making it a sprite button
|
|
||||||
-- @tparam SpritePath sprite the sprite path for the default sprite for the button
|
|
||||||
-- @tparam[opt] SpritePath hovered_sprite the sprite path for the sprite when the player hovers over the button
|
|
||||||
-- @tparam[opt] SpritePath clicked_sprite the sprite path for the sprite when the player clicks the button
|
|
||||||
-- @treturn self returns the button define to allow chaining
|
|
||||||
function Button._prototype:set_sprites(sprite,hovered_sprite,clicked_sprite)
|
|
||||||
self.draw_data.type = 'sprite-button'
|
|
||||||
self.draw_data.sprite = sprite
|
|
||||||
self.draw_data.hovered_sprite = hovered_sprite
|
|
||||||
self.draw_data.clicked_sprite = clicked_sprite
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Adds a click / mouse button filter to the button
|
|
||||||
-- @tparam table filter ?string|table either a of mouse buttons or the first mouse button to filter, with a table true means allowed
|
|
||||||
-- @tparam[opt] table ... when filter is not a you can add the mouse buttons one after each other
|
|
||||||
-- @treturn self returns the button define to allow chaining
|
|
||||||
function Button._prototype:set_click_filter(filter,...)
|
|
||||||
if type(filter) == 'string' then
|
|
||||||
filter = {[filter]=true}
|
|
||||||
for _,v in pairs({...}) do
|
|
||||||
filter[v] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for k,v in pairs(filter) do
|
|
||||||
if type(v) == 'string' then
|
|
||||||
filter[k] = defines.mouse_button_type[v]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self.mouse_button_filter = filter
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Adds a control key filter to the button
|
|
||||||
-- @tparam table filter ?string|table either a of control keys or the first control keys to filter, with a table true means allowed
|
|
||||||
-- @tparam[opt] table ... when filter is not a you can add the control keys one after each other
|
|
||||||
-- @treturn self returns the button define to allow chaining
|
|
||||||
function Button._prototype:set_key_filter(filter,...)
|
|
||||||
if type(filter) == 'string' then
|
|
||||||
filter = {[filter]=true}
|
|
||||||
for _,v in pairs({...}) do
|
|
||||||
filter[v] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self.key_button_filter = filter
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
return Button
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user