Cleaner Code

This commit is contained in:
Cooldude2606
2019-09-22 17:08:43 +01:00
parent 1f204c6dac
commit ce88e0a296
114 changed files with 951 additions and 583 deletions

View File

@@ -349,7 +349,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -350,7 +350,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -377,7 +377,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -586,7 +586,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -350,7 +350,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -405,7 +405,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -461,7 +461,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -405,7 +405,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -321,7 +321,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -405,7 +405,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -377,7 +377,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -389,7 +389,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -501,7 +501,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -362,7 +362,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -389,7 +389,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -366,7 +366,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -361,7 +361,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -405,7 +405,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -459,7 +459,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -417,7 +417,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -612,7 +612,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -390,7 +390,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -361,7 +361,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -389,7 +389,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -322,7 +322,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -586,7 +586,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -558,7 +558,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -390,7 +390,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -444,7 +444,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -485,7 +485,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -570,7 +570,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -507,7 +507,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -238,7 +238,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -486,7 +486,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -295,7 +295,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -321,7 +321,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -443,7 +443,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -355,7 +355,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -339,7 +339,7 @@ see ./expcore/commands.lua for more details</p>
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -355,7 +355,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -417,7 +417,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -238,7 +238,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -241,7 +241,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -296,7 +296,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -813,7 +813,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -385,7 +385,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -415,7 +415,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -325,7 +325,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -415,7 +415,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -835,7 +835,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -293,7 +293,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -355,7 +355,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -389,7 +389,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -745,7 +745,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -385,7 +385,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -356,7 +356,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -685,7 +685,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1209,7 +1209,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1330,7 +1330,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1111,7 +1111,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -985,7 +985,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1040,7 +1040,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1466,7 +1466,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1414,7 +1414,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1973,7 +1973,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -2747,7 +2747,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>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -253,22 +253,24 @@
<h3>Usage</h3>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making the base button concept
</span><span class="keyword">local</span> button =
Gui.new_concept(<span class="string">'Button'</span>)
:new_event(<span class="string">'on_click'</span>,defines.events.on_gui_click)
:new_property(<span class="string">'tooltip'</span>)
:new_property(<span class="string">'caption'</span>,<span class="keyword">nil</span>,<span class="keyword">function</span>(properties,value)
properties.caption = value
Gui.new_concept() <span class="comment">-- Make a new empty concept
</span>:save_as(<span class="string">'button'</span>) <span class="comment">-- Save it as Gui.concepts.button so it can be used in other files
</span>:new_event(<span class="string">'on_click'</span>,defines.events.on_gui_click) <span class="comment">-- Add an on click event for this concept
</span>:new_property(<span class="string">'tooltip'</span>) <span class="comment">-- Add a property with the default setter method called tooltip
</span>:new_property(<span class="string">'caption'</span>,<span class="keyword">function</span>(properties,value) <span class="comment">-- Add a property with a custom setter method called caption
</span> properties.caption = value
properties.sprite = <span class="keyword">nil</span>
properties.<span class="global">type</span> = <span class="string">'button'</span>
<span class="keyword">end</span>)
:new_property(<span class="string">'sprite'</span>,<span class="keyword">nil</span>,<span class="keyword">function</span>(properties,value)
properties.image = value
:new_property(<span class="string">'sprite'</span>,<span class="keyword">function</span>(properties,value) <span class="comment">-- Add a property with a custom setter method called sprite
</span> properties.image = value
properties.caption = <span class="keyword">nil</span>
properties.<span class="global">type</span> = <span class="string">'sprite-button'</span>
<span class="keyword">end</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
<span class="comment">-- Note that element might be nil if this is the first draw function
</span> <span class="comment">-- in this case button is a new concept so we know this is the first function and element is nil
:define_draw(<span class="keyword">function</span>(properties,parent,element) <span class="comment">-- Add the draw function to create the element from the concept
</span> <span class="comment">-- Properties will include all the information that you need to draw the element
</span> <span class="comment">-- Parent is the parent element for the element, this may have been altered by previous draw functions
</span> <span class="comment">-- Element is the current element being made, this may have a nil value, if it is nil then this is the first draw function
</span> <span class="keyword">if</span> properties.<span class="global">type</span> == <span class="string">'button'</span> <span class="keyword">then</span>
element = parent.add{
<span class="global">type</span> = properties.<span class="global">type</span>,
@@ -287,25 +289,26 @@ Gui.new_concept(<span class="string">'Button'</span>)
<span class="keyword">end</span>
<span class="comment">-- We must return the element or what we want to be seen as the instance, this is so other draw functions have access to it
</span> <span class="comment">-- for example if our custom button defined a draw function to change the font color to red
</span> <span class="keyword">return</span> element
<span class="comment">-- If you return element or parent then their values will be updated for the next draw function in the chain
</span> <span class="comment">-- It is best practice to always return the values if you have made any changes to them
</span> <span class="keyword">return</span> element, parent
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Makeing a alternative button based on the first
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a new button which has a custom style
</span><span class="keyword">local</span> custom_button =
button:clone(<span class="string">'CustomButton'</span>)
:new_event(<span class="string">'on_admin_clicked'</span>,defines.events.on_gui_click,<span class="keyword">function</span>(event)
<span class="keyword">return</span> event.player.admin <span class="comment">-- only raise custom event when an admin clicks the button
</span><span class="keyword">end</span>)
:set_caption(<span class="string">'Custom Button'</span>)
:set_tooltip(<span class="string">'Only admins can press this button'</span>)
:on_click(<span class="keyword">function</span>(event)
<span class="keyword">if</span> <span class="keyword">not</span> event.player.admin <span class="keyword">then</span>
Gui.new_concept(<span class="string">'button'</span>) <span class="comment">-- We can use button here since we used save as on the concept
</span><span class="comment">-- button:clone() -- If we had not used save as then this is how we would use it as a base
</span>:set_caption(<span class="string">'Custom Button'</span>) <span class="comment">-- Set the caption of the concept, this is possible as we added caption as a property
</span>:set_tooltip(<span class="string">'Only admins can press this button'</span>) <span class="comment">-- Set the tooltip of the concept, this is possible as we added tooltip as a property
</span>:on_click(<span class="keyword">function</span>(event) <span class="comment">-- Register a handler to the click event we added with new event
</span> <span class="keyword">if</span> <span class="keyword">not</span> event.player.admin <span class="keyword">then</span>
event.player.<span class="global">print</span>(<span class="string">'You must be admin to use this button'</span>)
<span class="keyword">end</span>
<span class="keyword">end</span>)
:on_admin_clicked(<span class="keyword">function</span>(event)
<span class="comment">-- Yes i know this can just be an if else but its an example
:new_event(<span class="string">'on_admin_clicked'</span>,defines.events.on_gui_click,<span class="keyword">function</span>(event) <span class="comment">-- Add a click event which has a filter function
</span> <span class="keyword">return</span> event.player.admin <span class="comment">-- Check if the player is admin
</span><span class="keyword">end</span>)
:on_admin_clicked(<span class="keyword">function</span>(event) <span class="comment">-- Register a handler to the admin click event we have just created
</span> <span class="comment">-- The admin click event is only an example, because of how sinmple the filter is we could have just used an if else statement
</span> game.<span class="global">print</span>(event.player.name..<span class="string">' pressed my admin button'</span>)
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Drawing a concept
@@ -438,27 +441,27 @@ button:clone(<span class="string">'CustomButton'</span>)
</thead>
<tbody>
<tr>
<td class="name"><a href="#require_concept">require_concept(concept)</a></td>
<td class="summary">Loads a concept from the concepts file, used internally</td>
<td class="name"><a href="#require_concept">require_concept(concept_name)</a></td>
<td class="summary">Loads a concept from the concepts file</td>
</tr>
<tr>
<td class="name"><a href="#require_style">require_style(style_name)</a></td>
<td class="summary">Loads a set of concepts from the styles file</td>
</tr>
<tr>
<td class="name"><a href="#get_concept">get_concept(name)</a></td>
<td class="summary">Gets the gui concept with this name</td>
<td class="summary">Gets a gui concept from name, id, or its self</td>
</tr>
<tr>
<td class="name"><a href="#Prototype:change_name">Prototype:change_name([new_name=self.name])</a></td>
<td class="summary">Used internally to save concept names to the core gui module</td>
<td class="name"><a href="#Prototype:save_as">Prototype:save_as(save_name)</a></td>
<td class="summary">Used to save the concept to the main gui module to allow access from other files</td>
</tr>
<tr>
<td class="name"><a href="#new_concept">new_concept(name)</a></td>
<td class="summary">Returns a new gui concept with no properties or events</td>
<td class="name"><a href="#new_concept">new_concept([base_concept])</a></td>
<td class="summary">Returns a new gui concept, option to provide a base concept to copy properties and draw functions from</td>
</tr>
<tr>
<td class="name"><a href="#clone_concept">clone_concept(name, new_name)</a></td>
<td class="summary">Make a new concept based on the properties and drawing of another</td>
</tr>
<tr>
<td class="name"><a href="#draw_concept">draw_concept(name, parent)</a></td>
<td class="name"><a href="#draw_concept">draw_concept(concept, parent)</a></td>
<td class="summary">Used to draw a concept to a parent element</td>
</tr>
</tbody>
@@ -530,8 +533,12 @@ button:clone(<span class="string">'CustomButton'</span>)
<td class="summary">Use to add your own callbacks to the clone function, for example adding to a local table</td>
</tr>
<tr>
<td class="name"><a href="#Prototype:change_name">Prototype:change_name([new_name=self.name])</a></td>
<td class="summary">Used internally to save concept names to the core gui module</td>
<td class="name"><a href="#Prototype:save_as">Prototype:save_as(save_name)</a></td>
<td class="summary">Used to save the concept to the main gui module to allow access from other files</td>
</tr>
<tr>
<td class="name"><a href="#Prototype:debug">Prototype:debug(name)</a></td>
<td class="summary">Sets a debug name that can be used with error handlers</td>
</tr>
<tr>
<td class="name"><a href="#Prototype:new_event">Prototype:new_event(event_name[, factorio_event][, event_condition])</a></td>
@@ -546,7 +553,7 @@ button:clone(<span class="string">'CustomButton'</span>)
<td class="summary">Raises a custom event, folowing keys included automaticlly: concept, event name, game tick, player from player_index, element if valid</td>
</tr>
<tr>
<td class="name"><a href="#Prototype:new_property">Prototype:new_property(property_name, default[, setter_callback])</a></td>
<td class="name"><a href="#Prototype:new_property">Prototype:new_property(property_name[, setter_callback][, default])</a></td>
<td class="summary">Adds a new property to the concept, such as caption, tooltip, or some custom property you want to control</td>
</tr>
<tr>
@@ -777,7 +784,7 @@ button:clone(<span class="string">'CustomButton'</span>)
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic button
</span><span class="keyword">local</span> basic_button =
Gui.clone_concept(<span class="string">'button'</span>,<span class="string">'basic_button'</span>)
Gui.new_concept(<span class="string">'button'</span>)
:set_caption(<span class="string">'Basic Button'</span>)
:set_tooltip(<span class="string">'Basic button'</span>)
:on_click(<span class="keyword">function</span>(event)
@@ -785,7 +792,7 @@ Gui.clone_concept(<span class="string">'button'</span>,<span class="string">'bas
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a sprite button
</span><span class="keyword">local</span> sprite_button =
Gui.clone_concept(<span class="string">'button'</span>,<span class="string">'sprite_button'</span>)
Gui.new_concept(<span class="string">'button'</span>)
:set_sprite(<span class="string">'utility/warning_icon'</span>)
:set_tooltip(<span class="string">'Sprite button'</span>)
:on_click(<span class="keyword">function</span>(event)
@@ -907,7 +914,7 @@ Gui.clone_concept(<span class="string">'button'</span>,<span class="string">'spr
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic checkbox
</span><span class="keyword">local</span> basic_checkbox =
Gui.clone_concept(<span class="string">'checkbox'</span>,<span class="string">'basic_checkbox'</span>)
Gui.new_concept(<span class="string">'checkbox'</span>)
:set_caption(<span class="string">'Basic Checkbox'</span>)
:set_tooltip(<span class="string">'Basic checkbox'</span>)
:on_state_changed(<span class="keyword">function</span>(event)
@@ -1029,7 +1036,7 @@ Gui.clone_concept(<span class="string">'checkbox'</span>,<span class="string">'b
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic dropdown
</span><span class="keyword">local</span> static_dropdown =
Gui.clone_concept(<span class="string">'dropdown'</span>,<span class="string">'static_dropdown'</span>)
Gui.new_concept(<span class="string">'dropdown'</span>)
:set_static_items{<span class="string">'Option 1'</span>,<span class="string">'Option 2'</span>,<span class="string">'Option 3'</span>}
:on_selection_changed(<span class="keyword">function</span>(event)
<span class="keyword">local</span> value = Gui.get_dropdown_value(event.element)
@@ -1037,7 +1044,7 @@ Gui.clone_concept(<span class="string">'dropdown'</span>,<span class="string">'s
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a dropdown with dynamic items, example is name of online players
</span><span class="keyword">local</span> dynamic_dropdown =
Gui.clone_concept(<span class="string">'dropdown'</span>,<span class="string">'dynamic_dropdown'</span>)
Gui.new_concept(<span class="string">'dropdown'</span>)
:set_dynamic_items(<span class="keyword">function</span>(element)
<span class="keyword">local</span> items = {}
<span class="keyword">for</span> _,player <span class="keyword">in</span> <span class="global">pairs</span>(game.connected_players) <span class="keyword">do</span>
@@ -1133,7 +1140,7 @@ Gui.clone_concept(<span class="string">'dropdown'</span>,<span class="string">'d
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic elem button
</span><span class="keyword">local</span> basic_elem_button =
Gui.clone_concept(<span class="string">'elem_button'</span>,<span class="string">'basic_elembutton'</span>)
Gui.new_concept(<span class="string">'elem_button'</span>)
:on_selection_changed(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'Basic elem button is now: '</span>..event.element.elem_value)
<span class="keyword">end</span>)</code></pre>
@@ -1190,7 +1197,7 @@ Gui.clone_concept(<span class="string">'elem_button'</span>,<span class="string"
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a draggable space styled widget
</span><span class="keyword">local</span> draggable_space =
Gui.clone_concept(<span class="string">'empty'</span>,<span class="string">'draggable_space'</span>)
Gui.new_concept(<span class="string">'empty'</span>)
:set_style(<span class="string">'draggable_space'</span>)</code></pre>
<!-- usage end -->
@@ -1245,7 +1252,7 @@ Gui.clone_concept(<span class="string">'empty'</span>,<span class="string">'drag
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic flow, contains a label with hello world
</span><span class="keyword">local</span> basic_flow =
Gui.clone_concept(<span class="string">'flow'</span>,<span class="string">'basic_flow'</span>)
Gui.new_concept(<span class="string">'flow'</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
element.add{
<span class="global">type</span> = <span class="string">'label'</span>,
@@ -1321,7 +1328,7 @@ Gui.clone_concept(<span class="string">'flow'</span>,<span class="string">'basic
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic frame, contains a label with hello world
</span><span class="keyword">local</span> basic_frame =
Gui.clone_concept(<span class="string">'frame'</span>,<span class="string">'basic_frame'</span>)
Gui.new_concept(<span class="string">'frame'</span>)
:set_title(<span class="string">'Basic Frame'</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
element.add{
@@ -1383,6 +1390,22 @@ Gui.clone_concept(<span class="string">'frame'</span>,<span class="string">'basi
</li>
<li class="section-subitem-li">
<strong><em>rich_text</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.rich">defines.rich_text_setting</a></span>)
how this element handles rich text
</li>
</ul>
<!-- parameters end -->
@@ -1398,7 +1421,7 @@ Gui.clone_concept(<span class="string">'frame'</span>,<span class="string">'basi
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic label
</span><span class="keyword">local</span> basic_label =
Gui.clone_concept(<span class="string">'label'</span>,<span class="string">'basic_label'</span>)
Gui.new_concept(<span class="string">'label'</span>)
:set_caption(<span class="string">'Hello, World!'</span>)</code></pre>
<!-- usage end -->
@@ -1453,7 +1476,7 @@ Gui.clone_concept(<span class="string">'label'</span>,<span class="string">'basi
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic frame, contains a label with hello world
</span><span class="keyword">local</span> basic_line =
Gui.clone_concept(<span class="string">'line'</span>,<span class="string">'basic_line'</span>)</code></pre>
Gui.new_concept(<span class="string">'line'</span>)</code></pre>
<!-- usage end -->
</dd>
@@ -1570,7 +1593,7 @@ Gui.clone_concept(<span class="string">'line'</span>,<span class="string">'basic
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic progress bar, will increase when pressed then will reset when full
</span><span class="keyword">local</span> basic_progress_bar =
Gui.clone_concept(<span class="string">'progress_bar'</span>,<span class="string">'basic_progress_bar'</span>)
Gui.new_concept(<span class="string">'progress_bar'</span>)
:set_tooltip(<span class="string">'Basic progress bar'</span>)
:set_maximum(<span class="number">5</span>)
:new_event(<span class="string">'on_click'</span>,defines.events.on_gui_click)
@@ -1650,7 +1673,7 @@ Gui.clone_concept(<span class="string">'progress_bar'</span>,<span class="string
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic flow, contains a label with hello world
</span><span class="keyword">local</span> basic_scroll =
Gui.clone_concept(<span class="string">'scroll'</span>,<span class="string">'basic_scroll'</span>)
Gui.new_concept(<span class="string">'scroll'</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
element.style.hieght = <span class="number">50</span>
<span class="keyword">for</span> i = <span class="number">1</span>,<span class="number">10</span> <span class="keyword">do</span>
@@ -1776,14 +1799,14 @@ Gui.clone_concept(<span class="string">'scroll'</span>,<span class="string">'bas
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic slider
</span><span class="keyword">local</span> basic_slider =
Gui.clone_concept(<span class="string">'slider'</span>,<span class="string">'basic_slider'</span>)
Gui.new_concept(<span class="string">'slider'</span>)
:set_range(<span class="number">1</span>,<span class="number">10</span>)
:on_value_changed(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'Basic slider is now: '</span>..event.element.slider_value)
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a discrete_slider
</span><span class="keyword">local</span> discrete_slider =
Gui.clone_concept(<span class="string">'slider'</span>,<span class="string">'discrete_slider'</span>)
Gui.new_concept(<span class="string">'slider'</span>)
:set_range(<span class="number">1</span>,<span class="number">10</span>)
:set_value_step(<span class="number">1</span>)
:set_discrete_slider(<span class="keyword">true</span>)
@@ -1907,7 +1930,7 @@ Gui.clone_concept(<span class="string">'slider'</span>,<span class="string">'dis
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a basic table, contains 25 labels
</span><span class="keyword">local</span> basic_table =
Gui.clone_concept(<span class="string">'table'</span>,<span class="string">'basic_table'</span>)
Gui.new_concept(<span class="string">'table'</span>)
:set_column_count(<span class="number">5</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
<span class="keyword">for</span> i = <span class="number">1</span>,<span class="number">25</span> <span class="keyword">do</span>
@@ -1989,6 +2012,22 @@ Gui.clone_concept(<span class="string">'table'</span>,<span class="string">'basi
<li class="section-subitem-li">
<strong><em>rich_text</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.rich">defines.rich_text_setting</a></span>)
how this element handles rich text
</li>
<li class="section-subitem-li">
<strong><em>clear_on_rmb</em></strong>
@@ -2065,11 +2104,11 @@ Gui.clone_concept(<span class="string">'table'</span>,<span class="string">'basi
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a text box
</span><span class="keyword">local</span> basic_text_box =
Gui.clone_concept(<span class="string">'text_box'</span>,<span class="string">'basic_text_box'</span>)
Gui.new_concept(<span class="string">'text_box'</span>)
:set_default(<span class="string">'I am the text that will show in the text box'</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a text box which can be edited
</span><span class="keyword">local</span> editible_text_box =
Gui.clone_concept(<span class="string">'text_box'</span>,<span class="string">'editible_text_box'</span>)
Gui.new_concept(<span class="string">'text_box'</span>)
:set_is_read_only(<span class="keyword">false</span>)
:set_default(<span class="string">'I am the text that will show in the text box'</span>)
:on_confirmation(<span class="keyword">function</span>(event)
@@ -2162,6 +2201,22 @@ Gui.clone_concept(<span class="string">'text_box'</span>,<span class="string">'e
<li class="section-subitem-li">
<strong><em>rich_text</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.rich">defines.rich_text_setting</a></span>)
how this element handles rich text
</li>
<li class="section-subitem-li">
<strong><em>clear_on_rmb</em></strong>
@@ -2270,13 +2325,13 @@ Gui.clone_concept(<span class="string">'text_box'</span>,<span class="string">'e
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a text field
</span><span class="keyword">local</span> basic_text_field =
Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">'basic_text_field'</span>)
Gui.new_concept(<span class="string">'text_field'</span>)
:on_confirmation(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'Basic text field is now: '</span>..event.element.text)
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a text field which will clear on right click and un forcus on confirmation
</span><span class="keyword">local</span> better_text_field =
Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">'better_text_field'</span>)
Gui.new_concept(<span class="string">'text_field'</span>)
:set_clear_on_rmb(<span class="keyword">true</span>)
:set_lose_forcus(<span class="keyword">true</span>)
:on_confirmation(<span class="keyword">function</span>(event)
@@ -2284,7 +2339,7 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<span class="keyword">end</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a decimal input
</span><span class="keyword">local</span> decimal_text_field =
Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">'decimal_text_field'</span>)
Gui.new_concept(<span class="string">'text_field'</span>)
:set_is_decimal(<span class="keyword">true</span>)
:on_confirmation(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'Decimal text field is now: '</span>..event.element.text)
@@ -2910,13 +2965,13 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#require_concept" class="fragment-hashtag">#</a>
<span class="section-item-title" id="require_concept">require_concept(concept)</span>
<span class="section-item-title" id="require_concept">require_concept(concept_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Loads a concept from the concepts file, used internally</p>
<p class="section-item-summary">Loads a concept from the concepts file</p>
<p class="section-item-description"></p>
<!-- parameters start -->
@@ -2930,7 +2985,7 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<li class="section-subitem-li">
<strong><em>concept</em></strong>
<strong><em>concept_name</em></strong>
<strong> : </strong>
@@ -2955,7 +3010,60 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Load a base concept
</span>Gui.require_concept(<span class="string">'frame'</span>)</code></pre>
</span>Gui.require_concept(<span class="string">'frame'</span>) --- @dep Gui.concept.frame</code></pre>
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#require_style" class="fragment-hashtag">#</a>
<span class="section-item-title" id="require_style">require_style(style_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Loads a set of concepts from the styles file</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>style_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the style to require
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Load a base style
</span>Gui.require_concept(<span class="string">'expgaming'</span>) --- @dep Gui.style.frame</code></pre>
<!-- usage end -->
</dd>
@@ -2969,7 +3077,7 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<dd>
<div class="section-item-body">
<p class="section-item-summary">Gets the gui concept with this name</p>
<p class="section-item-summary">Gets a gui concept from name, id, or its self</p>
<p class="section-item-description"></p>
<!-- parameters start -->
@@ -2987,9 +3095,9 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a>, <a class="type" href="https://www.lua.org/pil/2.3.html">number</a> or <a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
the name of the concept that you want to get
the name, id, or the concept you want to get
</li>
@@ -3015,14 +3123,14 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#Prototype:change_name" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:change_name">Prototype:change_name([new_name=self.name])</span>
<a href="#Prototype:save_as" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:save_as">Prototype:save_as(save_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Used internally to save concept names to the core gui module</p>
<p class="section-item-summary">Used to save the concept to the main gui module to allow access from other files</p>
<p class="section-item-description"></p>
<!-- parameters start -->
@@ -3036,7 +3144,7 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<li class="section-subitem-li">
<strong><em>new_name</em></strong>
<strong><em>save_name</em></strong>
<strong> : </strong>
@@ -3044,7 +3152,6 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
the new name of the concept
(<em>default</em>: self.name)
</li>
@@ -3061,10 +3168,11 @@ Gui.clone_concept(<span class="string">'text_field'</span>,<span class="string">
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Internal Saving
</span><span class="comment">-- this is never needed to be done, internal use only!
</span><span class="keyword">local</span> button = Gui.get_concept(<span class="string">'Button'</span>)
button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Save a concept to allow access in another file
</span>button:save_as(<span class="string">'button'</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Access concept after being saved
</span>Gui.concepts.button
Gui.get_concept(<span class="string">'button'</span>)</code></pre>
<!-- usage end -->
</dd>
@@ -3072,13 +3180,13 @@ button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#new_concept" class="fragment-hashtag">#</a>
<span class="section-item-title" id="new_concept">new_concept(name)</span>
<span class="section-item-title" id="new_concept">new_concept([base_concept])</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns a new gui concept with no properties or events</p>
<p class="section-item-summary">Returns a new gui concept, option to provide a base concept to copy properties and draw functions from</p>
<p class="section-item-description"></p>
<!-- parameters start -->
@@ -3092,14 +3200,15 @@ button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<li class="section-subitem-li">
<strong><em>name</em></strong>
<strong><em>base_concept</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a>, <a class="type" href="https://www.lua.org/pil/2.3.html">number</a> or <a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
the name that you want this concept to have
the concept that you want to copy the details of
(<em>optional</em>)
</li>
@@ -3116,85 +3225,16 @@ button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a new concept, see module usage
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a new button, see module usage
</span><span class="keyword">local</span> button = Gui.new_concept(<span class="string">'Button'</span>)</code></pre>
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#clone_concept" class="fragment-hashtag">#</a>
<span class="section-item-title" id="clone_concept">clone_concept(name, new_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Make a new concept based on the properties and drawing of another</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the concept that you want as the base
</li>
<li class="section-subitem-li">
<strong><em>new_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name that you want the new concept to have
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Making a new concept from another, see module usage
</span><span class="keyword">local</span> custom_button = Gui.clone_concept(<span class="string">'Button'</span>,<span class="string">'CustomButton'</span>)</code></pre>
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#draw_concept" class="fragment-hashtag">#</a>
<span class="section-item-title" id="draw_concept">draw_concept(name, parent)</span>
<span class="section-item-title" id="draw_concept">draw_concept(concept, parent)</span>
</div>
</dt>
<dd>
@@ -3214,11 +3254,11 @@ button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<li class="section-subitem-li">
<strong><em>name</em></strong>
<strong><em>concept</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a>, <a class="type" href="https://www.lua.org/pil/2.3.html">number</a> or <a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
the name of the concept that you want to draw
@@ -3940,7 +3980,7 @@ button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Clones the base Button concept to make a alternative button
</span><span class="keyword">local</span> custom_button =
Gui.get_concept(<span class="string">'Button'</span>):clone(<span class="string">'CustomButton'</span>)</code></pre>
Gui.get_concept(Gui.concepts.button):clone()</code></pre>
<!-- usage end -->
</dd>
@@ -4012,14 +4052,14 @@ Gui.get_concept(<span class="string">'Button'</span>)
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#Prototype:change_name" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:change_name">Prototype:change_name([new_name=self.name])</span>
<a href="#Prototype:save_as" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:save_as">Prototype:save_as(save_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Used internally to save concept names to the core gui module</p>
<p class="section-item-summary">Used to save the concept to the main gui module to allow access from other files</p>
<p class="section-item-description"></p>
<!-- parameters start -->
@@ -4033,7 +4073,7 @@ Gui.get_concept(<span class="string">'Button'</span>)
<li class="section-subitem-li">
<strong><em>new_name</em></strong>
<strong><em>save_name</em></strong>
<strong> : </strong>
@@ -4041,7 +4081,6 @@ Gui.get_concept(<span class="string">'Button'</span>)
the new name of the concept
(<em>default</em>: self.name)
</li>
@@ -4058,10 +4097,71 @@ Gui.get_concept(<span class="string">'Button'</span>)
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Internal Saving
</span><span class="comment">-- this is never needed to be done, internal use only!
</span><span class="keyword">local</span> button = Gui.get_concept(<span class="string">'Button'</span>)
button:change_name(<span class="string">'Not Button'</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Save a concept to allow access in another file
</span>button:save_as(<span class="string">'button'</span>)</code></pre>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Access concept after being saved
</span>Gui.concepts.button
Gui.get_concept(<span class="string">'button'</span>)</code></pre>
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#Prototype:debug" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:debug">Prototype:debug(name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Sets a debug name that can be used with error handlers</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name that will be used in error messages
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><span class="type">self</span></span>)
<span class="return-text">to allow chaining</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Set the debug name
</span>unsaved_concept:<span class="global">debug</span>(<span class="string">'Example button'</span>)</code></pre>
<!-- usage end -->
</dd>
@@ -4325,7 +4425,7 @@ Gui.get_concept(<span class="string">'CustomButton'</span>)
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#Prototype:new_property" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Prototype:new_property">Prototype:new_property(property_name, default[, setter_callback])</span>
<span class="section-item-title" id="Prototype:new_property">Prototype:new_property(property_name[, setter_callback][, default])</span>
</div>
</dt>
<dd>
@@ -4361,14 +4461,15 @@ Gui.get_concept(<span class="string">'CustomButton'</span>)
<li class="section-subitem-li">
<strong><em>default</em></strong>
<strong><em>setter_callback</em></strong>
<strong> : </strong>
(<span class="types"><span class="type">any</span></span>)
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
the default value for this property, although not strictly required is is strongly recomented
this function is called when set is called, if not provided then key in concept.properties is updated to new value
(<em>optional</em>)
</li>
@@ -4377,13 +4478,13 @@ Gui.get_concept(<span class="string">'CustomButton'</span>)
<li class="section-subitem-li">
<strong><em>setter_callback</em></strong>
<strong><em>default</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.6.html">function</a></span>)
(<span class="types"><span class="type">any</span></span>)
this function is called when set is called, if not provided then key in concept.properties is updated to new value
use this as the default value, will call the setter callback if defined
(<em>optional</em>)
</li>
@@ -4552,12 +4653,12 @@ Gui.get_concept(<span class="string">'CustomButton'</span>)
</span><span class="keyword">local</span> button =
Gui.get_concept(<span class="string">'Button'</span>)
:define_draw(<span class="keyword">function</span>(properties,parent,element)
<span class="comment">-- Note that element might be nil if this is the first draw function
</span> <span class="comment">-- for this example we assume button was cloned from Prototype and so has no other draw functions defined
</span> <span class="comment">-- this means that there is no element yet and what we return will be the first time the element is returned
</span> <span class="comment">-- although not shown here you also can recive any extra arguments here from the call to draw
<span class="comment">-- Properties will include all the information that you need to draw the element
</span> <span class="comment">-- Parent is the parent element for the element, this may have been altered by previous draw functions
</span> <span class="comment">-- Element is the current element being made, this may have a nil value, if it is nil then this is the first draw function
</span> <span class="comment">-- You can also pass any other arguments that you want to this function from the draw call
</span> <span class="keyword">if</span> properties.<span class="global">type</span> == <span class="string">'button'</span> <span class="keyword">then</span>
element = parent.draw{
element = parent.add{
<span class="global">type</span> = properties.<span class="global">type</span>,
name = properties.name,
caption = properties.caption,
@@ -4565,7 +4666,7 @@ Gui.get_concept(<span class="string">'Button'</span>)
}
<span class="keyword">else</span>
element = parent.draw{
element = parent.add{
<span class="global">type</span> = properties.<span class="global">type</span>,
name = properties.name,
sprite = properties.sprite,
@@ -4574,9 +4675,9 @@ Gui.get_concept(<span class="string">'Button'</span>)
<span class="keyword">end</span>
<span class="comment">-- We must return the element or what we want to be seen as the instance, this is so other draw functions have access to it
</span> <span class="comment">-- for example if our custom button defined a draw function to change the font color to red
</span> <span class="keyword">return</span> element
<span class="comment">-- If you return element or parent then their values will be updated for the next draw function in the chain
</span> <span class="comment">-- It is best practice to always return the values if you have made any changes to them
</span> <span class="keyword">return</span> element, parent
<span class="keyword">end</span>)</code></pre>
<!-- usage end -->
@@ -5510,7 +5611,7 @@ Gui.get_concept(<span class="string">'CustomButton'</span>)
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1433,7 +1433,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -3153,7 +3153,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1146,7 +1146,7 @@ Store.register(team_scores,<span class="keyword">function</span>(value,key)
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -545,7 +545,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -264,6 +264,9 @@
<tr>
<td class="name"><a href="#mod-gui">mod-gui</a></td>
</tr>
<tr>
<td class="name"><a href="#Gui.concept.button">Gui.concept.button</a></td>
</tr>
</tbody>
</table>
<table class="section-content-list">
@@ -495,6 +498,31 @@
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#Gui.concept.button" class="fragment-hashtag">#</a>
<span class="section-item-title" id="Gui.concept.button">Gui.concept.button</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<!-- parameters start -->
<!-- parameters end -->
<!-- returns start -->
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
@@ -703,7 +731,7 @@
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a basic button to the toolbar
</span><span class="keyword">local</span> new_button =
Gui.clone_concept(<span class="string">'button'</span>,<span class="string">'new-button'</span>)
Gui.new_concept(<span class="string">'button'</span>)
:set_caption(<span class="string">'Click Me'</span>)
:on_click(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'You Clicked Me!!'</span>)
@@ -875,7 +903,7 @@ Toolbar.add_button_concept(new_button)</code></pre>
<!-- usage start -->
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a basic button to the toolbar, note no need to call Toolbar.add_button_concept
</span>Gui.clone_concept(<span class="string">'toolbar-button'</span>,<span class="string">'new-button'</span>)
</span>Gui.new_concept(<span class="string">'toolbar-button'</span>)
:set_caption(<span class="string">'Click Me'</span>)
:on_click(<span class="keyword">function</span>(event)
event.player.<span class="global">print</span>(<span class="string">'You Clicked Me!!'</span>)
@@ -936,7 +964,7 @@ Toolbar.add_button_concept(new_button)</code></pre>
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a basic frame to the frame area
</span><span class="keyword">local</span> new_frame =
Gui.clone_concept(<span class="string">'frame'</span>,<span class="string">'new_frame'</span>)
Gui.new_concept(<span class="string">'frame'</span>)
:set_title(<span class="string">'Test'</span>)
Toolbar.add_frame_concept(new_frame)</code></pre>
@@ -1153,7 +1181,7 @@ Toolbar.add_frame_concept(new_frame)</code></pre>
<strong>Usage:</strong>
<pre class="code" data-lang="Lua"><code><span class="comment">-- Adding a basic player list
</span><span class="keyword">local</span> player_list =
Gui.clone_concept(<span class="string">'toolbar-frame'</span>,<span class="string">'player_list'</span>)
Gui.new_concept(<span class="string">'toolbar-frame'</span>)
:set_permission_alias(<span class="string">'player_list'</span>)
:set_caption(<span class="string">'Player List'</span>)
:toggle_with_click()
@@ -1630,7 +1658,7 @@ Gui.clone_concept(<span class="string">'toolbar-frame'</span>,<span class="strin
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -627,7 +627,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -630,7 +630,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -450,7 +450,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -633,7 +633,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -838,7 +838,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -514,7 +514,7 @@ see ./expcore/commands.lua for more details</span></td>
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -352,7 +352,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -420,7 +420,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>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1165,7 +1165,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -655,7 +655,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -324,7 +324,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1293,7 +1293,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -435,7 +435,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -354,7 +354,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -442,7 +442,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -753,7 +753,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -1419,7 +1419,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -652,7 +652,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -443,7 +443,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -790,7 +790,7 @@ Public License instead of this License. But first, please read
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -240,7 +240,7 @@
<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>## 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]. 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`
* New features are merged into `dev` after it has been completed.
* 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.
@@ -297,7 +297,8 @@
[f0.14]: https://wiki.factorio.com/Version_history/0.14.0
<p>## License
<p>The Explosive Gaming codebase is licensed under the [GNU General Public License v3.0](LICENSE)
<p>[issues]: https://github.com/explosivegaming/scenario/issues/new/choose
<p>[docs]: https://explosivegaming.github.io/scenario/
[issues]: https://github.com/explosivegaming/scenario/issues/new/choose
[website]: https://explosivegaming.nl
[discord]: https://discord.explosivegaming.nl
[wiki]: https://wiki.explosivegaming.nl
@@ -333,7 +334,7 @@
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-09-17 21:04:13 UTC</i>
<i>Last updated 2019-09-22 17:08:34 UTC</i>
</div>
</div>
</div>

View File

@@ -640,7 +640,7 @@ function Common.array_insert(tbl,start_index,values)
local starting_length = #tbl
local adding_length = #values
local move_to = start_index+adding_length+1
for offset = 0, starting_length-start_index do
for offset = starting_length-start_index, 0, -1 do
tbl[move_to+offset] = tbl[starting_length+offset]
end
start_index = start_index-1

View File

@@ -4,22 +4,24 @@
@usage-- Making the base button concept
local button =
Gui.new_concept('Button')
:new_event('on_click',defines.events.on_gui_click)
:new_property('tooltip')
:new_property('caption',nil,function(properties,value)
Gui.new_concept() -- Make a new empty concept
:save_as('button') -- Save it as Gui.concepts.button so it can be used in other files
:new_event('on_click',defines.events.on_gui_click) -- Add an on click event for this concept
:new_property('tooltip') -- Add a property with the default setter method called tooltip
:new_property('caption',function(properties,value) -- Add a property with a custom setter method called caption
properties.caption = value
properties.sprite = nil
properties.type = 'button'
end)
:new_property('sprite',nil,function(properties,value)
:new_property('sprite',function(properties,value) -- Add a property with a custom setter method called sprite
properties.image = value
properties.caption = nil
properties.type = 'sprite-button'
end)
:define_draw(function(properties,parent,element)
-- Note that element might be nil if this is the first draw function
-- in this case button is a new concept so we know this is the first function and element is nil
:define_draw(function(properties,parent,element) -- Add the draw function to create the element from the concept
-- Properties will include all the information that you need to draw the element
-- Parent is the parent element for the element, this may have been altered by previous draw functions
-- Element is the current element being made, this may have a nil value, if it is nil then this is the first draw function
if properties.type == 'button' then
element = parent.add{
type = properties.type,
@@ -38,26 +40,27 @@ end)
end
-- We must return the element or what we want to be seen as the instance, this is so other draw functions have access to it
-- for example if our custom button defined a draw function to change the font color to red
return element
-- If you return element or parent then their values will be updated for the next draw function in the chain
-- It is best practice to always return the values if you have made any changes to them
return element, parent
end)
@usage-- Makeing a alternative button based on the first
@usage-- Making a new button which has a custom style
local custom_button =
button:clone('CustomButton')
:new_event('on_admin_clicked',defines.events.on_gui_click,function(event)
return event.player.admin -- only raise custom event when an admin clicks the button
end)
:set_caption('Custom Button')
:set_tooltip('Only admins can press this button')
:on_click(function(event)
Gui.new_concept('button') -- We can use button here since we used save as on the concept
-- button:clone() -- If we had not used save as then this is how we would use it as a base
:set_caption('Custom Button') -- Set the caption of the concept, this is possible as we added caption as a property
:set_tooltip('Only admins can press this button') -- Set the tooltip of the concept, this is possible as we added tooltip as a property
:on_click(function(event) -- Register a handler to the click event we added with new event
if not event.player.admin then
event.player.print('You must be admin to use this button')
end
end)
:on_admin_clicked(function(event)
-- Yes i know this can just be an if else but its an example
:new_event('on_admin_clicked',defines.events.on_gui_click,function(event) -- Add a click event which has a filter function
return event.player.admin -- Check if the player is admin
end)
:on_admin_clicked(function(event) -- Register a handler to the admin click event we have just created
-- The admin click event is only an example, because of how sinmple the filter is we could have just used an if else statement
game.print(event.player.name..' pressed my admin button')
end)
@@ -65,23 +68,4 @@ end)
custom_button:draw(game.player.gui.left)
]]
local Gui = require 'expcore.gui.core'
Gui.require_concept('frame')
Gui.require_concept('flow')
Gui.require_concept('table')
Gui.require_concept('label')
Gui.require_concept('line')
Gui.require_concept('scroll')
Gui.require_concept('empty')
Gui.require_concept('button')
Gui.require_concept('checkbox')
Gui.require_concept('dropdown')
Gui.require_concept('elem_button')
Gui.require_concept('progress_bar')
Gui.require_concept('slider')
Gui.require_concept('textfield')
Gui.require_concept('textbox')
return Gui
return require 'expcore.gui.core'

View File

@@ -7,30 +7,39 @@ local Gui = require 'expcore.gui.core'
--[[-- Clickable elements that fire on_gui_click when clicked.
@element button
@param on_click fired when the player clicks the button
@param on_left_click fired when the player clicks with the left mouse button
@param on_left_click fired when the player clicks with the right mouse button
@tparam ?string|Concepts.LocalisedString caption the message that is shown on the button
@tparam ?string|Concepts.LocalisedString tooltip the tooltip that shows when a player hovers over the button
@tparam SpritePath sprite upto three sprites in the order: default, hovered, clicked
@usage-- Making a basic button
local basic_button =
Gui.clone_concept('button','basic_button')
Gui.new_concept('button')
:set_caption('Basic Button')
:set_tooltip('Basic button')
:on_click(function(event)
event.player.print('You pressed basic button!')
end)
@usage-- Making a sprite button
local sprite_button =
Gui.clone_concept('button','sprite_button')
Gui.new_concept('button')
:set_sprite('utility/warning_icon')
:set_tooltip('Sprite button')
:on_click(function(event)
event.player.print('You pressed sprite button!')
end)
]]
Gui.new_concept('button')
Gui.new_concept()
:save_as('button')
-- Events
:new_event('on_click',defines.events.on_gui_click)
:new_event('on_left_click',defines.events.on_gui_click,function(event)
return event.mouse_button == defines.mouse_button_type.left
@@ -38,19 +47,25 @@ end)
:new_event('on_right_click',defines.events.on_gui_click,function(event)
return event.mouse_button == defines.mouse_button_type.right
end)
-- Properties
:new_property('tooltip')
:new_property('caption',nil,function(properties,value)
:new_property('caption',function(properties,value)
properties.caption = value
properties.type = 'button'
end)
:new_property('sprite',nil,function(properties,value,hovered_sprite,clicked_sprite)
:new_property('sprite',function(properties,value,hovered_sprite,clicked_sprite)
properties.sprite = value
properties.hovered_sprite = hovered_sprite
properties.clicked_sprite = clicked_sprite
properties.type = 'sprite-button'
end)
-- Draw
:define_draw(function(properties,parent,element)
-- Check if it should be a sprite button
if properties.type == 'sprite-button' then
-- Draw a sprite button
element = parent.add{
name = properties.name,
type = 'sprite-button',
@@ -61,6 +76,7 @@ end)
}
else
-- Draw a button
element = parent.add{
name = properties.name,
type = 'button',

View File

@@ -7,30 +7,43 @@ local Gui = require 'expcore.gui.core'
--[[-- Clickable elements with a cross in the middle that can be turned off or on.
@element checkbox
@param on_state_changed fired when the state of the element is changed
@tparam ?string|Concepts.LocalisedString caption the message that is shown next to the checkbox
@tparam ?string|Concepts.LocalisedString tooltip the tooltip that shows when a player hovers over the checkbox
@tparam ?boolean|function default the default state of this checkbox, or a function which returns the default state
@tparam boolean use_radio setting to true will use radio buttons rather than checkboxs
@usage-- Making a basic checkbox
local basic_checkbox =
Gui.clone_concept('checkbox','basic_checkbox')
Gui.new_concept('checkbox')
:set_caption('Basic Checkbox')
:set_tooltip('Basic checkbox')
:on_state_changed(function(event)
event.player.print('Basic checkbox is now: '..tostring(event.element.state))
end)
]]
Gui.new_concept('checkbox')
Gui.new_concept()
:save_as('checkbox')
-- Events
:new_event('on_state_changed',defines.events.on_gui_checked_state_changed)
-- Properties
:new_property('tooltip')
:new_property('caption')
:new_property('default',false)
:new_property('use_radio',false)
:new_property('default',nil,false)
:new_property('use_radio',nil,false)
-- Draw
:define_draw(function(properties,parent,element)
local default = properties.default
local state = type(default) == 'boolean' and default
-- Draw a checkbox
element = parent.add{
name = properties.name,
type = properties.use_radio and 'radiobutton' or 'checkbox',
@@ -39,6 +52,7 @@ Gui.new_concept('checkbox')
state = state
}
-- Set the default state
default = Gui.resolve_property(default,element)
if default and default ~= state then
element.state = default

View File

@@ -8,22 +8,26 @@ local array_insert = ext_require('expcore.common','array_insert')
--[[-- A drop down list of other elements.
@element dropdown
@param on_selection_changed fired when the selected value is changed
@tparam ?string|Concepts.LocalisedString|function default the option which is selected by default, or a function which returns the default
@tparam boolean use_list_box when true a list box will be used rather than a dropdown menu
@tparam ?nil|table static_items when called with a table the values will be added as items for the dropdown, if called with nil then all items are cleared
@tparam function dynamic_items the given function will be called to return a list of items and optional start index to add items to the dropdown when it is first drawn
@usage-- Making a basic dropdown
@usage-- Making a basic dropdown
local static_dropdown =
Gui.clone_concept('dropdown','static_dropdown')
Gui.new_concept('dropdown')
:set_static_items{'Option 1','Option 2','Option 3'}
:on_selection_changed(function(event)
local value = Gui.get_dropdown_value(event.element)
event.player.print('Static dropdown is now: '..value)
end)
@usage-- Making a dropdown with dynamic items, example is name of online players
local dynamic_dropdown =
Gui.clone_concept('dropdown','dynamic_dropdown')
Gui.new_concept('dropdown')
:set_dynamic_items(function(element)
local items = {}
for _,player in pairs(game.connected_players) do
@@ -35,51 +39,66 @@ end)
local value = Gui.get_dropdown_value(event.element)
event.player.print('Dynamic dropdown is now: '..value)
end)
]]
Gui.new_concept('dropdown')
Gui.new_concept()
:save_as('dropdown')
-- Events
:new_event('on_selection_changed',defines.events.on_gui_selection_state_changed)
-- Properties
:new_property('default')
:new_property('use_list_box',false)
:new_property('static_items',nil,function(properties,value,start_index)
:new_property('use_list_box',nil,false)
:new_property('static_items',function(properties,value,start_index)
-- Clear all items if value is nil
if not value then
properties.items = {}
end
-- Convert value to a table
if type(value) ~= 'table' then
value = {value}
end
-- If there are no items then set and return
local items = properties.items
if not items then
properties.items = value
return
end
-- Otherwise insert into the array
array_insert(items,start_index,value)
end)
:new_property('dynamic_items',nil,function(properties,value)
:new_property('dynamic_items',function(properties,value)
-- Check that a function value was given
if type(value) ~= 'function' then
error('Dynamic items must be a function')
end
-- If no dynamic items then set and return
local items = properties.dynamic_items
if not items then
properties.dynamic_items = {value}
return
end
-- Otherwise append to the end
items[#items+1] = value
end)
:define_draw(function(properties,parent,element,new_items)
local items = new_items or {}
array_insert(items,1,properties.items or {})
-- Draw
:define_draw(function(properties,parent,element)
-- Draw a dropdown
element = parent.add{
name = properties.name,
type = properties.use_list_box and 'list-box' or 'drop-down',
items = items
items = properties.items
}
-- If there are dynamic items then add them
if properties.dynamic_items then
for _,callback in pairs(properties.dynamic_items) do
local dynamic_items, start_index = callback(element)
@@ -87,6 +106,7 @@ end)
end
end
-- If there is a default, select it
local default = Gui.resolve_property(properties.default,element)
if default then
Gui.set_dropdown_value(element,default)

View File

@@ -7,27 +7,41 @@ local Gui = require 'expcore.gui.core'
--[[-- A button that lets the player pick one of an: item, entity, tile, or signal similar to the filter-select window.
@element elem_button
@param on_selection_changed fired when the selected value is changed
@tparam ?string|Concepts.SignalID|function default the option which is selected by default, or a function which returns the default
@tparam string elem_type the type of elem selection that this is, default is item selection
@usage-- Making a basic elem button
local basic_elem_button =
Gui.clone_concept('elem_button','basic_elembutton')
Gui.new_concept('elem_button')
:on_selection_changed(function(event)
event.player.print('Basic elem button is now: '..event.element.elem_value)
end)
]]
Gui.new_concept('elem_button')
Gui.new_concept()
:save_as('elem_button')
-- Events
:new_event('on_selection_changed',defines.events.on_gui_elem_changed)
-- Properties
:new_property('default')
:new_property('elem_type','item')
:new_property('elem_type',nil,'item')
-- Draw
:define_draw(function(properties,parent,element)
-- Draw a chose elem button
element = parent.add{
name = properties.name,
type = 'choose-elem-button',
elem_type = properties.elem_type
}
-- If there is a default, select it
local default = Gui.resolve_property(properties.default,element)
if default then
element.elem_value = default

View File

@@ -7,15 +7,25 @@ local Gui = require 'expcore.gui.core'
--[[-- A empty widget that just exists. The root GUI element screen is an empty-widget.
@element empty
@tparam string style the style that the element will have
@usage-- Making a draggable space styled widget
local draggable_space =
Gui.clone_concept('empty','draggable_space')
:set_style('draggable_space')
]]
Gui.new_concept('empty')
:set_style('draggable_space')
]]
Gui.new_concept()
:save_as('empty')
-- Properties
:new_property('style')
-- Draw
:define_draw(function(properties,parent,element)
-- Draw an empty widget
element = parent.add{
name = properties.name,
type = 'empty-widget',

Some files were not shown because too many files have changed in this diff Show More