diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml deleted file mode 100644 index d1773da3..00000000 --- a/.github/workflows/dev-deploy.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Dev Deploy - -on: - push: - branches: - - dev - paths-ignore: - - 'docs/**' - - '.luacheckrc' - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Install Lua - uses: leafo/gh-actions-lua@v8.0.0 - - - name: Install LuaRocks - uses: leafo/gh-actions-luarocks@v4 - - - name: Install LDoc - run: luarocks install ldoc 1.4.4-1 - - - name: Generate Documents - working-directory: docs - run: ldoc -i . - - - name: Commit changes - uses: EndBug/add-and-commit@v4 - with: - message: "Automatic Doc Update" - add: "./docs/** .luacheckrc" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 00000000..61769368 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,64 @@ +name: Docs Deploy + +on: + # Deploy when there is a push to dev + push: + branches: + - dev + + # Allow runing this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install Lua + uses: leafo/gh-actions-lua@v8.0.0 + + - name: Install LuaRocks + uses: leafo/gh-actions-luarocks@v4 + + - name: Install LDoc + run: luarocks install ldoc 1.4.4-1 + + - name: Create Docs Folder + run: mkdir -p docs + + - name: Generate Documents + working-directory: docs + run: ldoc -i . + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/addons/Advanced-Start.html b/docs/addons/Advanced-Start.html deleted file mode 100644 index da405ff5..00000000 --- a/docs/addons/Advanced-Start.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Advanced-Start addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Advanced-Start addon

-

Adds a better method of player starting items based on production levels.

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
config.advanced_start
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.advanced_start -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Chat-Popups.html b/docs/addons/Chat-Popups.html deleted file mode 100644 index 5f06a92c..00000000 --- a/docs/addons/Chat-Popups.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - Chat-Popups addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Chat-Popups addon

-

Creates flying text entities when a player sends a message in chat; - also displays a ping above users who are named in the message

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
config.popup_messages
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.popup_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Chat-Reply.html b/docs/addons/Chat-Reply.html deleted file mode 100644 index 9f14d2c9..00000000 --- a/docs/addons/Chat-Reply.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - Chat-Reply addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Chat-Reply addon

-

Adds auto replies to chat messages; as well as chat commands

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
expcore.roles
config.chat_reply
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.chat_reply -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Compilatron.html b/docs/addons/Compilatron.html deleted file mode 100644 index b5d19feb..00000000 --- a/docs/addons/Compilatron.html +++ /dev/null @@ -1,597 +0,0 @@ - - - - - - - - Compilatron addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Compilatron addon

-

Adds a compilatron that walks around the spawn area; adapted from redmew code

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.event
utils.global
utils.task
utils.token
config.compilatron
- - -

Functions

- - - - - - - - - - - - -
Public.add_compilatron(entity, name)This will add a compilatron to the global and start his message cycle
Public.spawn_compilatron(surface, location)This spawns a new compilatron on a surface with the given location tag (not a position)
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.task -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.token -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.compilatron -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Public.add_compilatron(entity, name) -
-
-
-
- -

This will add a compilatron to the global and start his message cycle

-

- - - Parameters: - -
    - - - - - -
  • - - entity - - : - - (LuaEntity) - - the compilatron entity that moves around - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the location that the compilatron is at - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Public.spawn_compilatron(surface, location) -
-
-
-
- -

This spawns a new compilatron on a surface with the given location tag (not a position)

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface to spawn the compilatron on - -
  • - - - - - -
  • - - location - - : - - (string) - - the location tag that is in the config file - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Damage-Popups.html b/docs/addons/Damage-Popups.html deleted file mode 100644 index 4f53aef6..00000000 --- a/docs/addons/Damage-Popups.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - Damage-Popups addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Damage-Popups addon

-

Displays the amount of dmg that is done by players to entities; - also shows player health when a player is attacked

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
config.popup_messages
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.popup_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Death-Logger.html b/docs/addons/Death-Logger.html deleted file mode 100644 index ff3778be..00000000 --- a/docs/addons/Death-Logger.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - Death-Logger addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Death-Logger addon

-

Makes markers on the map where places have died and reclaims items if not recovered

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
utils.global
config.death_logger
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.death_logger -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Deconlog.html b/docs/addons/Deconlog.html deleted file mode 100644 index 43b902ee..00000000 --- a/docs/addons/Deconlog.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - Deconlog addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Deconlog addon

-

Log certain actions into a file when events are triggered

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
expcore.roles
config.deconlog
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.deconlog -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Discord-Alerts.html b/docs/addons/Discord-Alerts.html deleted file mode 100644 index f8cc8f9c..00000000 --- a/docs/addons/Discord-Alerts.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - - - - - Discord-Alerts addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Discord-Alerts addon

-

Sends alert messages to our discord server when certain events are triggered

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
utils.event
utils.color_presets
expcore.common
config.discord_alerts
modules.control.protection
modules.control.reports
modules.control.warnings
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.discord_alerts -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.protection -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.reports -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/FAGC.html b/docs/addons/FAGC.html deleted file mode 100644 index af99c768..00000000 --- a/docs/addons/FAGC.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - FAGC addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

FAGC addon

-

Allows the FAGC clientside bot to receive information about bans and unbans and propagate that information to other servers

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
utils.event
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Inventory-Clear.html b/docs/addons/Inventory-Clear.html deleted file mode 100644 index 6a11093b..00000000 --- a/docs/addons/Inventory-Clear.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - Inventory-Clear addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Inventory-Clear addon

-

Will move players items to spawn when they are banned or kicked, option to clear on leave

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
config.inventory_clear
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.inventory_clear -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Nukeprotect.html b/docs/addons/Nukeprotect.html deleted file mode 100644 index c5400f1f..00000000 --- a/docs/addons/Nukeprotect.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - Nukeprotect addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Nukeprotect addon

-

Disable new players from having certain items in their inventory, most commonly nukes

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
expcore.roles
config.nukeprotect
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.nukeprotect -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Player-Colours.html b/docs/addons/Player-Colours.html deleted file mode 100644 index 1e0d5afc..00000000 --- a/docs/addons/Player-Colours.html +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - - - Player-Colours addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Player-Colours addon

-

Gives players random colours when they join, also applies preset colours to those who have them

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.color_presets
utils.game
utils.event
config.preset_player_colours
utils.global
- - -
- - -

Dependencies

-
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.preset_player_colours -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Pollution-Grading.html b/docs/addons/Pollution-Grading.html deleted file mode 100644 index d67ed24e..00000000 --- a/docs/addons/Pollution-Grading.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Pollution-Grading addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Pollution-Grading addon

-

Makes polution look much nice of the map, ie not one big red mess

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
config.pollution_grading
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.pollution_grading -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Scorched-Earth.html b/docs/addons/Scorched-Earth.html deleted file mode 100644 index 2d85d262..00000000 --- a/docs/addons/Scorched-Earth.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - Scorched-Earth addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Scorched-Earth addon

-

When a player walks around the tiles under them will degrade over time, the same is true when entites are built

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
utils.global
expcore.common
config.scorched_earth
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.scorched_earth -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Spawn-Area.html b/docs/addons/Spawn-Area.html deleted file mode 100644 index 4eb2c0ba..00000000 --- a/docs/addons/Spawn-Area.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - Spawn-Area addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Spawn-Area addon

-

Adds a custom spawn area with chests and afk turrets

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.global
utils.event
config.spawn_area
- - -
- - -

Dependencies

-
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.spawn_area -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/Tree-Decon.html b/docs/addons/Tree-Decon.html deleted file mode 100644 index 370b420f..00000000 --- a/docs/addons/Tree-Decon.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - - - Tree-Decon addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Tree-Decon addon

-

Makes trees which are marked for decon "decay" quickly to allow faster building

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.event
utils.global
expcore.roles
expcore.gui
expcore.player_data
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/afk-kick.html b/docs/addons/afk-kick.html deleted file mode 100644 index aed499cc..00000000 --- a/docs/addons/afk-kick.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - afk-kick addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

afk-kick addon

-

Kicks players when all players on the server are afk

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
utils.global
config.afk_kick
expcore.async
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.afk_kick -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/greetings.html b/docs/addons/greetings.html deleted file mode 100644 index 9ff8d6d7..00000000 --- a/docs/addons/greetings.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - greetings addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

greetings addon

-

Greets players on join

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
utils.event
config.join_messages
utils.global
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.join_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/protection-jail.html b/docs/addons/protection-jail.html deleted file mode 100644 index a62123a8..00000000 --- a/docs/addons/protection-jail.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - - - protection-jail addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

protection-jail addon

-

When a player triggers protection multiple times they are automatically jailed

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.event
utils.global
modules.control.jail
modules.control.protection
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.jail -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.protection -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/addons/report-jail.html b/docs/addons/report-jail.html deleted file mode 100644 index 38b1921e..00000000 --- a/docs/addons/report-jail.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - report-jail addon - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

report-jail addon

-

When a player is reported, the player is automatically jailed if the combined playtime of the reporters exceeds the reported player

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
modules.control.jail
modules.control.reports
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.jail -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.reports -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Admin-Chat.html b/docs/commands/Admin-Chat.html deleted file mode 100644 index 8a4491e4..00000000 --- a/docs/commands/Admin-Chat.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - Admin-Chat commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Admin-Chat commands

-

Commands Module - Admin Chat - - Adds a command that allows admins to talk in a private chat

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.common
- - -

Commands

- - - - - - - - -
admin-chatSends a message in chat that only admins can see
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - admin-chat -
-
-
-
- -

Sends a message in chat that only admins can see

-

- - - Command Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message to send in the admin chat - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Admin-Markers.html b/docs/commands/Admin-Markers.html deleted file mode 100644 index 6f837fee..00000000 --- a/docs/commands/Admin-Markers.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - - - Admin-Markers commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Admin-Markers commands

-

Commands Module - Admin Markers - - Adds a command that creates map markers which can only be edited by admins

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
utils.global
utils.event
- - -

Commands

- - - - - - - - -
admin-markerToggle admin marker mode, can only be applied to yourself
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - admin-marker -
-
-
-
- -

Toggle admin marker mode, can only be applied to yourself

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Bonus.html b/docs/commands/Bonus.html deleted file mode 100644 index ce7bd2f0..00000000 --- a/docs/commands/Bonus.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - - Bonus commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Bonus commands

-

Commands Module - Bonus - - Adds a command that allows players to have increased stats

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - -
expcore.commands
expcore.roles
utils.event
utils.game
expcore.store
config.bonuses
- - -

Commands

- - - - - - - - -
bonusChanges the amount of bonus you receive
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.bonuses -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - bonus -
-
-
-
- -

Changes the amount of bonus you receive

-

- - - Command Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - range 0-50 the percent increase for your bonus - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Cheat-Mode.html b/docs/commands/Cheat-Mode.html deleted file mode 100644 index 6c7dd8bf..00000000 --- a/docs/commands/Cheat-Mode.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - - - Cheat-Mode commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Cheat-Mode commands

-

Commands Module - Cheat Mode - - Adds a command that allows players to enter cheat mode

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -

Commands

- - - - - - - - -
toggle-cheat-modeToggles cheat mode for your player, or another player.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - toggle-cheat-mode -
-
-
-
- -

Toggles cheat mode for your player, or another player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - player to toggle chest mode of, can be nil for self - - (default: self) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Clear-Inventory.html b/docs/commands/Clear-Inventory.html deleted file mode 100644 index 1d672646..00000000 --- a/docs/commands/Clear-Inventory.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - Clear-Inventory commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Clear-Inventory commands

-

Commands Module - Clear Inventory - - Adds a command that allows admins to clear people's inventorys

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.common
- - -

Commands

- - - - - - - - -
clear-inventoryClears a players inventory
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - clear-inventory -
-
-
-
- -

Clears a players inventory

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the inventory of - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Connect.html b/docs/commands/Connect.html deleted file mode 100644 index f2a89ef4..00000000 --- a/docs/commands/Connect.html +++ /dev/null @@ -1,631 +0,0 @@ - - - - - - - - Connect commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Connect commands

-

Commands Module - Connect - - Adds a commands that allows you to request a player move to another server

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.async
expcore.external
expcore.commands
- - -

Commands

- - - - - - - - - - - - - - - - -
connectConnect to a different server
connect-playerConnect a player to a different server
connect-allConnect all players to a different server
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.external -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - connect -
-
-
-
- -

Connect to a different server

-

- - - Command Parameters: - -
    - - - - - -
  • - - server - - : - - (string) - - The address or name of the server to connect to - -
  • - - - - - -
  • - - is_address - - : - - (boolean) - - If an address was given for the server param - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - connect-player -
-
-
-
- -

Connect a player to a different server

-

- - - Command Parameters: - -
    - - - - - -
  • - - address - - : - - (string) - - The address or name of the server to connect to - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to connect to a different server - -
  • - - - - - -
  • - - is_address - - : - - (boolean) - - If an address was given for the server param - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - connect-all -
-
-
-
- -

Connect all players to a different server

-

- - - Command Parameters: - -
    - - - - - -
  • - - address - - : - - (string) - - The address or name of the server to connect to - -
  • - - - - - -
  • - - is_address - - : - - (boolean) - - If an address was given for the server param - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Debug.html b/docs/commands/Debug.html deleted file mode 100644 index aa70dd21..00000000 --- a/docs/commands/Debug.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - Debug commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Debug commands

-

Commands Module - Debug - - Adds a command that opens the debug frame

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
modules.gui.debug.main_view
expcore.commands
- - -

Commands

- - - - - - - - -
debugOpens the debug pannel for viewing tables.
- - -
- - -

Dependencies

-
-
-
-
- # - modules.gui.debug.main_view -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - debug -
-
-
-
- -

Opens the debug pannel for viewing tables.

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Find.html b/docs/commands/Find.html deleted file mode 100644 index 58629c7b..00000000 --- a/docs/commands/Find.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - - - - Find commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Find commands

-

Commands Module - Find - - Adds a command that zooms in on the given player

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -

Commands

- - - - - - - - -
find-on-mapFind a player on your map.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - find-on-map -
-
-
-
- -

Find a player on your map.

-

- - - Command Parameters: - -
    - - - - - -
  • - - the - - : - - (LuaPlayer) - - player to find on the map - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Help.html b/docs/commands/Help.html deleted file mode 100644 index 461cb168..00000000 --- a/docs/commands/Help.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - - - Help commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Help commands

-

Commands Module - Help - - Adds a better help command that allows searching of descriotions and names

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -

Commands

- - - - - - - - -
chelpSearches for a keyword in all commands you are allowed to use.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - chelp -
-
-
-
- -

Searches for a keyword in all commands you are allowed to use.

-

- - - Command Parameters: - -
    - - - - - -
  • - - keyword - - : - - (string) - - the keyword that will be looked for - -
  • - - - - - -
  • - - page - - : - - (number) - - the page of help to view, must be in range of pages - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Home.html b/docs/commands/Home.html deleted file mode 100644 index b867e822..00000000 --- a/docs/commands/Home.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - - - - Home commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Home commands

-

Commands Module - Home - - Adds a command that allows setting and teleporting to your home position

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -

Commands

- - - - - - - - - - - - - - - - - - - - -
homeTeleports you to your home location
home-setSets your home location to your current position
home-getReturns your current home location
returnTeleports you to previous location
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - home -
-
-
-
- -

Teleports you to your home location

-

- - - - - - - - - - - - - - -
-
-
-
- # - home-set -
-
-
-
- -

Sets your home location to your current position

-

- - - - - - - - - - - - - - -
-
-
-
- # - home-get -
-
-
-
- -

Returns your current home location

-

- - - - - - - - - - - - - - -
-
-
-
- # - return -
-
-
-
- -

Teleports you to previous location

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Interface.html b/docs/commands/Interface.html deleted file mode 100644 index 94b4ab94..00000000 --- a/docs/commands/Interface.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - Interface commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Interface commands

-

Commands Module - Interface - - Adds a command that acts as a direct link to the the active softmod, for debug use

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -

Commands

- - - - - - - - -
interfaceSends an invocation to be ran and returns the result.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - interface -
-
-
-
- -

Sends an invocation to be ran and returns the result.

-

- - - Command Parameters: - -
    - - - - - -
  • - - invocation - - : - - (string) - - the command that will be run - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/InventorySearch.html b/docs/commands/InventorySearch.html deleted file mode 100644 index 5f0a6d72..00000000 --- a/docs/commands/InventorySearch.html +++ /dev/null @@ -1,618 +0,0 @@ - - - - - - - - InventorySearch commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

InventorySearch commands

-

Commands Module - Inventory Search - - Adds commands that will search all players inventories for an item

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
util
expcore.common
- - -

Commands

- - - - - - - - - - - - - - - - - - - - -
search-amountGet a list of players sorted by the quantity of an item in their inventory
search-recentGet a list of players who have the given item, sorted by how recently they joined
searchGet a list of players sorted by quantity held and play time
search-onlineGet a list of online players sorted by quantity held and play time
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - search-amount -
-
-
-
- -

Get a list of players sorted by the quantity of an item in their inventory

-

- - - Command Parameters: - -
    - - - - - -
  • - - item - - : - - (LuaItemPrototype) - - The item to search for in players inventories - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - search-recent -
-
-
-
- -

Get a list of players who have the given item, sorted by how recently they joined

-

- - - Command Parameters: - -
    - - - - - -
  • - - item - - : - - (LuaItemPrototype) - - The item to search for in players inventories - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - search -
-
-
-
- -

Get a list of players sorted by quantity held and play time

-

- - - Command Parameters: - -
    - - - - - -
  • - - item - - : - - (LuaItemPrototype) - - The item to search for in players inventories - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - search-online -
-
-
-
- -

Get a list of online players sorted by quantity held and play time

-

- - - Command Parameters: - -
    - - - - - -
  • - - item - - : - - (LuaItemPrototype) - - The item to search for in players inventories - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Jail.html b/docs/commands/Jail.html deleted file mode 100644 index 58ca1d8a..00000000 --- a/docs/commands/Jail.html +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - - - Jail commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Jail commands

-

Commands Module - Jail - - Adds a commands that allow admins to jail and unjail

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
modules.control.jail
expcore.common
- - -

Commands

- - - - - - - - - - - - -
jailPuts a player into jail and removes all other roles.
unjailRemoves a player from jail.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.jail -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - jail -
-
-
-
- -

Puts a player into jail and removes all other roles.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be jailed - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason why the player is being jailed - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - unjail -
-
-
-
- -

Removes a player from jail.

-

- - - Command Parameters: - -
    - - - - - -
  • - - the - - : - - (LuaPlayer) - - player that will be unjailed - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Kill.html b/docs/commands/Kill.html deleted file mode 100644 index a56aa1b2..00000000 --- a/docs/commands/Kill.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - - - Kill commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Kill commands

-

Commands Module - Kill - - Adds a command that allows players to kill them selfs and others

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -

Commands

- - - - - - - - -
killKills yourself or another player.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - kill -
-
-
-
- -

Kills yourself or another player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to kill, must be alive to be valid - - (default: self) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/LastLocation.html b/docs/commands/LastLocation.html deleted file mode 100644 index ed329f1c..00000000 --- a/docs/commands/LastLocation.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - LastLocation commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

LastLocation commands

-

Commands Module - Last location - - Adds a command that will return the last location of a player

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.common
- - -

Commands

- - - - - - - - -
last-locationGet the last location of a player.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - last-location -
-
-
-
- -

Get the last location of a player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want a location of - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Me.html b/docs/commands/Me.html deleted file mode 100644 index 071b27ba..00000000 --- a/docs/commands/Me.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - - - - Me commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Me commands

-

Commands Module - Me - - Adds a command that adds * around your message in the chat

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -

Commands

- - - - - - - - -
meSends an action message in the chat
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - me -
-
-
-
- -

Sends an action message in the chat

-

- - - Command Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - the action that follows your name in chat - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Protection.html b/docs/commands/Protection.html deleted file mode 100644 index 4f862f5a..00000000 --- a/docs/commands/Protection.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - - - Protection commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Protection commands

-

Commands Module - Protection - - Adds commands that can add and remove protection

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
utils.event
utils.global
expcore.roles
expcore.commands
expcore.common
modules.control.protection
modules.control.selection
- - -

Commands

- - - - - - - - - - - - -
protect-entityToggles entity protection selection
protect-areaToggles area protection selection
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.protection -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.selection -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - protect-entity -
-
-
-
- -

Toggles entity protection selection

-

- - - - - - - - - - - - - - -
-
-
-
- # - protect-area -
-
-
-
- -

Toggles area protection selection

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Quickbar.html b/docs/commands/Quickbar.html deleted file mode 100644 index 46575536..00000000 --- a/docs/commands/Quickbar.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - - - Quickbar commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Quickbar commands

-

Commands Module - Quickbar - - Adds a command that allows players to load Quickbar presets

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
config.preset_player_quickbar
- - -

Commands

- - - - - - - - - - - - -
load-quickbarLoads your quickbar preset
save-quickbarSaves your quickbar preset to the script-output folder
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.preset_player_quickbar -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - load-quickbar -
-
-
-
- -

Loads your quickbar preset

-

- - - - - - - - - - - - - - -
-
-
-
- # - save-quickbar -
-
-
-
- -

Saves your quickbar preset to the script-output folder

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Rainbow.html b/docs/commands/Rainbow.html deleted file mode 100644 index 610ea94b..00000000 --- a/docs/commands/Rainbow.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - Rainbow commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Rainbow commands

-

Commands Module - Rainbow - - Adds a command that prints your message in rainbow font

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.common
- - -

Commands

- - - - - - - - -
rainbowSends an rainbow message in the chat
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - rainbow -
-
-
-
- -

Sends an rainbow message in the chat

-

- - - Command Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be printed in chat - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Repair.html b/docs/commands/Repair.html deleted file mode 100644 index a2769d0b..00000000 --- a/docs/commands/Repair.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - Repair commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Repair commands

-

Commands Module - Repair - - Adds a command that allows an admin to repair and revive a large area

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
config.repair
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.repair -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Reports.html b/docs/commands/Reports.html deleted file mode 100644 index 2c22a2d9..00000000 --- a/docs/commands/Reports.html +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - Reports commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Reports commands

-

Commands Module - Reports - - Adds a commands that allow players to report other players

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.roles
expcore.commands
modules.control.reports
expcore.common
- - -

Commands

- - - - - - - - - - - - - - - - -
reportReports a player and notifies moderators
get-reportsGets a list of all reports that a player has on them.
clear-reportsClears all reports from a player or just the report from one player.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.reports -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - report -
-
-
-
- -

Reports a player and notifies moderators

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to report, some players are immune - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason the player is being reported - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - get-reports -
-
-
-
- -

Gets a list of all reports that a player has on them.

-

If no player then lists all players and the number of reports on them.

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - clear-reports -
-
-
-
- -

Clears all reports from a player or just the report from one player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the report(s) from - -
  • - - - - - -
  • - - from - - : - - (LuaPlayer) - - -player remove only the report made by this player - - (default: all) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Roles.html b/docs/commands/Roles.html deleted file mode 100644 index fbd94415..00000000 --- a/docs/commands/Roles.html +++ /dev/null @@ -1,597 +0,0 @@ - - - - - - - - Roles commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Roles commands

-

Commands Module - Roles - - Adds a commands that allow interaction with the role system

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
expcore.roles
utils.color_presets
- - -

Commands

- - - - - - - - - - - - - - - - -
assign-roleAssigns a role to a player
unassign-roleUnassigns a role from a player
list-rolesLists all roles in they correct order
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - assign-role -
-
-
-
- -

Assigns a role to a player

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to assign the role to - -
  • - - - - - -
  • - - role - - : - - (string) - - the name of the role to assign to the player, supports auto complete after enter - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - unassign-role -
-
-
-
- -

Unassigns a role from a player

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to unassign the role from - -
  • - - - - - -
  • - - role - - : - - (string) - - the name of the role to unassign from the player, supports auto complete after enter - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - list-roles -
-
-
-
- -

Lists all roles in they correct order

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - list only the roles which this player has - - (default: all) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Spawn.html b/docs/commands/Spawn.html deleted file mode 100644 index a5e159cb..00000000 --- a/docs/commands/Spawn.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - - - Spawn commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Spawn commands

-

Commands Module - Spawn - - Adds a command that allows players to teleport to their spawn point

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -

Commands

- - - - - - - - -
go-to-spawnTeleport to spawn
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - go-to-spawn -
-
-
-
- -

Teleport to spawn

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to teleport to their spawn point - - (default: self) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Spectate.html b/docs/commands/Spectate.html deleted file mode 100644 index f2605b81..00000000 --- a/docs/commands/Spectate.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - - - - - Spectate commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Spectate commands

-

Commands Module - Spectate - - Adds commands relating to spectate and follow

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
modules.control.spectate
expcore.commands
- - -

Commands

- - - - - - - - - - - - -
spectateToggles spectator mode for the caller
followEnters follow mode for the caller, following the given player.
- - -
- - -

Dependencies

-
-
-
-
- # - modules.control.spectate -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - spectate -
-
-
-
- -

Toggles spectator mode for the caller

-

- - - - - - - - - - - - - - -
-
-
-
- # - follow -
-
-
-
- -

Enters follow mode for the caller, following the given player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player that will be followed - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Tag.html b/docs/commands/Tag.html deleted file mode 100644 index 976e9558..00000000 --- a/docs/commands/Tag.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - Tag commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Tag commands

-

Commands Module - Tag - - Adds a command that allows players to have a custom tag after their name

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -

Commands

- - - - - - - - - - - - -
tagSets your player tag.
tag-clearClears your tag.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - tag -
-
-
-
- -

Sets your player tag.

-

- - - Command Parameters: - -
    - - - - - -
  • - - tag - - : - - (string) - - the tag that will be after the name, there is a max length - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - tag-clear -
-
-
-
- -

Clears your tag.

-

Or another player if you are admin.

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the tag from, nil will apply to self - - (default: self) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Teleport.html b/docs/commands/Teleport.html deleted file mode 100644 index 2c572b2d..00000000 --- a/docs/commands/Teleport.html +++ /dev/null @@ -1,524 +0,0 @@ - - - - - - - - Teleport commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Teleport commands

-

Commands Module - Teleport - - Adds a command that allows players to teleport to other players

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -

Commands

- - - - - - - - - - - - - - - - -
teleportTeleports a player to another player.
bringTeleports a player to you.
gotoTeleports you to a player.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - teleport -
-
-
-
- -

Teleports a player to another player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - from_player - - : - - (LuaPlayer) - - the player that will be teleported, must be alive - -
  • - - - - - -
  • - - to_player - - : - - (LuaPlayer) - - the player to teleport to, must be online (if dead goes to where they died) - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - bring -
-
-
-
- -

Teleports a player to you.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be teleported, must be alive - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - goto -
-
-
-
- -

Teleports you to a player.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to teleport to, must be online (if dead goes to where they died) - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/commands/Warnings.html b/docs/commands/Warnings.html deleted file mode 100644 index d0112162..00000000 --- a/docs/commands/Warnings.html +++ /dev/null @@ -1,609 +0,0 @@ - - - - - - - - Warnings commands - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warnings commands

-

Commands Module - Warnings - - Adds a commands that allow admins to warn other players

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.commands
modules.control.warnings
expcore.common
config.warnings
- - -

Commands

- - - - - - - - - - - - - - - - -
give-warningGives a warning to a player; may lead to automatic script action.
get-warningsGets the number of warnings a player has.
clear-warningsClears all warnings (and script warnings) from a player
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - give-warning -
-
-
-
- -

Gives a warning to a player; may lead to automatic script action.

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player the will recive a warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason the player is being given a warning - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - get-warnings -
-
-
-
- -

Gets the number of warnings a player has.

-

If no player then lists all players and the number of warnings they have.

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the warning for, if nil all players are listed - - (default: list) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - clear-warnings -
-
-
-
- -

Clears all warnings (and script warnings) from a player

-

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the warnings from - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Advanced-Start.html b/docs/configs/Advanced-Start.html deleted file mode 100644 index 0c8dd57c..00000000 --- a/docs/configs/Advanced-Start.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - - - Advanced-Start config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Advanced-Start config

-

This file is used to setup the map starting settings and the items players will start with

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
skip_intro
skip_victory
disable_base_game_silo_script
research_queue_from_start
friendly_fire
enemy_expansion
chart_radius
items
- - -
- - -

Settings

-
-
-
-
- # - skip_intro -
-
-
-
- -

-

skips the intro given in the default factorio free play scenario

- - - - - - - - - - - - - - -
-
-
-
- # - skip_victory -
-
-
-
- -

-

will skip the victory screen when a rocket is launched

- - - - - - - - - - - - - - -
-
-
-
- # - disable_base_game_silo_script -
-
-
-
- -

-

will not load the silo script at all

- - - - - - - - - - - - - - -
-
-
-
- # - research_queue_from_start -
-
-
-
- -

-

when true the research queue is useable from the start

- - - - - - - - - - - - - - -
-
-
-
- # - friendly_fire -
-
-
-
- -

-

weather players will be able to attack each other on the same force

- - - - - - - - - - - - - - -
-
-
-
- # - enemy_expansion -
-
-
-
- -

-

a catch all for in case the map settings file fails to load

- - - - - - - - - - - - - - -
-
-
-
- # - chart_radius -
-
-
-
- -

-

the number of tiles that will be charted when the map starts

- - - - - - - - - - - - - - -
-
-
-
- # - items -
-
-
-
- -

-

items and there condition for being given - ['item-name'] = function(amount_made, production_stats, player) return end -- 0 means no items given - Plates

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Autofill.html b/docs/configs/Autofill.html deleted file mode 100644 index 588a7b24..00000000 --- a/docs/configs/Autofill.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - Autofill config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Autofill config

-

This file contains all the different settings for the autofill system and gui

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/configs/Bonuses.html b/docs/configs/Bonuses.html deleted file mode 100644 index 150f12c4..00000000 --- a/docs/configs/Bonuses.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - Bonuses config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Bonuses config

-

Lists all bonuses which can be used, name followed by min max

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/configs/Chat-Reply.html b/docs/configs/Chat-Reply.html deleted file mode 100644 index fc48525c..00000000 --- a/docs/configs/Chat-Reply.html +++ /dev/null @@ -1,525 +0,0 @@ - - - - - - - - Chat-Reply config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Chat-Reply config

-

This file defines the different triggers for the chat bot

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.common
- - -

Settings

- - - - - - - - - - - - - - - - - - - - - - -
allow_command_prefix_for_messages
messages
command_admin_only
command_permission
command_prefix
commands
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Settings

-
-
-
-
- # - allow_command_prefix_for_messages -
-
-
-
- -

-

when true any message trigger will print to all player when prefixed

- - - - - - - - - - - - - - -
-
-
-
- # - messages -
-
-
-
- -

-

will trigger when ever the word is said

- - - - - - - - - - - - - - -
-
-
-
- # - command_admin_only -
-
-
-
- -

-

when true will only allow chat commands for admins

- - - - - - - - - - - - - - -
-
-
-
- # - command_permission -
-
-
-
- -

-

the permission used to allow command prefixes

- - - - - - - - - - - - - - -
-
-
-
- # - command_prefix -
-
-
-
- -

-

prefix used for commands below and to print to all players (if enabled above)

- - - - - - - - - - - - - - -
-
-
-
- # - commands -
-
-
-
- -

-

will trigger only when command prefix is given

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Auth-Admin.html b/docs/configs/Commands-Auth-Admin.html deleted file mode 100644 index bed00ccb..00000000 --- a/docs/configs/Commands-Auth-Admin.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - - - Commands-Auth-Admin config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Auth-Admin config

-

This is a very simple config file which adds a admin only auth function; - not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua; - either way you can change the requirements to be "admin" if you wanted to

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Auth-Roles.html b/docs/configs/Commands-Auth-Roles.html deleted file mode 100644 index 4acbc10f..00000000 --- a/docs/configs/Commands-Auth-Roles.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Commands-Auth-Roles config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Auth-Roles config

-

This will make commands only work if the role has been allowed it in the role config

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Auth-Runtime-Disable.html b/docs/configs/Commands-Auth-Runtime-Disable.html deleted file mode 100644 index 5d3d3afe..00000000 --- a/docs/configs/Commands-Auth-Runtime-Disable.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - - - Commands-Auth-Runtime-Disable config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Auth-Runtime-Disable config

-

This config for command auth allows commands to be globally enabled and disabled during runtime; - this config adds Commands.disable and Commands.enable to enable and disable commands for all users

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -

Functions

- - - - - - - - - - - - -
Commands.disable(command_name)Stops a command from be used by any one
Commands.enable(command_name)Allows a command to be used again after disable was used
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Commands.disable(command_name) -
-
-
-
- -

Stops a command from be used by any one

-

- - - Parameters: - -
    - - - - - -
  • - - command_name - - : - - (string) - - the name of the command to disable - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Commands.enable(command_name) -
-
-
-
- -

Allows a command to be used again after disable was used

-

- - - Parameters: - -
    - - - - - -
  • - - command_name - - : - - (string) - - the name of the command to enable - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Color-Parse.html b/docs/configs/Commands-Color-Parse.html deleted file mode 100644 index 3bdc5423..00000000 --- a/docs/configs/Commands-Color-Parse.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Commands-Color-Parse config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Color-Parse config

-

This will make commands only work when a valid color from the presets has been selected

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.color_presets
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Parse-Roles.html b/docs/configs/Commands-Parse-Roles.html deleted file mode 100644 index 267d60e1..00000000 --- a/docs/configs/Commands-Parse-Roles.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - Commands-Parse-Roles config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Parse-Roles config

-

Adds some parse functions that can be used with the role system

-

- - - - - - -

Usage

-
 Adds Parses:
-    role
-    player-role
-    player-role-online
-    player-role-alive
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
expcore.roles
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands-Parse.html b/docs/configs/Commands-Parse.html deleted file mode 100644 index 1a0bf6cf..00000000 --- a/docs/configs/Commands-Parse.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - Commands-Parse config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands-Parse config

-

This file contains some common command param parse functions; -this file is less of a config and more of a requirement but you may wish to change how some behave; -as such you need to be confident with lua but you edit this config file; -use Commands.add_parse('name',function(input, player, reject) end) to add a parse; -see ./expcore/commands.lua for more details

-

- - - - - - -

Usage

-
 Adds Parses:
-    boolean
-    string-options - options: array
-    string-max-length - max_length: number
-    number
-    integer
-    number-range - range_min: number, range_max: number
-    integer-range - range_min: number, range_max: number
-    player
-    player-online
-    player-alive
-    force
-    surface
- - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands.auth_admin.html b/docs/configs/Commands.auth_admin.html deleted file mode 100644 index b63055ce..00000000 --- a/docs/configs/Commands.auth_admin.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - Commands.auth_admin config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands.auth_admin config

-

This is a very simple config file which adds a admin only auth functio - not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua - either way you can change the requirements to be "admin" if you wanted to

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands.auth_roles.html b/docs/configs/Commands.auth_roles.html deleted file mode 100644 index c25d1e43..00000000 --- a/docs/configs/Commands.auth_roles.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - Commands.auth_roles config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands.auth_roles config

-

This will make commands only work if the role has been allowed it in the role config

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands.auth_runtime_disable.html b/docs/configs/Commands.auth_runtime_disable.html deleted file mode 100644 index e146ff0e..00000000 --- a/docs/configs/Commands.auth_runtime_disable.html +++ /dev/null @@ -1,437 +0,0 @@ - - - - - - - - Commands.auth_runtime_disable config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands.auth_runtime_disable config

-

This config for command auth allows commands to be globally enabled and disabled during runtime - this config adds Commands.disable and Commands.enable to enable and disable commands for all users

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -

Functions

- - - - - - - - - - - - -
Commands.disable(command_name)Stops a command from be used by any one
Commands.enable(command_name)Allows a command to be used again after disable was used
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Commands.disable(command_name) -
-
-
-
- -

Stops a command from be used by any one

-

- - - Parameters: - -
    - - - - - -
  • - - command_name - - : - - (string) - - the name of the command to disable - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Commands.enable(command_name) -
-
-
-
- -

Allows a command to be used again after disable was used

-

- - - Parameters: - -
    - - - - - -
  • - - command_name - - : - - (string) - - the name of the command to enable - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands.parse_general.html b/docs/configs/Commands.parse_general.html deleted file mode 100644 index 49dd695d..00000000 --- a/docs/configs/Commands.parse_general.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - Commands.parse_general config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands.parse_general config

-

This file contains some common command param parse functions -this file is less of a config and more of a requirement but you may wish to change how some behave -as such you need to be confident with lua but you edit this config file -use Commands.add_parse('name',function(input,player,reject) end) to add a parse -see ./expcore/commands.lua for more details

-

- - - - - - -

Usage

-
 Adds Parses:
-    boolean
-    string-options - options: array
-    string-max-length - max_length: number
-    number
-    integer
-    number-range - range_min: number, range_max: number
-    integer-range - range_min: number, range_max: number
-    player
-    player-online
-    player-alive
-    force
-    surface
- - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.game
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Commands.parse_roles.html b/docs/configs/Commands.parse_roles.html deleted file mode 100644 index 76e5c918..00000000 --- a/docs/configs/Commands.parse_roles.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - Commands.parse_roles config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands.parse_roles config

-

Adds some parse functions that can be used with the role system

-

- - - - - - -

Usage

-
 Adds Parses:
-    role
-    player-role
-    player-role-online
-    player-role-alive
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
expcore.roles
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Compilatron.html b/docs/configs/Compilatron.html deleted file mode 100644 index 34ccc78b..00000000 --- a/docs/configs/Compilatron.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - Compilatron config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Compilatron config

-

Config file for the compliatrons including where they spawn and what messages they show

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - -
message_cycle
locations
messages
- - -
- - -

Settings

-
-
-
-
- # - message_cycle -
-
-
-
- -

-

15 seconds default, how often (in ticks) the messages will cycle

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

defines the spawn locations for all compilatrons

- - - - - - - - - - - - - - -
-
-
-
- # - messages -
-
-
-
- -

-

the messages that each one will say, must be same name as its location

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Death-Logger.html b/docs/configs/Death-Logger.html deleted file mode 100644 index fd759b2d..00000000 --- a/docs/configs/Death-Logger.html +++ /dev/null @@ -1,516 +0,0 @@ - - - - - - - - Death-Logger config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Death-Logger config

-

This config controls what happens when a player dies mostly about map markers and item collection; - allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present; - if not present then the commands will not be loaded into the game

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - -
use_chests_as_bodies
auto_collect_bodies
show_map_markers
include_time_of_death
map_icon
show_light_at_corpse
show_line_to_corpse
- - -
- - -

Settings

-
-
-
-
- # - use_chests_as_bodies -
-
-
-
- -

-

weather items should be moved into a chest when a player dies

- - - - - - - - - - - - - - -
-
-
-
- # - auto_collect_bodies -
-
-
-
- -

-

enables items being returned to the spawn point in chests upon corpse expiring

- - - - - - - - - - - - - - -
-
-
-
- # - show_map_markers -
-
-
-
- -

-

shows markers on the map where bodies are

- - - - - - - - - - - - - - -
-
-
-
- # - include_time_of_death -
-
-
-
- -

-

weather to include the time of death on the map marker

- - - - - - - - - - - - - - -
-
-
-
- # - map_icon -
-
-
-
- -

-

the icon that the map marker shows; nil means no icon; format as a SingleID

- - - - - - - - - - - - - - -
-
-
-
- # - show_light_at_corpse -
-
-
-
- -

-

if a light should be rendered at the corpse

- - - - - - - - - - - - - - -
-
-
-
- # - show_line_to_corpse -
-
-
-
- -

-

if a line should be rendered from you to your corpse

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Deconlog.html b/docs/configs/Deconlog.html deleted file mode 100644 index ef91e593..00000000 --- a/docs/configs/Deconlog.html +++ /dev/null @@ -1,484 +0,0 @@ - - - - - - - - Deconlog config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Deconlog config

-

This config controls whether actions such as deconning by players without sufficient permissions is logged or not

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - -
decon_area
built_entity
mined_entity
fired_nuke
fired_nuke
fired_nuke
- - -
- - -

Settings

-
-
-
-
- # - decon_area -
-
-
-
- -

-

whether to log when an area is being deconstructed

- - - - - - - - - - - - - - -
-
-
-
- # - built_entity -
-
-
-
- -

-

whether to log when an entity is built

- - - - - - - - - - - - - - -
-
-
-
- # - mined_entity -
-
-
-
- -

-

whether to log when an entity is mined

- - - - - - - - - - - - - - -
-
-
-
- # - fired_nuke -
-
-
-
- -

-

whether to log when a rocket is fired

- - - - - - - - - - - - - - -
-
-
-
- # - fired_nuke -
-
-
-
- -

-

whether to log when a explosive rocket is fired

- - - - - - - - - - - - - - -
-
-
-
- # - fired_nuke -
-
-
-
- -

-

whether to log when a nuke is fired

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Discord-Alerts.html b/docs/configs/Discord-Alerts.html deleted file mode 100644 index ba8669c1..00000000 --- a/docs/configs/Discord-Alerts.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - Discord-Alerts config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Discord-Alerts config

-

Config file used to enable and disable different push messages for discord

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/configs/File-Loader.html b/docs/configs/File-Loader.html deleted file mode 100644 index 51d1ab4a..00000000 --- a/docs/configs/File-Loader.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - File-Loader config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

File-Loader config

-

This contains a list of all files that will be loaded and the order they are loaded in; - to stop a file from loading add "--" in front of it, remove the "--" to have the file be loaded; - config files should be loaded after all modules are loaded; - core files should be required by modules and not be present in this list;

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/configs/Permission-Groups.html b/docs/configs/Permission-Groups.html deleted file mode 100644 index d67ab2fe..00000000 --- a/docs/configs/Permission-Groups.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - - Permission-Groups config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Permission-Groups config

-

Use this file to add new permission groups to the game; - start with Permission_Groups.new_group('name'); - then use either :allow_all() or :disallow_all() to set the default for non specified actions; - then use :allow{} and :disallow{} to specify certain actions to allow/disallow

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.permission_groups
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.permission_groups -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Player-List.html b/docs/configs/Player-List.html deleted file mode 100644 index b46abd97..00000000 --- a/docs/configs/Player-List.html +++ /dev/null @@ -1,734 +0,0 @@ - - - - - - - - Player-List config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Player-List config

-

Config for the different action buttons that show on the player list; - each button has the button define(s) given along side an auth function, and optional reason callback; - if a reason callback is used then Store.set(action_name_store,player.name,'BUTTON_NAME') should be called during on_click; - buttons can be removed from the gui by commenting them out of the config at the bottom of this file; - the key used for the name of the button is the permission name used by the role system;

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
modules.control.reports
modules.control.warnings
modules.control.jail
utils.color_presets
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
goto_playerTeleports the user to the action player
bring_playerTeleports the action player to the user
report_playerReports the action player, requires a reason to be given
warn_playerGives the action player a warning, requires a reason
jail_playerJails the action player, requires a reason
kick_playerKicks the action player, requires a reason
ban_playerBans the action player, requires a reason
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.reports -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.jail -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - goto_player -
-
-
-
- -

Teleports the user to the action player

-

- - - - - - - - - - - - - - -
-
-
-
- # - bring_player -
-
-
-
- -

Teleports the action player to the user

-

- - - - - - - - - - - - - - -
-
-
-
- # - report_player -
-
-
-
- -

Reports the action player, requires a reason to be given

-

- - - - - - - - - - - - - - -
-
-
-
- # - warn_player -
-
-
-
- -

Gives the action player a warning, requires a reason

-

- - - - - - - - - - - - - - -
-
-
-
- # - jail_player -
-
-
-
- -

Jails the action player, requires a reason

-

- - - - - - - - - - - - - - -
-
-
-
- # - kick_player -
-
-
-
- -

Kicks the action player, requires a reason

-

- - - - - - - - - - - - - - -
-
-
-
- # - ban_player -
-
-
-
- -

Bans the action player, requires a reason

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Pollution-Grading.html b/docs/configs/Pollution-Grading.html deleted file mode 100644 index 193f2b04..00000000 --- a/docs/configs/Pollution-Grading.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - Pollution-Grading config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Pollution-Grading config

-

This controls how pollution is viewed on the map

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - -
reference_point
max_scalar
min_scalar
update_delay
- - -
- - -

Settings

-
-
-
-
- # - reference_point -
-
-
-
- -

-

where pollution is read from

- - - - - - - - - - - - - - -
-
-
-
- # - max_scalar -
-
-
-
- -

-

the scale between true max and max

- - - - - - - - - - - - - - -
-
-
-
- # - min_scalar -
-
-
-
- -

-

the scale between the lowest max and min

- - - - - - - - - - - - - - -
-
-
-
- # - update_delay -
-
-
-
- -

-

time in minutes between view updates

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Popup-Messages.html b/docs/configs/Popup-Messages.html deleted file mode 100644 index c6c6afad..00000000 --- a/docs/configs/Popup-Messages.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - - Popup-Messages config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Popup-Messages config

-

A combination of config settings for different popup values like chat and damage

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - -
show_player_messages
show_player_mentions
show_player_damage
show_player_health
damage_location_variance
- - -
- - -

Settings

-
-
-
-
- # - show_player_messages -
-
-
-
- -

-

weather a message in chat will make a popup above them

- - - - - - - - - - - - - - -
-
-
-
- # - show_player_mentions -
-
-
-
- -

-

weather a mentioned player will have a popup when mentioned in chat

- - - - - - - - - - - - - - -
-
-
-
- # - show_player_damage -
-
-
-
- -

-

weather to show damage done by players

- - - - - - - - - - - - - - -
-
-
-
- # - show_player_health -
-
-
-
- -

-

weather to show player health when attacked

- - - - - - - - - - - - - - -
-
-
-
- # - damage_location_variance -
-
-
-
- -

-

how close to the eade of an entity the popups will appear

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Preset-Player-Colours.html b/docs/configs/Preset-Player-Colours.html deleted file mode 100644 index 20a9bbf1..00000000 --- a/docs/configs/Preset-Player-Colours.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - Preset-Player-Colours config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Preset-Player-Colours config

-

Preset colours that players get when they join the server, if not in the list then will be given a random colour (which isnt disallowed)

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - -
players
disallow
- - -
- - -

Settings

-
-
-
-
- # - players -
-
-
-
- -

-

list of all players and the colour in rgb256 that they will recive upon joining

- - - - - - - - - - - - - - -
-
-
-
- # - disallow -
-
-
-
- -

-

colours which will not given to players; the value does not matter it is only the key which is checked

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Preset-Player-Quickbar.html b/docs/configs/Preset-Player-Quickbar.html deleted file mode 100644 index 7b6da2aa..00000000 --- a/docs/configs/Preset-Player-Quickbar.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - Preset-Player-Quickbar config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Preset-Player-Quickbar config

-

Preset quickbar items that players can load

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/configs/Repair.html b/docs/configs/Repair.html deleted file mode 100644 index 086b3971..00000000 --- a/docs/configs/Repair.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - - Repair config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Repair config

-

Config file for the repair command

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - -
disallow
max_range
allow_blueprint_repair
allow_ghost_revive
allow_heal_entities
- - -
- - -

Settings

-
-
-
-
- # - disallow -
-
-
-
- -

-

items in this list will never be repaired

- - - - - - - - - - - - - - -
-
-
-
- # - max_range -
-
-
-
- -

-

the max range that can be used with the repair command

- - - - - - - - - - - - - - -
-
-
-
- # - allow_blueprint_repair -
-
-
-
- -

-

when true will allow blueprints (things not destroyed by biters) to be build instantly using the repair command

- - - - - - - - - - - - - - -
-
-
-
- # - allow_ghost_revive -
-
-
-
- -

-

when true will allow ghosts (things destroyed by biters) to be build instantly using the repair command

- - - - - - - - - - - - - - -
-
-
-
- # - allow_heal_entities -
-
-
-
- -

-

when true will heal entities to full health that are within range

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Rockets.html b/docs/configs/Rockets.html deleted file mode 100644 index 5e16f168..00000000 --- a/docs/configs/Rockets.html +++ /dev/null @@ -1,874 +0,0 @@ - - - - - - - - Rockets config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Rockets config

-

This file controls what will show in each section of the rocket info gui

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
stats
show_stats
show_first_rocket
show_last_rocket
show_fastest_rocket
show_total_rockets
show_game_avg
rolling_avg
milestones
show_milestones
progress
show_progress
allow_zoom_to_map
allow_remote_launch
remote_launch_admins_only
remote_launch_role_permission
allow_toggle_active
toggle_active_admins_only
toggle_active_role_permission
- - -
- - -

Settings

-
-
-
-
- # - stats -
-
-
-
- -

-

The data that will show in the stats section

- - - - - - - - - - - - - - -
-
-
-
- # - show_stats -
-
-
-
- -

-

false will hide this section all together

- - - - - - - - - - - - - - -
-
-
-
- # - show_first_rocket -
-
-
-
- -

-

false will not show when the first rocket was launched

- - - - - - - - - - - - - - -
-
-
-
- # - show_last_rocket -
-
-
-
- -

-

false will not show when the last rocket was launched

- - - - - - - - - - - - - - -
-
-
-
- # - show_fastest_rocket -
-
-
-
- -

-

false will not show the time taken for the fastest rocket

- - - - - - - - - - - - - - -
-
-
-
- # - show_total_rockets -
-
-
-
- -

-

false will not show the total number of rockets launched

- - - - - - - - - - - - - - -
-
-
-
- # - show_game_avg -
-
-
-
- -

-

false will hide the avg across the entire map time

- - - - - - - - - - - - - - -
-
-
-
- # - rolling_avg -
-
-
-
- -

-

each number will be one statistic; 5 means the avg time taken for the last 5 rockets

- - - - - - - - - - - - - - -
-
-
-
- # - milestones -
-
-
-
- -

-

each number will be one statistic; 5 means the time that the 5th rocket was launched

- - - - - - - - - - - - - - -
-
-
-
- # - show_milestones -
-
-
-
- -

-

false will hide this section all together

- - - - - - - - - - - - - - -
-
-
-
- # - progress -
-
-
-
- -

-

The data and buttons in the build progress section

- - - - - - - - - - - - - - -
-
-
-
- # - show_progress -
-
-
-
- -

-

false will hide this section altogether

- - - - - - - - - - - - - - -
-
-
-
- # - allow_zoom_to_map -
-
-
-
- -

-

false will disable the zoom to map feature

- - - - - - - - - - - - - - -
-
-
-
- # - allow_remote_launch -
-
-
-
- -

-

false removes the remote launch button for all players

- - - - - - - - - - - - - - -
-
-
-
- # - remote_launch_admins_only -
-
-
-
- -

-

true will remove the remote launch button for all non (game) admins

- - - - - - - - - - - - - - -
-
-
-
- # - remote_launch_role_permission -
-
-
-
- -

-

value used by custom permission system to allow or disallow the button

- - - - - - - - - - - - - - -
-
-
-
- # - allow_toggle_active -
-
-
-
- -

-

false removes the remote toggle auto launch button for all players

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_active_admins_only -
-
-
-
- -

-

true will remove the toggle auto launch button for all non (game) admins

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_active_role_permission -
-
-
-
- -

-

value used by custom permission system to allow or disallow the button

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Roles.html b/docs/configs/Roles.html deleted file mode 100644 index 9f48ddab..00000000 --- a/docs/configs/Roles.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Roles config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Roles config

-

This is the main config file for the role system; file includes defines for roles and role flags and default values

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.roles
expcore.player_data
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Science.html b/docs/configs/Science.html deleted file mode 100644 index fa0502b5..00000000 --- a/docs/configs/Science.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - Science config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Science config

-

Config file for the science info gui

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - -
show_eta
color_cutoff
color_flux
- - -
- - -

Settings

-
-
-
-
- # - show_eta -
-
-
-
- -

-

when true the eta for research completion will be shown

- - - - - - - - - - - - - - -
-
-
-
- # - color_cutoff -
-
-
-
- -

-

the amount that production can fall before the text changes color

- - - - - - - - - - - - - - -
-
-
-
- # - color_flux -
-
-
-
- -

-

the amount of fluctuation allowed in production before the icon changes color

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Scorched-Earth.html b/docs/configs/Scorched-Earth.html deleted file mode 100644 index 16049ea8..00000000 --- a/docs/configs/Scorched-Earth.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - Scorched-Earth config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Scorched-Earth config

-

This file controls the placement/degrading of tiles as players build and walk

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - -
weakness_value
strengths
degrade_order
entities
- - -
- - -

Settings

-
-
-
-
- # - weakness_value -
-
-
-
- -

-

lower value will make tiles more likely to degrade

- - - - - - - - - - - - - - -
-
-
-
- # - strengths -
-
-
-
- -

-

this decides how "strong" a tile is, bigger number means less likely to degrade - debug: /interface require('modules.addons.worn-paths')(player.name,true) - note: tiles are effected by the tiles around them, so player paths will not degrade as fast when made wider - note: values are relative to the tile with the highest value, recommended to keep highest tile as a "nice" number - note: tiles not in list will never degrade under any conditions (which is why some are omitted such as water)

- - - - - - - - - - - - - - -
-
-
-
- # - degrade_order -
-
-
-
- -

-

when a tile degrades it will turn into the next tile given here

- - - - - - - - - - - - - - -
-
-
-
- # - entities -
-
-
-
- -

-

entities in this list will degrade the tiles under them when they are placed

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Spawn-Area.html b/docs/configs/Spawn-Area.html deleted file mode 100644 index bc61a676..00000000 --- a/docs/configs/Spawn-Area.html +++ /dev/null @@ -1,1235 +0,0 @@ - - - - - - - - Spawn-Area config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Spawn-Area config

-

Used to config the spawn generation settings yes there is alot here i know just ignore the long tables at the end (they were generated with a command)

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
spawn_area
deconstruction_radius
deconstruction_tile
pattern_radius
turrets
enabled
ammo_type
refill_time
offset
locations
afk_belts
enabled
belt_type
protected
offset
locations
water
enabled
water_tile
offset
locations
entities
enabled
protected
operable
offset
locations
enabled
pattern_tile
offset
locations
- - -
- - -

Settings

-
-
-
-
- # - spawn_area -
-
-
-
- -

-

Settings relating to the whole spawn area

- - - - - - - - - - - - - - -
-
-
-
- # - deconstruction_radius -
-
-
-
- -

-

All entities within this radius will be removed

- - - - - - - - - - - - - - -
-
-
-
- # - deconstruction_tile -
-
-
-
- -

-

Tile to be placed in the deconstruction radius, use nil for map gen

- - - - - - - - - - - - - - -
-
-
-
- # - pattern_radius -
-
-
-
- -

-

All water within this radius will be land filled

- - - - - - - - - - - - - - -
-
-
-
- # - turrets -
-
-
-
- -

-

Settings relating to adding turrets to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - enabled -
-
-
-
- -

-

Whether turrets will be added to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - ammo_type -
-
-
-
- -

-

The ammo type that will be used during refills

- - - - - - - - - - - - - - -
-
-
-
- # - refill_time -
-
-
-
- -

-

The time in ticks between each refill of the turrets, only change if having lag issues

- - - - - - - - - - - - - - -
-
-
-
- # - offset -
-
-
-
- -

-

The position offset to apply to turrets

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

The locations of all turrets, this list can change during runtime

- - - - - - - - - - - - - - -
-
-
-
- # - afk_belts -
-
-
-
- -

-

Settings relating to adding afk belts to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - enabled -
-
-
-
- -

-

Whether afk belts will be added to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - belt_type -
-
-
-
- -

-

The belt to be used as afk belts

- - - - - - - - - - - - - - -
-
-
-
- # - protected -
-
-
-
- -

-

Whether belts will be protected from player interaction

- - - - - - - - - - - - - - -
-
-
-
- # - offset -
-
-
-
- -

-

The position offset to apply to afk belts

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

The locations to spawn afk belts at, given as the top left position

- - - - - - - - - - - - - - -
-
-
-
- # - water -
-
-
-
- -

-

Settings relating to adding water to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - enabled -
-
-
-
- -

-

Whether water tiles will be added to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - water_tile -
-
-
-
- -

-

The tile to be used as the water tile

- - - - - - - - - - - - - - -
-
-
-
- # - offset -
-
-
-
- -

-

The position offset to apply to water tiles

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

The location of the water tiles {x,y} - Each is a 3x3 with the closest tile to 0,0 removed

- - - - - - - - - - - - - - -
-
-
-
- # - entities -
-
-
-
- -

-

Settings relating to adding entities to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - enabled -
-
-
-
- -

-

Whether entities will be added to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - protected -
-
-
-
- -

-

Whether entities will be protected from player interaction

- - - - - - - - - - - - - - -
-
-
-
- # - operable -
-
-
-
- -

-

Whether entities can be opened by players, must be true if chests are used

- - - - - - - - - - - - - - -
-
-
-
- # - offset -
-
-
-
- -

-

The position offset to apply to entities

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

The location and names of entities {name,x,y}

- - - - - - - - - - - - - - -
-
-
-
- # - enabled -
-
-
-
- -

-

Whether pattern tiles will be added to spawn

- - - - - - - - - - - - - - -
-
-
-
- # - pattern_tile -
-
-
-
- -

-

The tile to be used for the pattern

- - - - - - - - - - - - - - -
-
-
-
- # - offset -
-
-
-
- -

-

The position offset to apply to pattern tiles

- - - - - - - - - - - - - - -
-
-
-
- # - locations -
-
-
-
- -

-

The location of the pattern tiles {x,y}

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Statistics.html b/docs/configs/Statistics.html deleted file mode 100644 index 0a3ec1c7..00000000 --- a/docs/configs/Statistics.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - - - Statistics config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Statistics config

-

A list of all tracked statistics and the events which trigger them

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MapsPlayed
Playtime
AfkTime
DistanceTravelled
MachinesRemoved
OreMined
OreMined
DamageDealt
Kills
RocketsLaunched
ResearchCompleted
counters
display_order
- - -
- - -

Settings

-
-
-
-
- # - MapsPlayed -
-
-
-
- -

-

If the number of maps which a player has played should be tracked

- - - - - - - - - - - - - - -
-
-
-
- # - Playtime -
-
-
-
- -

-

If playtime is tracked for a player, play time measured in minutes

- - - - - - - - - - - - - - -
-
-
-
- # - AfkTime -
-
-
-
- -

-

If afk time is tracked for a player, play time measured in minutes, afk is once a player does nothing for 5 minutes

- - - - - - - - - - - - - - -
-
-
-
- # - DistanceTravelled -
-
-
-
- -

-

If distance Travelled is checked, only counts if not afk

- - - - - - - - - - - - - - -
-
-
-
- # - MachinesRemoved -
-
-
-
- -

-

If removed machines are tracked, includes marked for decon and player mined entity

- - - - - - - - - - - - - - -
-
-
-
- # - OreMined -
-
-
-
- -

-

If ore mined is tracked for a player, includes marked for decon and player mined entity but only trees

- - - - - - - - - - - - - - -
-
-
-
- # - OreMined -
-
-
-
- -

-

If ore mined is tracked for a player, includes player mined entity but only ore

- - - - - - - - - - - - - - -
-
-
-
- # - DamageDealt -
-
-
-
- -

-

If damage dealt is tracked for a player, includes any damage to entities not on the same force or neutral

- - - - - - - - - - - - - - -
-
-
-
- # - Kills -
-
-
-
- -

-

If kills are tracked for a player, includes all kills not on same force or neutral

- - - - - - - - - - - - - - -
-
-
-
- # - RocketsLaunched -
-
-
-
- -

-

If the number of rockets launched should be tracked, done for all players on the force

- - - - - - - - - - - - - - -
-
-
-
- # - ResearchCompleted -
-
-
-
- -

-

If the number of researches completed should be tracked, done for all players on the force

- - - - - - - - - - - - - - -
-
-
-
- # - counters -
-
-
-
- -

-

Simple statistics that just go up by one each time an event happens

- - - - - - - - - - - - - - -
-
-
-
- # - display_order -
-
-
-
- -

-

The order that the statistics should be shown in when in a gui or command

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Tasks.html b/docs/configs/Tasks.html deleted file mode 100644 index 1ba3f956..00000000 --- a/docs/configs/Tasks.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - Tasks config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Tasks config

-

Config file for the tasks gui

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - -
allow_add_task
expcore_roles_allow_add_task
allow_edit_task
expcore_roles_allow_edit_task
- - -
- - -

Settings

-
-
-
-
- # - allow_add_task -
-
-
-
- -

-

dictates who is allowed to add new tasks; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_allow_add_task -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
-
-
- # - allow_edit_task -
-
-
-
- -

-

dictates who is allowed to edit existing tasks; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_allow_edit_task -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Warnings.html b/docs/configs/Warnings.html deleted file mode 100644 index be5c9247..00000000 --- a/docs/configs/Warnings.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - - Warnings config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warnings config

-

Config file for the warning system, this is very similar to reports but is for the use of moderators rather than normal users.

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - -
actions
script_warning_cool_down
script_warning_limit
- - -
- - -

Settings

-
-
-
-
- # - actions -
-
-
-
- -

-

what actions are taking at number of warnings - if a localized string is used then __1__ will by_player_name and __2__ will be the current warning count (auto inserted)

- - - - - - - - - - - - - - -
-
-
-
- # - script_warning_cool_down -
-
-
-
- -

-

time for a script warning (given by script) to be removed (in minutes)

- - - - - - - - - - - - - - -
-
-
-
- # - script_warning_limit -
-
-
-
- -

-

the number of script warnings (given by script) that are allowed before full warnings are given

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/Warps.html b/docs/configs/Warps.html deleted file mode 100644 index 364702b8..00000000 --- a/docs/configs/Warps.html +++ /dev/null @@ -1,784 +0,0 @@ - - - - - - - - Warps config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warps config

-

This file contains all the different settings for the warp system and gui

-

- - - - - - - - - - - - - -

Settings

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
update_smoothing
minimum_distance
default_icon
bypass_warp_cooldown
expcore_roles_bypass_warp_cooldown
cooldown_duration
bypass_warp_proximity
expcore_roles_bypass_warp_proximity
standard_proximity_radius
spawn_proximity_radius
allow_add_warp
expcore_roles_allow_add_warp
allow_edit_warp
expcore_roles_allow_edit_warp
entities
tiles
- - -
- - -

Settings

-
-
-
-
- # - update_smoothing -
-
-
-
- -

-

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

- - - - - - - - - - - - - - -
-
-
-
- # - minimum_distance -
-
-
-
- -

-

the minimum distance that is allowed between warps on the same force

- - - - - - - - - - - - - - -
-
-
-
- # - default_icon -
-
-
-
- -

-

the default icon that will be used for warps

- - - - - - - - - - - - - - -
-
-
-
- # - bypass_warp_cooldown -
-
-
-
- -

-

dictates who the warp cooldown is applied to; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_bypass_warp_cooldown -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
-
-
- # - cooldown_duration -
-
-
-
- -

-

the duration of the warp cooldown in seconds

- - - - - - - - - - - - - - -
-
-
-
- # - bypass_warp_proximity -
-
-
-
- -

-

dictates who the warp proximity is applied to; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_bypass_warp_proximity -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
-
-
- # - standard_proximity_radius -
-
-
-
- -

-

the minimum distance a player is allowed to be to a warp in order to use it

- - - - - - - - - - - - - - -
-
-
-
- # - spawn_proximity_radius -
-
-
-
- -

-

the minimum distance a player is allowed to be from they spawn point to use warps

- - - - - - - - - - - - - - -
-
-
-
- # - allow_add_warp -
-
-
-
- -

-

dictates who is allowed to add warps; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_allow_add_warp -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
-
-
- # - allow_edit_warp -
-
-
-
- -

-

dictates who is allowed to edit warps; values: all, admin, expcore.roles, none

- - - - - - - - - - - - - - -
-
-
-
- # - expcore_roles_allow_edit_warp -
-
-
-
- -

-

if expcore.roles is used then this is the required permission

- - - - - - - - - - - - - - -
-
-
-
- # - entities -
-
-
-
- -

-

The entities which are created for warp areas

- - - - - - - - - - - - - - -
-
-
-
- # - tiles -
-
-
-
- -

-

The tiles which are created for warp areas

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/configs/inventory_clear.html b/docs/configs/inventory_clear.html deleted file mode 100644 index 4b911591..00000000 --- a/docs/configs/inventory_clear.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - inventory_clear config - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

inventory_clear config

-

Config to control when players items are removed, this is a list of event names that will trigger inventory clear

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/control/Jail.html b/docs/control/Jail.html deleted file mode 100644 index 5aecbd76..00000000 --- a/docs/control/Jail.html +++ /dev/null @@ -1,815 +0,0 @@ - - - - - - - - Jail control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Jail control

-

Control Module - Jail - - Adds a way to jail players.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Jail = require 'modules.control.jail' --- @dep modules.control.jail
-
-    -- This will move 'MrBiter' to the jail role and remove all other roles from them
-    -- the player name and reason are only so they can be included in the event for user feedback
-    Jail.jail_player('MrBiter', 'Cooldude2606', 'Likes biters too much')
-
-    -- This will give 'MrBiter' all his roles back and remove him from jail
-    -- again as above the player name is only used in the event for user feedback
-    Jail.unjail_player('MrBiter', 'Cooldude2606')
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.roles
utils.game
utils.global
- - -

Events

- - - - - - - - - - - - -
on_player_jailedWhen a player is assigned to jail
on_player_unjailedWhen a player is unassigned from jail
- - -

Jail

- - - - - - - - - - - - - - - - -
is_jailed(player)Checks if the player is currently in jail
jail_player(player, by_player_name[, reason='Non given.'])Moves a player to jail and removes all other roles
unjail_player(player, by_player_name)Moves a player out of jail and restores all roles previously removed
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_player_jailed -
-
-
-
- -

When a player is assigned to jail

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was jailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who jailed the other player - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was jailed - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_player_unjailed -
-
-
-
- -

When a player is unassigned from jail

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was unjailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who unjailed the other player - -
  • - - -
- - - - - - - - - - - - - -
-
-

Jail

-
-
-
-
- # - is_jailed(player) -
-
-
-
- -

Checks if the player is currently in jail

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if they are in jail - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player is currently in jail -
  • -
- - - - - - - - - -
-
-
-
- # - jail_player(player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Moves a player to jail and removes all other roles

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player who will be jailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the jailing - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being jailed - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - wheather the user was jailed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - unjail_player(player, by_player_name) -
-
-
-
- -

Moves a player out of jail and restores all roles previously removed

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be unjailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that is doing the unjail - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player was unjailed successfully -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Production.html b/docs/control/Production.html deleted file mode 100644 index 8e9808bb..00000000 --- a/docs/control/Production.html +++ /dev/null @@ -1,1369 +0,0 @@ - - - - - - - - Production control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Production control

-

Control Module - Production - - Common functions used to track production of items

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Production = require 'modules.control.production' --- @dep modules.control.production
-
-    -- This will return the less precise index from the one given
-    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
-    -- the other precision work like wise
-    Production.precision_up(defines.flow_precision_index.one_second)
-
-    -- The get production function is used to get production, consumion and net
-    -- it may be used for any item and with any precision level, use total for total
-    Production.get_production(game.forces.player, 'iron-plate', defines.flow_precision_index.one_minute)
-
-    -- The fluctuations works by compearing recent production with the average over time
-    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
-    Production.get_fluctuations(game.forces.player, 'iron-plate', defines.flow_precision_index.one_minute)
-
-    -- ETA is calculated based on what function you use but all share a similar method
-    -- for production eta it will take current production average given by the precision
-    -- and work out how many ticks it will require to make the required amount (1000 by default)
-    Production.get_production_eta(game.forces.player, 'iron-plate', defines.flow_precision_index.one_minute, 250000)
-
-    -- Both get_color and format_number are helper functions to help format production stats
-    -- get_color will return green, orange, red, or grey based on the active_value
-    -- the passive_value is used when active_value is 0 and can only return orange, red, or grey
-    Production.get_color(clamp, active_value, passive_value)
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.color_presets
util
- - -

Precision

- - - - - - - - - - - - - - - - -
precision_up(precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
precision_down(precision)Gets the next greater precision index value, eg 1 minute -> 1 second
precision_ticks(precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
- - -

Statistics

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_production_total(force, item_name)Returns the production data for the whole game time
get_production(force, item_name, precision)Returns the production data for the given precision game time
get_fluctuations(force, item_name, precision)Returns the current fluctuation from the average
get_production_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
get_consumsion_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
get_net_eta(force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
- - -

Formating

- - - - - - - - - - - - -
get_color(cutoff, active_value, passive_value)Returns a color value based on the value that was given
format_number(value)Returns three parts used to format a number
- - -
- - -

Dependencies

-
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Precision

-
-
-
-
- # - precision_up(precision) -
-
-
-
- -

Gets the next lesser precision index value, eg 1 second -> 1 minute

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_down(precision) -
-
-
-
- -

Gets the next greater precision index value, eg 1 minute -> 1 second

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_ticks(precision) -
-
-
-
- -

Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (number) - the number of ticks in this time -
  • -
- - - - - - - - - -
-
-

Statistics

-
-
-
-
- # - get_production_total(force, item_name) -
-
-
-
- -

Returns the production data for the whole game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains total made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production(force, item_name, precision) -
-
-
-
- -

Returns the production data for the given precision game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_fluctuations(force, item_name, precision) -
-
-
-
- -

Returns the current fluctuation from the average

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production_eta(force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_consumsion_eta(force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be consumed - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to consume this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_net_eta(force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce but not consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made but not used - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce, but not use, this ammount of items -
  • -
- - - - - - - - - -
-
-

Formating

-
-
-
-
- # - get_color(cutoff, active_value, passive_value) -
-
-
-
- -

Returns a color value based on the value that was given

-

- - - Parameters: - -
    - - - - - -
  • - - cutoff - - : - - (number) - - value which separates the different colours - -
  • - - - - - -
  • - - active_value - - : - - (number) - - first value tested, tested against cutoff - -
  • - - - - - -
  • - - passive_value - - : - - (number) - - second value tested, tested against 0 when active is 0 - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains r,g,b keys -
  • -
- - - - - - - - - -
-
-
-
- # - format_number(value) -
-
-
-
- -

Returns three parts used to format a number

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (number) - - the value to format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the sign for the number -
  • -
  • - (string) - the surfix for any unit used -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Protection.html b/docs/control/Protection.html deleted file mode 100644 index f5321795..00000000 --- a/docs/control/Protection.html +++ /dev/null @@ -1,1041 +0,0 @@ - - - - - - - - Protection control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Protection control

-

Control Module - Protection - - Controls protected entities

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.global
utils.event
config.protection
expcore.roles
- - -

Events

- - - - - - - - - - - - -
on_player_mined_protectedWhen a player mines a protected entity
on_repeat_violationWhen a player repeatedly mines protected entities
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EntityProtection.add_entity(entity)Add an entity to the protected list
EntityProtection.remove_entity(entity)Remove an entity from the protected list
EntityProtection.get_entities(surface)Get all protected entities on a surface
EntityProtection.is_entity_protected(entity)Check if an entity is protected
EntityProtection.add_area(surface, area)Add an area to the protected list
EntityProtection.remove_area(surface, area)Remove an area from the protected list
EntityProtection.get_areas(surface)Get all protected areas on a surface
EntityProtection.is_position_protected(surface, position)Check if an entity is protected
- - -
- - -

Dependencies

-
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.protection -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_player_mined_protected -
-
-
-
- -

When a player mines a protected entity

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who got mined the entity - -
  • - - - - - -
  • - - entity - - : - - (LuaEntity) - - the entity which was mined - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_repeat_violation -
-
-
-
- -

When a player repeatedly mines protected entities

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who got mined the entities - -
  • - - - - - -
  • - - entity - - : - - (LuaEntity) - - the last entity which was mined - -
  • - - -
- - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - EntityProtection.add_entity(entity) -
-
-
-
- -

Add an entity to the protected list

-

- - - Parameters: - -
    - - - - - -
  • - - entity - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.remove_entity(entity) -
-
-
-
- -

Remove an entity from the protected list

-

- - - Parameters: - -
    - - - - - -
  • - - entity - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.get_entities(surface) -
-
-
-
- -

Get all protected entities on a surface

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.is_entity_protected(entity) -
-
-
-
- -

Check if an entity is protected

-

- - - Parameters: - -
    - - - - - -
  • - - entity - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.add_area(surface, area) -
-
-
-
- -

Add an area to the protected list

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - - - - -
  • - - - - - -
  • - - area - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.remove_area(surface, area) -
-
-
-
- -

Remove an area from the protected list

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - - - - -
  • - - - - - -
  • - - area - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.get_areas(surface) -
-
-
-
- -

Get all protected areas on a surface

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - EntityProtection.is_position_protected(surface, position) -
-
-
-
- -

Check if an entity is protected

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - - - - -
  • - - - - - -
  • - - position - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Reports.html b/docs/control/Reports.html deleted file mode 100644 index e4a26db9..00000000 --- a/docs/control/Reports.html +++ /dev/null @@ -1,1182 +0,0 @@ - - - - - - - - Reports control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Reports control

-

Control Module - Reports - - Adds a way to report players and store report messages.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Reports = require 'modules.control.reports' --- @dep modules.control.reports
-
-    -- This will place a report on "MrBiter" (must be a valid player) the report will have been made
-    -- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
-    -- seen by using Reports.get_report.
-    Reports.report_player('MrBiter', 'Cooldude2606', 'Liking biters too much') -- true
-
-    -- The other get methods can be used to get all the reports on a player or to test if a player is reported.
-    Reports.get_report('MrBiter', 'Cooldude2606') -- 'Liking biters too much'
-
-    -- This will remove the warning on 'MrBiter' (must be a valid player) which was made by 'Cooldude2606'.
-    Reports.remove_report('MrBiter', 'Cooldude2606') -- true
-
-    -- This will remove all the report that have been made against 'MrBiter'. Note that the remove event will
-    -- be triggered once per report issused.
-    Reports.remove_all('MrBiter') -- true
-
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.game
utils.global
- - -

Events

- - - - - - - - - - - - -
on_player_reportedWhen a player is reported
on_report_removedWhen a report is removed from a player
- - -

Getters

- - - - - - - - - - - - - - - - - - - - -
get_reports(player)Gets a list of all reports that a player has against them
get_report(player, by_player_name)Gets a single report against a player given the name of the player who made the report
is_reported(player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
count_reports(player[, custom_count])Counts the number of reports that a player has aganist them
- - -

Setters

- - - - - - - - - - - - - - - - -
report_player(player, by_player_name[, reason='Non given.'])Adds a report to a player, each player can only report another player once
remove_report(player, reported_by_name, removed_by_name)Removes a report from a player
remove_all(player, removed_by_name)Removes all reports from a player
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_player_reported -
-
-
-
- -

When a player is reported

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who got reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason given for the report - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_report_removed -
-
-
-
- -

When a report is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who has the report removed - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player who made the removed report - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who removed the report - -
  • - - - - - -
  • - - batch_count - - : - - (number) - - the number of reports removed in this batch, always one when not a batch - -
  • - - - - - -
  • - - batch - - : - - (number) - - the index of this event in a batch, always one when not a batch - -
  • - - -
- - - - - - - - - - - - - -
-
-

Getters

-
-
-
-
- # - get_reports(player) -
-
-
-
- -

Gets a list of all reports that a player has against them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a list of all reports, key is by player name, value is reason -
  • -
- - - - - - - - - -
-
-
-
- # - get_report(player, by_player_name) -
-
-
-
- -

Gets a single report against a player given the name of the player who made the report

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - -
- - - - - Returns: -
    -
  • - (string or nil) - string is the reason that the player was reported, if the player is not reported -
  • -
- - - - - - - - - -
-
-
-
- # - is_reported(player[, by_player_name]) -
-
-
-
- -

Checks if a player is reported, option to get if reported by a certain player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - when given will check if reported by this player - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - if the player has been reported -
  • -
- - - - - - - - - -
-
-
-
- # - count_reports(player[, custom_count]) -
-
-
-
- -

Counts the number of reports that a player has aganist them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the reports for - -
  • - - - - - -
  • - - custom_count - - : - - (function) - - when given this function will be used to count the reports - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of reports that the user has -
  • -
- - - - - - - - - -
-
-

Setters

-
-
-
-
- # - report_player(player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a report to a player, each player can only report another player once

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add the report to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that is making the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being reported - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was added successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_report(player, reported_by_name, removed_by_name) -
-
-
-
- -

Removes a report from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the report from - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player that made the report - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who removed the report - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was removed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_all(player, removed_by_name) -
-
-
-
- -

Removes all reports from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the reports from - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who removed the report - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the reports were removed successfully -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Rockets.html b/docs/control/Rockets.html deleted file mode 100644 index 57ad9dc5..00000000 --- a/docs/control/Rockets.html +++ /dev/null @@ -1,1024 +0,0 @@ - - - - - - - - Rockets control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Rockets control

-

Control Module - Rockets - - Stores rocket stats for each force.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Rockets = require 'modules.control.rockets' --- @dep modules.control.rockets
-
-    -- Some basic information is stored for each silo that has been built
-    -- the data includes: the tick it was built, the rockets launched from it and more
-    Rockets.get_silo_data(rocket_silo_entity)
-
-    -- Some information is also stored for each force
-    Rockets.get_stats('player')
-
-    -- You can get the rocket data for all silos for a force by using get_silos
-    Rockets.get_silos('player')
-
-    -- You can get the launch time for a rocket, meaning what game tick the 50th rocket was launched
-    Rockets.get_rocket_time('player', 50)
-
-    -- The rolling average will work out the time to launch one rocket based on the last X rockets
-    Rockets.get_rolling_average('player', 10)
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
utils.global
config.rockets
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_silo_data(silo)Gets the silo data for a given silo entity
get_silo_data_by_name(silo_name)Gets the silo data for a given silo entity
get_silo_entity(silo_name)Gets the silo entity from its silo name, reverse to get_silo_data
get_stats(force_name)Gets the rocket stats for a force
get_silos(force_name)Gets all the rocket silos that belong to a force
get_rocket_time(force_name, rocket_number)Gets the launch time of a given rocket, due to cleaning not all counts are valid
get_rocket_count(force_name)Gets the number of rockets that a force has launched
get_game_rocket_count()Gets the total number of rockets launched by all forces
get_rolling_average(force_name, count)Gets the rolling average time to launch a rocket
- - -

Fields

- - - - - - - - -
silo_data.launchedAdds this 1 to the launch count for this silo
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.rockets -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - get_silo_data(silo) -
-
-
-
- -

Gets the silo data for a given silo entity

-

- - - Parameters: - -
    - - - - - -
  • - - silo - - : - - (LuaEntity) - - the rocket silo entity - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the data table for this silo, contains rockets launch, silo status, and its force -
  • -
- - - - - - - - - -
-
-
-
- # - get_silo_data_by_name(silo_name) -
-
-
-
- -

Gets the silo data for a given silo entity

-

- - - Parameters: - -
    - - - - - -
  • - - silo_name - - : - - (string) - - the silo name that is stored in its data - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the data table for this silo, contains rockets launch, silo status, and its force -
  • -
- - - - - - - - - -
-
-
-
- # - get_silo_entity(silo_name) -
-
-
-
- -

Gets the silo entity from its silo name, reverse to get_silo_data

-

- - - Parameters: - -
    - - - - - -
  • - - silo_name - - : - - (string) - - the silo name that is stored in its data - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaEntity) - the rocket silo entity -
  • -
- - - - - - - - - -
-
-
-
- # - get_stats(force_name) -
-
-
-
- -

Gets the rocket stats for a force

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to get the stats for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the table of stats for the force -
  • -
- - - - - - - - - -
-
-
-
- # - get_silos(force_name) -
-
-
-
- -

Gets all the rocket silos that belong to a force

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to get the silos for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of silo data that all belong to this force -
  • -
- - - - - - - - - -
-
-
-
- # - get_rocket_time(force_name, rocket_number) -
-
-
-
- -

Gets the launch time of a given rocket, due to cleaning not all counts are valid

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to get the count for - -
  • - - - - - -
  • - - rocket_number - - : - - (number) - - the number of the rocket to get the launch time for - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the game tick that the rocket was lanuched on -
  • -
- - - - - - - - - -
-
-
-
- # - get_rocket_count(force_name) -
-
-
-
- -

Gets the number of rockets that a force has launched

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to get the count for - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of rockets that the force has launched -
  • -
- - - - - - - - - -
-
-
-
- # - get_game_rocket_count() -
-
-
-
- -

Gets the total number of rockets launched by all forces

-

- - - - - - Returns: -
    -
  • - (number) - the total number of rockets launched this game -
  • -
- - - - - - - - - -
-
-
-
- # - get_rolling_average(force_name, count) -
-
-
-
- -

Gets the rolling average time to launch a rocket

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to get the average for - -
  • - - - - - -
  • - - count - - : - - (number) - - the distance to get the rolling average over - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to launch one rocket -
  • -
- - - - - - - - - -
-
-

Fields

-
-
-
-
- # - silo_data.launched -
-
-
-
- -

Adds this 1 to the launch count for this silo

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Selection.html b/docs/control/Selection.html deleted file mode 100644 index 455ae478..00000000 --- a/docs/control/Selection.html +++ /dev/null @@ -1,931 +0,0 @@ - - - - - - - - Selection control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Selection control

-

Control Module - Selection - - Controls players who have a selection planner, mostly event handlers

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
utils.global
- - -

Events

- - - - - - - - - - - - -
on_player_selection_startWhen a player enters selection mode
on_player_selection_endWhen a player leaves selection mode
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
start(player, selection_name[, single_use=false])Let a player select an area by providing a selection planner
stop(player)Stop a player selection by removing the selection planner
get_arguments(player)Get the selection arguments for a player
is_selecting(player[, selection_name])Test if a player is selecting something
on_selection(selection_name, handler)Filter on_player_selected_area to this custom selection, appends the selection arguments
on_alt_selection(string, function)Filter on_player_alt_selected_area to this custom selection, appends the selection arguments
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_player_selection_start -
-
-
-
- -

When a player enters selection mode

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who entered selection mode - -
  • - - - - - -
  • - - selection - - : - - (string) - - the name of the selection being made - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_player_selection_end -
-
-
-
- -

When a player leaves selection mode

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who left selection mode - -
  • - - - - - -
  • - - selection - - : - - (string) - - the name of the selection which ended - -
  • - - -
- - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - start(player, selection_name[, single_use=false]) -
-
-
-
- -

Let a player select an area by providing a selection planner

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to place into selection mode - -
  • - - - - - -
  • - - selection_name - - : - - (string) - - The name of the selection to start, used with on_selection - -
  • - - - - - -
  • - - single_use - - : - - (boolean) - - When true the selection will stop after first use - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - stop(player) -
-
-
-
- -

Stop a player selection by removing the selection planner

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to exit out of selection mode - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - get_arguments(player) -
-
-
-
- -

Get the selection arguments for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to get the selection arguments for - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - is_selecting(player[, selection_name]) -
-
-
-
- -

Test if a player is selecting something

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to test - -
  • - - - - - -
  • - - selection_name - - : - - (string) - - If given will only return true if the selection is this selection - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_selection(selection_name, handler) -
-
-
-
- -

Filter on_player_selected_area to this custom selection, appends the selection arguments

-

- - - Parameters: - -
    - - - - - -
  • - - selection_name - - : - - (string) - - The name of the selection to listen for - -
  • - - - - - -
  • - - handler - - : - - (function) - - The event handler - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_alt_selection(string, function) -
-
-
-
- -

Filter on_player_alt_selected_area to this custom selection, appends the selection arguments

-

- - - Parameters: - -
    - - - - - -
  • - - string - - : - - - selection_name The name of the selection to listen for - -
  • - - - - - -
  • - - function - - : - - - handler The event handler - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Tasks.html b/docs/control/Tasks.html deleted file mode 100644 index 8c1c47ea..00000000 --- a/docs/control/Tasks.html +++ /dev/null @@ -1,1025 +0,0 @@ - - - - - - - - Tasks control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Tasks control

-

Control Module - Tasks -- Stores tasks for each force.

-

- - - - - - -

Usage

-
-- Making and then editing a new task
-local task_id = Tasks.add_task(game.player.force.name, nil, game.player.name)
-
-Tasks.update_task(task_id, 'We need more iron!', game.player.name)
- - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.datastore
utils.global
- - -

Getters

- - - - - - - - - - - - - - - - -
get_task(task_id)Gets the task information that is linked with this id
get_force_task_ids(force_name)Gets all the task ids that a force has
get_editing(task_id, player_name)Gets the editing state for a player
- - -

Setters

- - - - - - - - - - - - - - - - - - - - - - - - -
add_task(force_name[, player_name][, task_title][, task_body])Add a new task for a force, the task can be placed into a certain position for that force
remove_task(task_id)Removes a task and any data that is linked with it
update_task(task_id, player_name, task_title, task_body)Update the message and last edited information for a task
set_editing(task_id, player_name, state)Set the editing state for a player, can be used as a warning or to display a text field
on_update(handler)Adds an update handler for when a task is added, removed, or updated
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Getters

-
-
-
-
- # - get_task(task_id) -
-
-
-
- -

Gets the task information that is linked with this id

-

- - - Parameters: - -
    - - - - - -
  • - - task_id - - : - - (string) - - the uid of the task you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the task information -
  • -
- - - - - - - - Usage: -
-- Getting task information outside of on_update
-local task = Tasks.get_task(task_id)
- - -
-
-
-
- # - get_force_task_ids(force_name) -
-
-
-
- -

Gets all the task ids that a force has

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force that you want the task ids for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of all the task ids -
  • -
- - - - - - - - Usage: -
-- Getting the task ids for a force
-local task_ids = Tasks.get_force_task_ids(game.player.force.name)
- - -
-
-
-
- # - get_editing(task_id, player_name) -
-
-
-
- -

Gets the editing state for a player

-

- - - Parameters: - -
    - - - - - -
  • - - task_id - - : - - (string) - - the uid of the task you want to check - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player that you want to check - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - weather the player is currently editing this task -
  • -
- - - - - - - - Usage: -
-- Check if a player is editing a task or not
-local editing = Tasks.get_editing(task_id, game.player.name)
- - -
-
-

Setters

-
-
-
-
- # - add_task(force_name[, player_name][, task_title][, task_body]) -
-
-
-
- -

Add a new task for a force, the task can be placed into a certain position for that force

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to add the task for - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the player who added this task, will cause them to be listed under editing - - (optional) -
  • - - - - - -
  • - - task_title - - : - - (string) - - the task title, if not given default is used - - (optional) -
  • - - - - - -
  • - - task_body - - : - - (string) - - the task body, if not given default is used - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the uid of the task which was created -
  • -
- - - - - - - - Usage: -
-- Adding a new task for your force
-local task_id = Tasks.add_task(game.player.force.name, game.player.name, nil, nil)
- - -
-
-
-
- # - remove_task(task_id) -
-
-
-
- -

Removes a task and any data that is linked with it

-

- - - Parameters: - -
    - - - - - -
  • - - task_id - - : - - (string) - - the uid of the task which you want to remove - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Removing a task
-Tasks.remove_task(task_id)
- - -
-
-
-
- # - update_task(task_id, player_name, task_title, task_body) -
-
-
-
- -

Update the message and last edited information for a task

-

- - - Parameters: - -
    - - - - - -
  • - - task_id - - : - - (string) - - the uid of the task to update - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player who made the edit - -
  • - - - - - -
  • - - task_title - - : - - (string) - - the title of the task to update to - -
  • - - - - - -
  • - - task_body - - : - - (string) - - the body of the task to update to - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating the message for on a task
-Task.update_task(task_id, game.player.name, 'We need more iron!', 'Build more iron outposts.')
- - -
-
-
-
- # - set_editing(task_id, player_name, state) -
-
-
-
- -

Set the editing state for a player, can be used as a warning or to display a text field

-

- - - Parameters: - -
    - - - - - -
  • - - task_id - - : - - (string) - - the uid of the task that you want to effect - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player you want to set the state for - -
  • - - - - - -
  • - - state - - : - - (boolean) - - the new state to set editing to - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Setting your editing state to true
-Tasks.set_editing(task_id, game.player.name, true)
- - -
-
-
-
- # - on_update(handler) -
-
-
-
- -

Adds an update handler for when a task is added, removed, or updated

-

- - - Parameters: - -
    - - - - - -
  • - - handler - - : - - (function) - - the handler which is called when a task is updated - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a game print when a task is updated
-Tasks.on_update(function(task)
-    game.print(task.force_name..' now has the task: '..task.message)
-end)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Warnings.html b/docs/control/Warnings.html deleted file mode 100644 index d93dfcd5..00000000 --- a/docs/control/Warnings.html +++ /dev/null @@ -1,1565 +0,0 @@ - - - - - - - - Warnings control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warnings control

-

Control Module - Warnings - - Adds a way to give and remove warnings to players.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Warnings = require 'modules.control.warnings' --- @dep modules.control.warnings
-
-    -- This will add a warning to the player
-    Warnings.add_warning('MrBiter', 'Cooldude2606', 'Killed too many biters')
-
-    -- This will remove a warning from a player, second name is just who is doing the action
-    Warnings.remove_warning('MrBiter', 'Cooldude2606')
-
-    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
-    -- this is so it can be used for greifer protection without being too agressive
-    Warnings.add_script_warning('MrBiter', 'Killed too many biters')
-
-    -- Both normal and script warnings can also be cleared, this will remove all warnings
-    Warnings.clear_warnings('MrBiter', 'Cooldude2606')
- - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.event
utils.game
utils.global
config.warnings
expcore.player_data
- - -

Events

- - - - - - - - - - - - - - - - - - - - -
on_warning_addedWhen a warning is added to a player
on_warning_removedWhen a warning is removed from a player
on_script_warning_addedWhen a warning is added to a player, by the script
on_script_warning_removedWhen a warning is removed from a player, by the script
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_warnings(player)Gets an array of warnings that the player has, always returns a list even if empty
count_warnings(player)Gets the number of warnings that a player has on them
add_warning(player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
remove_warning(player, by_player_name)Removes a warning from a player, always removes the earliest warning, fifo
clear_warnings(player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
get_script_warnings(player)Gets an array of all the script warnings that a player has
count_script_warnings(player)Gets the number of script warnings that a player has on them
add_script_warning(player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
remove_script_warning(player)Removes a script warning from a player
clear_script_warnings(player)Removes all script warnings from a player, emits event for each warning removed
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_warning_added -
-
-
-
- -

When a warning is added to a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_warning_removed -
-
-
-
- -

When a warning is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_by_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who is removing the warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - - - - -
  • - - batch_count - - : - - (number) - - the number of warnings removed in this batch, always one when not a batch - -
  • - - - - - -
  • - - batch - - : - - (number) - - the index of this event in a batch, always one when not a batch - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_added -
-
-
-
- -

When a warning is added to a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_removed -
-
-
-
- -

When a warning is removed from a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - get_warnings(player) -
-
-
-
- -

Gets an array of warnings that the player has, always returns a list even if empty

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the warning for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of all the warnings on this player, contains tick, by_player_name and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_warnings(player) -
-
-
-
- -

Gets the number of warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the warnings for - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_warning(player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a warning to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_warning(player, by_player_name) -
-
-
-
- -

Removes a warning from a player, always removes the earliest warning, fifo

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a warning from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_warnings(player, by_player_name) -
-
-
-
- -

Removes all warnings from a player, will trigger remove event for each warning

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the warnings from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true when warnings were cleared succesfully -
  • -
- - - - - - - - - -
-
-
-
- # - get_script_warnings(player) -
-
-
-
- -

Gets an array of all the script warnings that a player has

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of all the script warnings a player has, contains tick and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_script_warnings(player) -
-
-
-
- -

Gets the number of script warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_script_warning(player[, reason='Non given.']) -
-
-
-
- -

Adds a script warning to a player, this may add a full warning if max script warnings is met

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a script warning to - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_script_warning(player) -
-
-
-
- -

Removes a script warning from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a script warning from - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_script_warnings(player) -
-
-
-
- -

Removes all script warnings from a player, emits event for each warning removed

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the script warnings from - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/control/Warps.html b/docs/control/Warps.html deleted file mode 100644 index de6029af..00000000 --- a/docs/control/Warps.html +++ /dev/null @@ -1,1547 +0,0 @@ - - - - - - - - Warps control - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warps control

-

Control Module - Warps -- Stores warps for each force.

-

- - - - - - -

Usage

-
-- Making a new spawn warp
-local player = game.player
-local force = player.force
-local spawn_id = Warps.add_warp(force.name, player.surface, player.position, player.name, 'Spawn')
-
-Warps.set_spawn_warp(spawn_id, force)
-Warps.make_warp_tag(spawn_id)
-
-- Making a new warp with a warp area
-local player = game.player
-local force = player.force
-local warp_id = Warps.add_warp(force.name, player.surface, player.position, player.name)
-
-Warps.make_warp_area(warp_id)
-Warps.make_warp_tag(warp_id)
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.datastore
utils.global
config.warps
- - -

Getters

- - - - - - - - - - - - - - - - - - - - -
get_warp(warp_id)Gets the warp information that is linked with this id
get_force_warp_ids(force_name)Gets all the warp ids that a force has
get_spawn_warp_id(force_name)Get the id of the spawn warp
get_editing(warp_id, player_name)Gets the editing state for a player
- - -

Setters

- - - - - - - - - - - - - - - - - - - - - - - - -
add_warp(force_name, surface, position[, player_name][, warp_name])Add a new warp for a force, the warp must have a surface and a position
remove_warp(warp_id)Removes a warp and any data linked to it
update_warp(warp_id[, new_name][, new_icon][, player_name='server'])Update the name and icon for a warp
set_editing(warp_id, player_name, state)Set the editing state for a player, can be used as a warning or to display a text field
on_update(handler)Adds an update handler for when a warp is added, removed, or updated
- - -

Map Integration

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
make_warp_tag(warp_id)Add or update the chat tag for this warp
remove_warp_tag(warp_id)Remove the chart tag for this warp
make_warp_area(warp_id)Add a warp area for the warp, purely cosmetic
remove_warp_area(warp_id)Remove the warp area for a warp
set_spawn_warp(warp_id, force)Set a warp to be the spawn point for a force, force must own this warp
teleport_player(warp_id, player)Teleport a player to a warp point
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.warps -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Getters

-
-
-
-
- # - get_warp(warp_id) -
-
-
-
- -

Gets the warp information that is linked with this id

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the warp information -
  • -
- - - - - - - - Usage: -
-- Getting warp information outside of on_update
-local warp = Warps.get_warp(warp_id)
- - -
-
-
-
- # - get_force_warp_ids(force_name) -
-
-
-
- -

Gets all the warp ids that a force has

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force that you want the warp ids for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of all the warp ids -
  • -
- - - - - - - - Usage: -
-- Getting the warp ids for a force
-local warp_ids = Warps.get_force_warp_ids(game.player.force.name)
- - -
-
-
-
- # - get_spawn_warp_id(force_name) -
-
-
-
- -

Get the id of the spawn warp

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force that you want to get the spawn warp for - -
  • - - -
- - - - - Returns: -
    -
  • - (string or nil) - the uid of the spawn warp for this force if there is one -
  • -
- - - - - - - - Usage: -
-- Getting the spawn warp id
-local spawn_id = Warps.get_spawn_warp_id(game.player.force.name)
- - -
-
-
-
- # - get_editing(warp_id, player_name) -
-
-
-
- -

Gets the editing state for a player

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp you want to check - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player that you want to check - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - weather the player is currently editing this warp -
  • -
- - - - - - - - Usage: -
-- Check if a player is editing a warp or not
-local editing = Warps.get_editing(warp_id, game.player.name)
- - -
-
-

Setters

-
-
-
-
- # - add_warp(force_name, surface, position[, player_name][, warp_name]) -
-
-
-
- -

Add a new warp for a force, the warp must have a surface and a position

-

- - - Parameters: - -
    - - - - - -
  • - - force_name - - : - - (string) - - the name of the force to add the warp for - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface that the warp will be on - -
  • - - - - - -
  • - - position - - : - - (Position) - - the position that the warp will be on - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player that is adding the warp - - (optional) -
  • - - - - - -
  • - - warp_name - - : - - (string) - - the name of the warp that is being added, if omited default is used - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the uid of the warp which was created -
  • -
- - - - - - - - Usage: -
-- Adding a new warp for your force at your position
-local player = game.player
-local warp_id = Warps.add_warp(player.force.name, player.surface, player.position, player.name)
- - -
-
-
-
- # - remove_warp(warp_id) -
-
-
-
- -

Removes a warp and any data linked to it

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp that you want to remove - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Removing a warp
-Warps.remove_warp(warp_id)
- - -
-
-
-
- # - update_warp(warp_id[, new_name][, new_icon][, player_name='server']) -
-
-
-
- -

Update the name and icon for a warp

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp that you want to update - -
  • - - - - - -
  • - - new_name - - : - - (string) - - the new name that you want the warp to have - - (optional) -
  • - - - - - -
  • - - new_icon - - : - - (string) - - the new icon that you want the warp to have - - (optional) -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player that made the edit - - (default: 'server') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Changing the name and icon for a warp
-Warps.update_warp(warp_id, 'My Warp', 'iron-plate', game.player.name)
- - -
-
-
-
- # - set_editing(warp_id, player_name, state) -
-
-
-
- -

Set the editing state for a player, can be used as a warning or to display a text field

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp that you want to effect - -
  • - - - - - -
  • - - player_name - - : - - (string) - - the name of the player you want to set the state for - -
  • - - - - - -
  • - - state - - : - - (boolean) - - the new state to set editing to - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Setting your editing state to true
-Warps.set_editing(warp_id, game.player.name, true)
- - -
-
-
-
- # - on_update(handler) -
-
-
-
- -

Adds an update handler for when a warp is added, removed, or updated

-

- - - Parameters: - -
    - - - - - -
  • - - handler - - : - - (function) - - the handler which is called when a warp is updated - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a game print when a warp is updated
-Warps.on_update(function(warp)
-    game.print(warp.force_name..' now has the warp: '..warp.name)
-end)
- - -
-
-

Map Integration

-
-
-
-
- # - make_warp_tag(warp_id) -
-
-
-
- -

Add or update the chat tag for this warp

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp you want the chart tag for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if a new tag was made, false if it was updated -
  • -
- - - - - - - - Usage: -
-- Adding a chart tag for a new warp
-local tag_added = Warps.make_warp_tag(warp_id)
- - -
-
-
-
- # - remove_warp_tag(warp_id) -
-
-
-
- -

Remove the chart tag for this warp

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid for the warp that you want to remove the chart tag from - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the tag was valid and was removed, false if the tag was invalid -
  • -
- - - - - - - - Usage: -
-- Removing the chart tag from a warp
-local removed = Warps.remove_warp_tag(warp_id)
- - -
-
-
-
- # - make_warp_area(warp_id) -
-
-
-
- -

Add a warp area for the warp, purely cosmetic

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp you want the area for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a warp area for a warp
-Warps.make_warp_area(warp_id)
- - -
-
-
-
- # - remove_warp_area(warp_id) -
-
-
-
- -

Remove the warp area for a warp

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp that you want to remove the area for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Remove the warp area for a warp
-Warps.remove_warp_area(warp_id)
- - -
-
-
-
- # - set_spawn_warp(warp_id, force) -
-
-
-
- -

Set a warp to be the spawn point for a force, force must own this warp

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp that you want to be the spawn for the force - -
  • - - - - - -
  • - - force - - : - - (LuaForce) - - the force that you want to set the spawn for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Set your forces spawn to a warp
-Warps.set_spawn_warp(warp_id, game.player.force)
- - -
-
-
-
- # - teleport_player(warp_id, player) -
-
-
-
- -

Teleport a player to a warp point

-

- - - Parameters: - -
    - - - - - -
  • - - warp_id - - : - - (string) - - the uid of the warp to send the player to - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to teleport to the warp - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Teleport yourself to a warp point
-Warps.teleport_player(warp_id, game.player)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Async.html b/docs/core/Async.html deleted file mode 100644 index 2d179a9a..00000000 --- a/docs/core/Async.html +++ /dev/null @@ -1,638 +0,0 @@ - - - - - - - - Async core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Async core

-

Core Module - Async -- An extention of task and token to allow a single require to register and run async functions.

-

- - - - - - -

Usage

-

--- To use Async you must register the allowed functions when the file is loaded, often this will just be giving access to
--- some functions within a module if you expect that at part may be blocked by in game permissions or a custom system you have made
--- you may also want to register functions that you want to have a time delay, such as waiting 2 seconds before printing a message
-
--- When player.admin is called (either command or gui element event) by a player who isnt admin then it will error
--- here we register the function to promote the player so that it will run async and outside the player scope
-local promote_player =
-Async.register(function(player)
-    player.admin = true
-end)
-
--- This will allow us to bypass the error by running one tick later outside of any player scope
-Async(promote_player, game.player)
-
--- Here we make an sync function that we want to have a delay, note the delay is not defined here
-local print_message =
-Async.register(function(player, message)
-    player.print(message)
-end)
-
--- We can then call the async function with a delay using the wait function
-Async.wait(60, print_message, game.player, 'One second has passed!')
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.task
utils.token
- - -

Functions

- - - - - - - - - - - - - - - - -
register(callback)Register a new async function, must called when the file is loaded
run(token[, ...])Runs an async function, you may supply any number of arguments as required by that function
wait(ticks, token[, ...])Runs an async function after the given number of ticks, you may supply any number of arguments as required by that function
- - -
- - -

Dependencies

-
-
-
-
- # - utils.task -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.token -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - register(callback) -
-
-
-
- -

Register a new async function, must called when the file is loaded

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - the function that can be called as an async function - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the uid of the async function which can be passed to Async.run and Async.wait -
  • -
- - - - - - - - Usage: -
-- Registering a function to set the admin state of a player
-local set_admin =
-Async.register(function(player, state)
-    if player.valid then
-        player.admin = state
-    end
-end)
-
-- Registering a function to print to a player
-local print_to_player =
-Async.register(function(player, message)
-    if player.valid then
-        player.print(message)
-    end
-end)
- - -
-
-
-
- # - run(token[, ...]) -
-
-
-
- -

Runs an async function, you may supply any number of arguments as required by that function

-

- - - Parameters: - -
    - - - - - -
  • - - token - - : - - (string) - - the token of the async function you want to run - -
  • - - - - - -
  • - - ... - - : - - (any) - - the other params that you want to pass to your function - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Make a player admin regardless of if you are admin
-Async.run(set_admin, player, true)
- - -
-
-
-
- # - wait(ticks, token[, ...]) -
-
-
-
- -

Runs an async function after the given number of ticks, you may supply any number of arguments as required by that function

-

- - - Parameters: - -
    - - - - - -
  • - - ticks - - : - - (number) - - the number of ticks that you want the function to run after - -
  • - - - - - -
  • - - token - - : - - (string) - - the token of the async function you want to run - -
  • - - - - - -
  • - - ... - - : - - (any) - - the other params that you want to pass to your function - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Print a message to a player after 5 seconds
-Async.wait(300, print_to_player, 'Hello, World!')
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Commands.html b/docs/core/Commands.html deleted file mode 100644 index ac17026f..00000000 --- a/docs/core/Commands.html +++ /dev/null @@ -1,2453 +0,0 @@ - - - - - - - - Commands core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Commands core

-

Core Module - Commands -- Factorio command making module that makes commands with better parse and more modularity

-

- - - - - - -

Usage

-
--- Full code example, see below for explanation
-Commands.new_command('repeat-name', 'Will repeat you name a number of times in chat.')
-:add_param('repeat-count', 'number-range-int', 1, 5) -- required int in range 1 to 5 inclusive
-:add_param('smiley', true, function(input, player, reject) -- optional boolean default false
-    if not input then return end
-    input = input:lower()
-    if input == 'true' or input == 'yes' then return true end
-    return false
-end)
-:set_defaults{ smiley = false }
-:set_flag('admin_only') -- command is admin only
-:add_alias('name', 'rname') -- allow alias: name and rname
-:register(function(player, repeat_count, smiley, raw)
-    game.print(player.name..' used a command with input: '..raw)
-
-    local msg = ') '..player.name
-    if smiley then
-        msg = ':'..msg
-    end
-
-    for 1 = 1, repeat_count do
-        Command.print(1..msg)
-    end
-end)
-
--- Example Command Explanation:
--- Making commands basics, the commands can be set up with any number of params and flags that you want,
--- you can add aliases for the commands and set default values for optional params and of course register your command callback.
--- In our example we will have a command that will repeat the users name in chat X amount of times and only allow admins to use it.
-
--- First we create the new command, note this will not register the command to the game this is done at the end.
--- We will call the command "repeat-name" and set the help message as follows:
-Commands.new_command('repeat-name', 'Will repeat you name a number of times in chat.')
-
--- Now for our first param, we have named it "repeat-count" and it will be a required value, between 1 and 5 inclusive:
--- By using "number-range-int" we are saying to use this parser to convert our input text, common ones exist in config.expcore.command_general_parse
-:add_param('repeat-count', 'number-range-int', 1, 5)
-
--- Our second param needs a custom parser, meaning it isnt defined with add_parser, this is an option for when it is unlikely for
--- any other command to use the same input type. In the example it is a boolean type and we are just showing it here as part of the example.
--- As for the param its self it will be called "smiley" and will be optional with a default value of false:
-:add_param('smiley', true, function(input, player, reject)
-    -- Since it is optional the input can be nil, in which case we just return
-    if not input then return end
-    -- If it is not nil then we check for a truthy value
-    if input == 'true' or input == 'yes' then return true end
-    -- Note that because we did not return nil or reject then false will be passed to command callback, see example parse
-    return false
-end)
-
--- Once all params are defined you can add some default values for your optional params, the default value will be used only
--- when no value is given as input, if an invalid value is given then the command will fail and the default will not be used, the
--- default can also be a function which is passed the player as an argument and should return a value to be the default.
--- Here we set the default for "smiley" to false:
-:set_defaults{smiley=false}
-
--- Another example of defaults if we have: item, amount[opt], player[opt]
-:set_defaults{
-    amount = 50, -- More than one value can be set at a time
-    player = function(player) return player end -- Default is the player using the command
-}
-
--- Now the params are set up we can alter how the command works, we can set auth flags, add aliases, or enable "auto concat":
-:set_flag('admin_only') -- In our case we want "admin_only" to be set to true so only admins can use the command
-:add_alias('name', 'rname') -- We also add two aliases here: "name" and "rname" which point to this command
--- :enable_auto_concat() -- We do not use this in our case but this can also be used to enable the "auto concat" feature
-
--- And finally we want to register a callback to this command, the callback is what defines what the command does, can be as complex as you
--- want it to be, or as simple as our example; the command receives two params plus all param you have defined:
--- 1) the player who used the command
--- 2) in our case repeat_count which will be a number
--- 3) in our case smiley which will be a boolean
--- 4) the raw input; this param is always last as is always present as a catch all
-:register(function(player, repeat_count, smiley, raw)
-    -- This is to show the value for raw as this is an example command, the log file will also show this
-    game.print(player.name..' used a command with input: '..raw)
-    local msg = ') '..player.name
-
-    if smiley then
-        msg = ':'..msg
-    end
-
-    for 1 = 1, repeat_count do
-        -- this print function will return ANY value to the user in a desync safe manor, this includes if the command was used through rcon
-        Command.print(1..msg)
-    end
-    -- See below for what can be used here
-end)
-
--- Values that can be returned from register callback
-Commands.print(any, colour[opt]) -- This will return any value value to the user including if it is ran through rcon console
-Commands.error(message[opt]) -- This returns a warning to the user, aka an error that does not prevent execution of the command
-return Commands.error(message[opt]) -- This returns an error to the user, and will halt the command execution, ie no success message is returned
-Commands.success(message[opt]) -- Used to return a success message however don't use this method, see below
-return Commands.success(message[opt]) -- Will return the success message to the user and your given message, halts execution
-return <any> -- If any value is returned then it will be returned to the player via a Commands.success call
-
-
--- Example Authenticator:
--- The command system is best used when you can control who uses commands;
--- to do this you need to define an authenticator which is ran every time a command is run;
--- in this example I will show a simple one that requires certain commands to require the user to be a game admin.
-
--- For our admin only example we will set a flag to true when we want it to be admin only;
--- when we define the command will will use :set_flag('admin_only');
--- then inside the authenticator we will test if the flag is present using: if flags.admin_only then
-
--- When the authenticator is called by the command handler it will be passed 4 arguments:
--- 1) player - the player who used the command
--- 2) command - the name of the command that is being used
--- 3) flags - the flags which have been set for this command, flags are set with :set_flag(name, value)
--- 4) reject - the reject function which is the preferred method to prevent execution of the command
-
--- No return is required to allow the command to execute but it is best practice to return true;
--- we do this in two cases in our authenticator:
--- 1) when the "admin_only" flag is not set, which we take assume that any one can use it
--- 2) when the "admin_only" flag is set, and the player is admin
-
--- When want to prevent execution of the command we must reject it, listed is how that can be done:
--- 1) return false -- this is the most basic rejection and should only be used while testing
--- 2) return reject -- returning the reject function is as a fail safe in case you forget to call it, same as returning false
--- 3) reject() -- this will block execution while allowing further code to be ran in your authenticator
--- 4) reject('This command is for admins only!') -- using reject as a function allows a error message to be returned
--- 5) return reject() -- using return on either case above is best practice as you should execute all your code before rejecting
-
--- Example Code:
-Commands.add_authenticator(function(player, command, flags, reject)
-    -- Check if the command is admin only
-    if flags.admin_only then
-        -- Return true if player is admin, or reject and return error message
-        return player.admin or reject('This command is for admins only!')
-    else
-        -- Return true if command was not admin only
-        return true
-    end
-end)
-
--- Example Parser:
--- Before you make a command it is important to understand the most powerful feature of this command handler;
--- when you define a command you are able to type the params and have then be parsed and validated before your command is executed;
--- This module should be paired with a general command parse but you may want to create your own.
-
--- For our example we will create a parse to accept only integer numbers in a given range:
--- 1) we will give it the name "number-range-int" this is the "type" that the input is expected to be
--- 2) when we define the type we will also define the min and max of the range so we can use the function more than once
-:add_param('repeat_count', 'number-range-int', 5, 10) -- "repeat_count" is a required "number-range-int" in a range 5 to 10 inclusive
-
--- The command parse will be passed 3 arguments plus any other which you define, in our case:
--- 1) input - the input that has been given by the user for this param, the role of this function is to transform this value
--- nb: the input is a string but can be nil if the param is marked as optional
--- 2) player - the player who is using the command, this is always present
--- 3) reject - the reject function to throw an error to the user, this is always present
--- 4) range_min - the range min, this is user defined and has the value given when the param is defined
--- 5) range_max - the range max, this is user defined and has the value given when the param is defined
-
--- When returning from the param parse you have a few options with how to do this:
--- 1) you return the new value for the param (any non nil value) this value is then passed to the command callback
--- 2) not returning will cause a generic invalid error and the command is rejected, not recommenced
--- 3) return reject -- this is just a failsafe in case the function is not called, same as no return
--- 4) return reject() -- will give a shorter error message as you pass a nil custom error
--- 5) return reject('Number entered is not in range: '..range_min..', '..range_max) -- returns a custom error to the user
--- nb: if you do not return reject after you call it then you will still be returning nil so there will be a duplicate error message
-
--- It should be noted that if you want to expand on an existing parse you can use Commands.parse(type, input, player, reject)
--- this function will either return a new value for the input or nil, if it is nil you should return nil to prevent duplicate
--- error messages to the user:
-input = Commands.parse('number-int', input, player, reject)
-if not input then return end -- nil check
-
--- Example Code:
-Commands.add_parse('number-range-int', function(input, player, reject, range_min, range_max)
-    local rtn = tonumber(input) and math.floor(tonumber(input)) or nil -- converts input to number
-    if not rtn or rtn < range_min or rtn > range_max then
-        -- the input is either not a number or is outside the range
-        return reject('Number entered is not in range: '..range_min..', '..range_max)
-    else
-        -- returns the input as a number value rather than a string, thus the param is now the correct type
-        return rtn
-    end
-end)
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.game
expcore.common
- - -

Tables

- - - - - - - - - - - - - - - - - - - - - - - - -
definesConstant values used by the command system
commandsAn array of all custom commands that are registered
authenticatorsAn array of all custom authenticators that are registered
parsersUsed to store default functions which are common parse function such as player or number in range
_prototypeThe command prototype which stores all command defining functions
- - -

Fields

- - - - - - - - - - - - -
authorization_failure_on_errorWhen true any authenticator error will result in authorization failure, more secure
printReturns a value to the player, different to success as this does not signal the end of your command
- - -

Authentication

- - - - - - - - - - - - - - - - -
add_authenticator(authenticator)Adds an authorization function, function used to check if a player if allowed to use a command
remove_authenticator(authenticator)Removes an authorization function, can use the index or the function value
authorize(player, command_name)Mostly used internally, calls all authenticators, returns if the player is authorized
- - -

Parse

- - - - - - - - - - - - - - - - -
add_parse(name, parser)Adds a parse function which can be called by name (used in add_param) -nb: this is not required as you can use the callback directly this just allows it to be called by name
remove_parse(name)Removes a parse function, see add_parse for adding them, cant be done during runtime
parse(name, input, player, reject)Intended to be used within other parse functions, runs a parse and returns success and new value
- - -

Getters

- - - - - - - - - - - - -
get([player])Gets all commands that a player is allowed to use, game commands are not included
search(keyword[, player])Searches command names and help messages to find possible commands, game commands are included
- - -

Creation

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
new_command(name, help)Creates a new command object to added details to, this does not register the command to the game api
Commands._prototype:add_param(name[, optional=false][, parse][, ...])Adds a new param to the command this will be displayed in the help and used to parse the input
Commands._prototype:set_defaults(defaults)Add default values to params, only as an effect if the param is optional, if default value is a function it is called with the acting player
Commands._prototype:set_flag(name[, value=true])Adds a flag to the command which is passed via the flags param to the authenticators, can be used to assign command roles or usage type
Commands._prototype:add_alias(...)Adds an alias, or multiple, that will be registered to this command, eg /teleport can be used as /tp
Commands._prototype:enable_auto_concat()Enables auto concatenation for this command, all params after the last are added to the last param, useful for reasons or other long text input -nb: this will disable max param checking as they will be concatenated onto the end of that last param
Commands._prototype:register(callback)Adds the callback to the command and registers: aliases, params and help message with the base game api -nb: this must be the last function ran on the command and must be done for the command to work
- - -

Status

- - - - - - - - - - - - - - - - - - - - - - - - -
success([value])Sends a value to the player, followed by a command complete message, returning a value will trigger this automatically
print(value, colour)Sends a value to the player, different to success as this does not signal the end of your command
error([error_message=''][, play_sound=utility/wire_pickup])Sends an error message to the player and when returned will stop execution of the command -nb: this is for non fatal errors meaning there is no log of this event, use during register callback
internal_error(success, command_name, error_message)Sends an error to the player and logs the error, used internally please avoid direct use -nb: use error(error_message) within your callback to trigger do not trigger directly as code execution may still continue
run_command(command_event)Main event function that is ran for all commands, used internally please avoid direct use
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Tables

-
-
-
-
- # - defines -
-
-
-
- -

Constant values used by the command system

-

- - - Fields: - -
    - - - - - -
  • - - error - - - - - -
  • - - - - - -
  • - - unauthorized - - - - - -
  • - - - - - -
  • - - success - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - commands -
-
-
-
- -

An array of all custom commands that are registered

-

- - - - - - - - - - - - - - -
-
-
-
- # - authenticators -
-
-
-
- -

An array of all custom authenticators that are registered

-

- - - - - - - - - - - - - - -
-
-
-
- # - parsers -
-
-
-
- -

Used to store default functions which are common parse function such as player or number in range

-

- - - - - - - - - - - - - - -
-
-
-
- # - _prototype -
-
-
-
- -

The command prototype which stores all command defining functions

-

- - - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - authorization_failure_on_error -
-
-
-
- -

When true any authenticator error will result in authorization failure, more secure

-

- - - - - - - - - - - - - - -
-
-
-
- # - print -
-
-
-
- -

Returns a value to the player, different to success as this does not signal the end of your command

-

- - - - - - - - - - - - - - -
-
-

Authentication

-
-
-
-
- # - add_authenticator(authenticator) -
-
-
-
- -

Adds an authorization function, function used to check if a player if allowed to use a command

-

- - - Parameters: - -
    - - - - - -
  • - - authenticator - - : - - (function) - - The function you want to register as an authenticator - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - The index it was inserted at, used to remove the authenticator -
  • -
- - - - - - - - Usage: -
-- If the admin_only flag is set, then make sure the player is an admin
-local admin_authenticator =
-Commands.add_authenticator(function(player, command, flags, reject)
-    if flags.admin_only and not player.admin then
-        return reject('This command is for admins only!')
-    else
-        return true
-    end
-end)
- - -
-
-
-
- # - remove_authenticator(authenticator) -
-
-
-
- -

Removes an authorization function, can use the index or the function value

-

- - - Parameters: - -
    - - - - - -
  • - - authenticator - - : - - (function or number) - - The authenticator to remove, either the index return from add_authenticator or the function used - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - If the authenticator was found and removed successfully -
  • -
- - - - - - - - Usage: -
-- Removing the admin authenticator, can not be done during runtime
-Commands.remove_authenticator(admin_authenticator)
- - -
-
-
-
- # - authorize(player, command_name) -
-
-
-
- -

Mostly used internally, calls all authenticators, returns if the player is authorized

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player who is using the command, passed to authenticators - -
  • - - - - - -
  • - - command_name - - : - - (string) - - The name of the command being used, passed to authenticators - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true Player is authorized -
  • -
  • - (string) - commands Define value for success -
  • -
-
Or
-
    -
  • - (boolean) - false Player is unauthorized -
  • -
  • - (string or locale_string) - The reason given by the failed authenticator -
  • -
- - - - - - - - Usage: -
-- Test if a player can use "repeat-name"
-local authorized, status = Commands.authorize(game.player, 'repeat-name')
- - -
-
-

Parse

-
-
-
-
- # - add_parse(name, parser) -
-
-
-
- -

Adds a parse function which can be called by name (used in add_param) -nb: this is not required as you can use the callback directly this just allows it to be called by name

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the parse, should describe a type of input such as number or player, must be unique - -
  • - - - - - -
  • - - parser - - : - - (function) - - The function that is ran to parse the input string - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - Was the parse added, will be false if the name is already used -
  • -
- - - - - - - - Usage: -
-- Adding a parse to validate integers in a given range
-Commands.add_parse('number-range-int', function(input, player, reject, range_min, range_max)
-    local rtn = tonumber(input) and math.floor(tonumber(input)) or nil -- converts input to number
-    if not rtn or rtn < range_min or rtn > range_max then
-        -- The input is either not a number or is outside the range
-        return reject('Number entered is not in range: '..range_min..', '..range_max)
-    else
-        -- Returns the input as a number rather than a string, thus the param is now the correct type
-        return rtn
-    end
-end)
- - -
-
-
-
- # - remove_parse(name) -
-
-
-
- -

Removes a parse function, see add_parse for adding them, cant be done during runtime

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the parse to remove - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Removing a parse
-Commands.remove_parse('number-range-int')
- - -
-
-
-
- # - parse(name, input, player, reject) -
-
-
-
- -

Intended to be used within other parse functions, runs a parse and returns success and new value

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the parse to call, must be a registered parser - -
  • - - - - - -
  • - - input - - : - - (string) - - The input to pass to the parse, must be a string but not necessarily the original input - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player that is using the command, pass directly from your arguments - -
  • - - - - - -
  • - - reject - - : - - (function) - - The reject function, pass directly from your arguments - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - The new value for the input, if nil is return then either there was an error or the input was nil -
  • -
- - - - - - - - Usage: -
-- Parsing an int after first checking it is a number
-Commands.add_parse('number', function(input, player, reject)
-    local number = tonumber(input)
-    if number then return number end
-    return reject('Input must be a number value')
-end)
-
-Commands.add_parse('number-int', function(input, player, reject)
-    local number = Commands.parse('number', input, player, reject)
-    if not number then return end
-    return math.floor(number)
-end)
- - -
-
-

Getters

-
-
-
-
- # - get([player]) -
-
-
-
- -

Gets all commands that a player is allowed to use, game commands are not included

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player that you want to get commands of, nil will return all commands - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - All commands that that player is allowed to use, or all commands -
  • -
- - - - - - - - Usage: -
-- Get the commands you are allowed to use
-local commands = Commands.get(game.player)
-
-- Get all commands that are registered
-local commands = Commands.get()
- - -
-
-
-
- # - search(keyword[, player]) -
-
-
-
- -

Searches command names and help messages to find possible commands, game commands are included

-

- - - Parameters: - -
    - - - - - -
  • - - keyword - - : - - (string) - - The word which you are trying to find in your search - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player to get allowed commands of, if nil all commands are searched - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - All commands that contain the key word, and allowed by the player if a player was given -
  • -
- - - - - - - - Usage: -
-- Get all commands which "repeat"
-local commands = Commands.search('repeat')
-
-- Get all commands which "repeat" and you are allowed to use
-local commands = Commands.search('repeat', game.player)
- - -
-
-

Creation

-
-
-
-
- # - new_command(name, help) -
-
-
-
- -

Creates a new command object to added details to, this does not register the command to the game api

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the command to be created - -
  • - - - - - -
  • - - help - - : - - (string) - - The help message for the command - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - This will be used with other functions to define the new command -
  • -
- - - - - - - - Usage: -
-- Define a new command
-Commands.new_command('repeat-name', 'Will repeat you name a number of times in chat.')
- - -
-
-
-
- # - Commands._prototype:add_param(name[, optional=false][, parse][, ...]) -
-
-
-
- -

Adds a new param to the command this will be displayed in the help and used to parse the input

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the new param that is being added to the command - -
  • - - - - - -
  • - - optional - - : - - (boolean) - - Is this param optional, these must be added after all required params - - (default: false) -
  • - - - - - -
  • - - parse - - : - - (string or function) - - This function will take the input and return a new value, if not given no parse is done - - (optional) -
  • - - - - - -
  • - - ... - - : - - (any) - - Extra args you want to pass to the parse function; for example if the parse is general use - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - Pass through to allow more functions to be called -
  • -
- - - - - - - - Usage: -
-- Adding a required param which has a parser pre-defined
-command:add_param('repeat-count', 'number-range-int', 1, 5)
-
-- Adding an optional param which has a custom parse, see Commands.add_parse for details
-command:add_param('smiley', true, function(input, player, reject)
-    if not input then return end
-    return input:lower() == 'true' or input:lower() == 'yes' or false
-end)
- - -
-
-
-
- # - Commands._prototype:set_defaults(defaults) -
-
-
-
- -

Add default values to params, only as an effect if the param is optional, if default value is a function it is called with the acting player

-

- - - Parameters: - -
    - - - - - -
  • - - defaults - - : - - (table) - - A table which is keyed by the name of the param and the value is the default value for that param - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - Pass through to allow more functions to be called -
  • -
- - - - - - - - Usage: -
-- Adding default values
-command:set_defaults{
-    smiley = false,
-    -- not in example just used to show arguments given
-    player_name = function(player)
-        return player.name
-    end
-}
- - -
-
-
-
- # - Commands._prototype:set_flag(name[, value=true]) -
-
-
-
- -

Adds a flag to the command which is passed via the flags param to the authenticators, can be used to assign command roles or usage type

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - The name of the flag to be added, set to true if no value is given - -
  • - - - - - -
  • - - value - - : - - (any) - - The value for the flag, can be anything that the authenticators are expecting - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - Pass through to allow more functions to be called -
  • -
- - - - - - - - Usage: -
-- Setting a custom flag
-command:set_flag('admin_only', true)
-
-- When value is true it does not need to be given
-command:set_flag('admin_only')
- - -
-
-
-
- # - Commands._prototype:add_alias(...) -
-
-
-
- -

Adds an alias, or multiple, that will be registered to this command, eg /teleport can be used as /tp

-

- - - Parameters: - -
    - - - - - -
  • - - ... - - : - - (string) - - Any amount of aliases that you want this command to be callable with - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - Pass through to allow more functions to be called -
  • -
- - - - - - - - Usage: -
-- Added multiple aliases to a command
-command:add_alias('name', 'rname')
- - -
-
-
-
- # - Commands._prototype:enable_auto_concat() -
-
-
-
- -

Enables auto concatenation for this command, all params after the last are added to the last param, useful for reasons or other long text input -nb: this will disable max param checking as they will be concatenated onto the end of that last param

-

- - - - - - Returns: -
    -
  • - (table) - Pass through to allow more functions to be called -
  • -
- - - - - - - - Usage: -
-- Enable auto concat for a command
-command:enable_auto_concat()
- - -
-
-
-
- # - Commands._prototype:register(callback) -
-
-
-
- -

Adds the callback to the command and registers: aliases, params and help message with the base game api -nb: this must be the last function ran on the command and must be done for the command to work

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The callback for the command, will receive the player running command, and any params added with add_param - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Registering your command to the base game api
-command:register(function(player, repeat_count, smiley, raw)
-    local msg = ') '..player.name
-    if smiley then msg = ':'..msg end
-
-    for 1 = 1, repeat_count do
-        Command.print(1..msg)
-    end
-end)
- - -
-
-

Status

-
-
-
-
- # - success([value]) -
-
-
-
- -

Sends a value to the player, followed by a command complete message, returning a value will trigger this automatically

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - The value to return to the player, if nil then only the success message is returned - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (Commands.defines.success) - Return this to the command handler to prevent two success messages -
  • -
- - - - - - - - Usage: -
-- Print a custom success message
-return Commands.success('Your message has been printed')
-
-- Returning the value has the same result
-return 'Your message has been printed'
- - -
-
-
-
- # - print(value, colour) -
-
-
-
- -

Sends a value to the player, different to success as this does not signal the end of your command

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - The value that you want to return to the player - -
  • - - - - - -
  • - - colour - - : - - (table) - - The colour of the message that the player sees - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Output a message to the player
-Commands.print('Your command is in progress')
- - -
-
-
-
- # - error([error_message=''][, play_sound=utility/wire_pickup]) -
-
-
-
- -

Sends an error message to the player and when returned will stop execution of the command -nb: this is for non fatal errors meaning there is no log of this event, use during register callback

-

- - - Parameters: - -
    - - - - - -
  • - - error_message - - : - - (string) - - An optional error message that can be sent to the user - - (default: '') -
  • - - - - - -
  • - - play_sound - - : - - (string) - - The sound to play for the error - - (default: utility/wire_pickup) -
  • - - -
- - - - - Returns: -
    -
  • - (Commands.defines.error) - Return this to command handler to terminate execution -
  • -
- - - - - - - - Usage: -
-- Send an error message to the player, and stops further code running
-return Commands.error('The player you selected is offline')
- - -
-
-
-
- # - internal_error(success, command_name, error_message) -
-
-
-
- -

Sends an error to the player and logs the error, used internally please avoid direct use -nb: use error(error_message) within your callback to trigger do not trigger directly as code execution may still continue

-

- - - Parameters: - -
    - - - - - -
  • - - success - - : - - (boolean) - - The success value returned from pcall, or just false to trigger error - -
  • - - - - - -
  • - - command_name - - : - - (string) - - The name of the command this is used within the log - -
  • - - - - - -
  • - - error_message - - : - - (string) - - The error returned by pcall or some other error, this is logged and not returned to player - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - The opposite of success so true means to cancel execution, used internally -
  • -
- - - - - - - - Usage: -
-- Used in the command system to log handler errors
-local success, err = pcall(command_data.callback, player, unpack(params))
-if Commands.internal_error(success, command_data.name, err) then
-    return command_log(player, command_data, 'Internal Error: Command Callback Fail', raw_params, command_event.parameter, err)
-end
- - -
-
-
-
- # - run_command(command_event) -
-
-
-
- -

Main event function that is ran for all commands, used internally please avoid direct use

-

- - - Parameters: - -
    - - - - - -
  • - - command_event - - : - - (table) - - Passed directly from the add_command function - -
  • - - -
- - - - - - - - - - - - Usage: -
Commands.run_command(event)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Common-Library.html b/docs/core/Common-Library.html deleted file mode 100644 index 8b86b626..00000000 --- a/docs/core/Common-Library.html +++ /dev/null @@ -1,2828 +0,0 @@ - - - - - - - - Common-Library core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Common-Library core

-

Core Module - Common Library - - Adds some commonly used functions used in many modules

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.color_presets
utils.game
util
- - -

Type Checking

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
type_check(value[, test_type=nil])Asserts the argument is of type test_type
type_error(value, test_type, error_message, level)Raises an error if the value is of the wrong type
multi_type_check(value, test_types)Asserts the argument is one of type test_types
multi_type_error(value, test_types, error_message, level)Raises an error if the value is of the wrong type
validate_argument_type(value, test_type, param_name, param_number)Raises an error when the value is the incorrect type, uses a consistent error message format
validate_argument_multi_type(value, test_types, param_name, param_number)Raises an error when the value is the incorrect type, uses a consistent error message format
error_if_runtime()Will raise an error if called during runtime
error_if_runetime_closure(func)Will raise an error if the function is a closure
- - -

Value Returns

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string_contains(s, contains)Tests if a string contains a given substring.
resolve_value(value)Used to resolve a value that could also be a function returning that value
get_actor()Returns a valid string with the name of the actor of a command.
cast_bool(var)Converts a varible into its boolean value, nil and false return false
ternary(c, t, f)Returns either the second or third argument based on the first argument
comma_value(n)Returns a string for a number with comma seperators
set_and_return(tbl, key, value)Sets a table element to value while also returning value.
write_json(path, tbl)Writes a table object to a file in json format
opt_require(path)Calls a require that will not error if the file is not found
get_file_path([offset=0])Returns a desync safe file path for the current file
enum(tbl)Converts a table to an enum
auto_complete(options, input[, use_key=false][, rtn_key=false])Returns the closest match to the input
- - -

Formating

- - - - - - - - - - - - - - - - - - - - - - - - -
format_chat_colour(message, color)Returns a message with valid chat tags to change its colour
format_chat_colour_localized(message, color)Returns a message with valid chat tags to change its colour, using localization
format_chat_player_name(player[, raw_string=false])Returns the players name in the players color
player_return(value[, colour=defines.colour.white][, player=game.player])Will return a value of any type to the player/server console, allows colour for in-game players
format_time(ticks, options)Formats tick into a clean format, denominations from highest to lowest - long will use words rather than letters - time will use : separates - string will return a string not a locale string - when a denomination is false it will overflow into the next one
- - -

Factorio

- - - - - - - - - - - - - - - - - - - - -
move_items(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest])Moves items to the position and stores them in the closest entity of the type given
print_grid_value(value, surface, position, scale, offset, immutable)https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31 - Prints a colored value on a location.
print_colored_grid_value(value, surface, position, offset, immutable, color_value, base_color, delta_color, under_bound, over_bound)Prints a colored value on a location.
clear_flying_text(surface)Clears all flying text entities on a surface
- - -
- - -

Dependencies

-
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Type Checking

-
-
-
-
- # - type_check(value[, test_type=nil]) -
-
-
-
- -

Asserts the argument is of type test_type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value to be tested - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type to test for if not given then it tests for nil - - (default: nil) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - is v of type test_type -
  • -
- - - - - - - - Usage: -
type_check('foo','string') -- return true
-
type_check('foo') -- return false
- - -
-
-
-
- # - type_error(value, test_type, error_message, level) -
-
-
-
- -

Raises an error if the value is of the wrong type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - error_message - - : - - (string) - - the error message that is returned - -
  • - - - - - -
  • - - level - - : - - (number) - - the level to call the error on (level = 1 means the caller) - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was called -
  • -
- - - - - - - - Usage: -
type_error('foo','number','Value must be a number') -- will raise error "Value must be a number"
- - -
-
-
-
- # - multi_type_check(value, test_types) -
-
-
-
- -

Asserts the argument is one of type test_types

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - the variable to check - -
  • - - - - - -
  • - - test_types - - : - - - the type as a table of strings - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if value is one of test_types -
  • -
- - - - - - - - - -
-
-
-
- # - multi_type_error(value, test_types, error_message, level) -
-
-
-
- -

Raises an error if the value is of the wrong type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_types - - : - - (table) - - the type as a table of strings - -
  • - - - - - -
  • - - error_message - - : - - (string) - - the error message that is returned - -
  • - - - - - -
  • - - level - - : - - (number) - - the level to call the error on (level = 1 means the caller) - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was called -
  • -
- - - - - - - - Usage: -
multi_type_error('foo',{'string','table'},'Value must be a string or table') -- will raise error "Value must be a string or table"
- - -
-
-
-
- # - validate_argument_type(value, test_type, param_name, param_number) -
-
-
-
- -

Raises an error when the value is the incorrect type, uses a consistent error message format

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - param_name - - : - - (string) - - the name of the param - -
  • - - - - - -
  • - - param_number - - : - - (number) - - the number param it is - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was raised -
  • -
- - - - - - - - Usage: -
validate_argument_type('foo','number','repeat_count',2) -- will raise error "Bad argument #02 to "<anon>"; "repeat_count" is of type string expected number"
- - -
-
-
-
- # - validate_argument_multi_type(value, test_types, param_name, param_number) -
-
-
-
- -

Raises an error when the value is the incorrect type, uses a consistent error message format

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_types - - : - - (string) - - the types that the value should be - -
  • - - - - - -
  • - - param_name - - : - - (string) - - the name of the param - -
  • - - - - - -
  • - - param_number - - : - - (number) - - the number param it is - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was raised -
  • -
- - - - - - - - Usage: -
validate_argument_type('foo',{'string','table'},'repeat_count',2) -- will raise error "Bad argument #02 to "<anon>"; "repeat_count" is of type string expected string or table"
- - -
-
-
-
- # - error_if_runtime() -
-
-
-
- -

Will raise an error if called during runtime

-

- - - - - - - - - - - - - Usage: -
error_if_runtime()
- - -
-
-
-
- # - error_if_runetime_closure(func) -
-
-
-
- -

Will raise an error if the function is a closure

-

- - - Parameters: - -
    - - - - - -
  • - - func - - - - - -
  • - - -
- - - - - - - - - - - - Usage: -
error_if_runetime_closure(func)
- - -
-
-

Value Returns

-
-
-
-
- # - string_contains(s, contains) -
-
-
-
- -

Tests if a string contains a given substring.

-

- - - Parameters: - -
    - - - - - -
  • - - s - - : - - (string) - - the string to check for the substring - -
  • - - - - - -
  • - - contains - - : - - (string) - - the substring to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the substring was found in the string -
  • -
- - - - - - - - - -
-
-
-
- # - resolve_value(value) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value which you want to test is not nil and if it is a function then call the function - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value given or returned by value if it is a function -
  • -
- - - - - - - - Usage: -
-- Default value handling
--- if default value is not a function then it is returned
--- if it is a function then it is called with the first argument being self
-local value = Common.resolve_value(self.defaut_value,self)
- - -
-
-
-
- # - get_actor() -
-
-
-
- -

Returns a valid string with the name of the actor of a command.

-

- - - - - - Returns: -
    -
  • - (string) - the name of the current actor -
  • -
- - - - - - - - - -
-
-
-
- # - cast_bool(var) -
-
-
-
- -

Converts a varible into its boolean value, nil and false return false

-

- - - Parameters: - -
    - - - - - -
  • - - var - - - - - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the boolean form of the varible -
  • -
- - - - - - - - - -
-
-
-
- # - ternary(c, t, f) -
-
-
-
- -

Returns either the second or third argument based on the first argument

-

- - - Parameters: - -
    - - - - - -
  • - - c - - - - - -
  • - - - - - -
  • - - t - - - - - -
  • - - - - - -
  • - - f - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - comma_value(n) -
-
-
-
- -

Returns a string for a number with comma seperators

-

- - - Parameters: - -
    - - - - - -
  • - - n - - : - - (credit http) - - //richard.warburton.it - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - set_and_return(tbl, key, value) -
-
-
-
- -

Sets a table element to value while also returning value.

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - - table to change the element of - -
  • - - - - - -
  • - - key - - : - - - string - -
  • - - - - - -
  • - - value - - : - - - nil|boolean|number|string|table to set the element to - -
  • - - -
- - - - - Returns: -
    -
  • - value -
  • -
- - - - - - - - - -
-
-
-
- # - write_json(path, tbl) -
-
-
-
- -

Writes a table object to a file in json format

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path of the file to write include / to use dir - -
  • - - - - - -
  • - - tbl - - : - - (table) - - the table that will be converted to a json string and wrote to file - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - opt_require(path) -
-
-
-
- -

Calls a require that will not error if the file is not found

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path that you want to require - -
  • - - -
- - - - - Returns: -
    -
  • - the returns from that file or nil, error if not loaded -
  • -
- - - - - - - - Usage: -
local file = opt_require('file.not.present') -- will not cause any error
- - -
-
-
-
- # - get_file_path([offset=0]) -
-
-
-
- -

Returns a desync safe file path for the current file

-

- - - Parameters: - -
    - - - - - -
  • - - offset - - : - - (number) - - the offset in the stack to get, 0 is current file - - (default: 0) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the file path -
  • -
- - - - - - - - - -
-
-
-
- # - enum(tbl) -
-
-
-
- -

Converts a table to an enum

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - table the that will be converted - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new table that acts like an enum -
  • -
- - - - - - - - - -
-
-
-
- # - auto_complete(options, input[, use_key=false][, rtn_key=false]) -
-
-
-
- -

Returns the closest match to the input

-

- - - Parameters: - -
    - - - - - -
  • - - options - - : - - (table) - - table a of options for the auto complete - -
  • - - - - - -
  • - - input - - : - - (string) - - string the input that will be completed - -
  • - - - - - -
  • - - use_key - - : - - (boolean) - - when true the keys of options will be used as the options - - (default: false) -
  • - - - - - -
  • - - rtn_key - - : - - (boolean) - - when true the the key will be returned rather than the value - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - the list item found that matches the input -
  • -
- - - - - - - - - -
-
-

Formating

-
-
-
-
- # - format_chat_colour(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r,g,b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the message with the color tags included -
  • -
- - - - - - - - - -
-
-
-
- # - format_chat_colour_localized(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour, using localization

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string or table) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r,g,b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the message with the color tags included -
  • -
- - - - - - - - - -
-
-
-
- # - format_chat_player_name(player[, raw_string=false]) -
-
-
-
- -

Returns the players name in the players color

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to use the name and color of - -
  • - - - - - -
  • - - raw_string - - : - - (boolean) - - when true a is returned rather than a localized string - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the players name with tags for the players color -
  • -
- - - - - - - - - -
-
-
-
- # - player_return(value[, colour=defines.colour.white][, player=game.player]) -
-
-
-
- -

Will return a value of any type to the player/server console, allows colour for in-game players

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - any value of any type that will be returned to the player or console - -
  • - - - - - -
  • - - colour - - : - - (defines.color or string) - - the colour of the text for the player, ignored when printing to console - - (default: defines.colour.white) -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that return will go to, if no game.player then returns to server - - (default: game.player) -
  • - - -
- - - - - - - - - - - - Usage: -
player_return('Hello, World!') -- returns 'Hello, World!' to game.player or server console
-
player_return('Hello, World!','green') -- returns 'Hello, World!' to game.player with colour green or server console
-
player_return('Hello, World!',nil,player) -- returns 'Hello, World!' to the given player
- - -
-
-
-
- # - format_time(ticks, options) -
-
-
-
- -

Formats tick into a clean format, denominations from highest to lowest - long will use words rather than letters - time will use : separates - string will return a string not a locale string - when a denomination is false it will overflow into the next one

-

- - - Parameters: - -
    - - - - - -
  • - - ticks - - : - - (number) - - the number of ticks that represents a time - -
  • - - - - - -
  • - - options - - : - - (table) - - table a of options to use for the format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - a locale string that can be used -
  • -
- - - - - - - - - -
-
-

Factorio

-
-
-
-
- # - move_items(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) -
-
-
-
- -

Moves items to the position and stores them in the closest entity of the type given

-

- - - Parameters: - -
    - - - - - -
  • - - items - - : - - (table) - - items which are to be added to the chests, ['name']=count - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface that the items will be moved to - - (default: navies) -
  • - - - - - -
  • - - position - - : - - (table) - - the position that the items will be moved to {x=100,y=100} - - (default: {0) -
  • - - - - - -
  • - - radius - - : - - (number) - - the radius in which the items are allowed to be placed - - (default: 32) -
  • - - - - - -
  • - - chest_type - - : - - (string) - - the chest type that the items should be moved into - - (default: iron-chest) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - print_grid_value(value, surface, position, scale, offset, immutable) -
-
-
-
- -

https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31 - Prints a colored value on a location.

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - between -1 and 1 - -
  • - - - - - -
  • - - surface - - : - - - LuaSurface - -
  • - - - - - -
  • - - position - - : - - - Position {x, y} - -
  • - - - - - -
  • - - scale - - : - - - float - -
  • - - - - - -
  • - - offset - - : - - - float - -
  • - - - - - -
  • - - immutable - - : - - - bool if immutable, only set, never do a surface lookup, values never change - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - print_colored_grid_value(value, surface, position, offset, immutable, color_value, base_color, delta_color, under_bound, over_bound) -
-
-
-
- -

Prints a colored value on a location.

-

When given a color_value and a delta_color, - will change the color of the text from the base to base + value * delta. This will - make the color of the text range from 'base_color' to 'base_color + delta_color' - as the color_value ranges from 0 to 1

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - of number to be displayed - -
  • - - - - - -
  • - - surface - - : - - - LuaSurface - -
  • - - - - - -
  • - - position - - : - - - Position {x, y} - -
  • - - - - - -
  • - - offset - - : - - - float position offset - -
  • - - - - - -
  • - - immutable - - : - - - bool if immutable, only set, never do a surface lookup, values never change - -
  • - - - - - -
  • - - color_value - - : - - - float How far along the range of values of colors the value is to be displayed - -
  • - - - - - -
  • - - base_color - - : - - - {r,g,b} The color for the text to be if color_value is 0 - -
  • - - - - - -
  • - - delta_color - - : - - - {r,g,b} The amount to correct the base_color if color_value is 1 - -
  • - - - - - -
  • - - under_bound - - : - - - {r,g,b} The color to be used if color_value < 0 - -
  • - - - - - -
  • - - over_bound - - : - - - {r,g,b} The color to be used if color_value > 1 - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - clear_flying_text(surface) -
-
-
-
- -

Clears all flying text entities on a surface

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface to clear - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Common.html b/docs/core/Common.html deleted file mode 100644 index afc62b6f..00000000 --- a/docs/core/Common.html +++ /dev/null @@ -1,2900 +0,0 @@ - - - - - - - - Common core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Common core

-

Core Module - Common -- Adds some commonly used functions used in many modules

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.color_presets
utils.game
- - -

Type Checking

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
type_check(value[, test_type=nil])Asserts the argument is of type test_type
type_error(value, test_type, error_message, level)Raises an error if the value is of the wrong type
multi_type_check(value, test_types)Asserts the argument is one of type test_types
multi_type_error(value, test_types, error_message, level)Raises an error if the value is of the wrong type
validate_argument_type(value, test_type, param_number[, param_name])Raises an error when the value is the incorrect type, uses a consistent error message format
validate_argument_multi_type(value, test_types, param_number[, param_name])Raises an error when the value is the incorrect type, uses a consistent error message format
error_if_runtime()Will raise an error if called during runtime
error_if_runetime_closure(func)Will raise an error if the function is a closure
- - -

Value Returns

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string_contains(s, contains)Tests if a string contains a given substring.
resolve_value(value)Used to resolve a value that could also be a function returning that value
cast_bool(var)Converts a varible into its boolean value, nil and false return false
ternary(c, t, f)Returns either the second or third argument based on the first argument
comma_value(n)Returns a string for a number with comma seperators
set_and_return(tbl, key, value)Sets a table element to value while also returning value.
write_json(path, tbl)Writes a table object to a file in json format
opt_require(path)Calls a require that will not error if the file is not found
get_file_path([offset=0])Returns a desync safe file path for the current file
enum(tbl)Converts a table to an enum
auto_complete(options, input[, use_key=false][, rtn_key=false])Returns the closest match to the input
- - -

Formatting

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_actor(player_name)Returns a valid string with the name of the actor of a command.
format_chat_colour(message, color)Returns a message with valid chat tags to change its colour
format_chat_colour_localized(message, color)Returns a message with valid chat tags to change its colour, using localization
format_chat_player_name(player[, raw_string=false])Returns the players name in the players color
player_return(value[, colour=defines.colour.white][, player=game.player])Will return a value of any type to the player/server console, allows colour for in-game players
format_time(ticks, options)Formats tick into a clean format, denominations from highest to lowest --- time will use : separates --- when a denomination is false it will overflow into the next one
- - -

Factorio

- - - - - - - - - - - - - - - - - - - - -
copy_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest])Copies items to the position and stores them in the closest entity of the type given --- Copies the items by prototype name, but keeps them in the original inventory
move_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest])Moves items to the position and stores them in the closest entity of the type given --- Differs from move_items by accepting a table of LuaItemStack and transferring them into the inventory - not copying
print_grid_value(value, surface, position[, scale=1][, offset=0][, immutable=false])Prints a colored value on a location, color is based on the value.
clear_flying_text(surface)Clears all flying text entities on a surface
- - -
- - -

Dependencies

-
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Type Checking

-
-
-
-
- # - type_check(value[, test_type=nil]) -
-
-
-
- -

Asserts the argument is of type test_type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value to be tested - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type to test for if not given then it tests for nil - - (default: nil) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - is v of type test_type -
  • -
- - - - - - - - Usage: -
-- Check for a string value
-local is_string = type_check(value, 'string')
-
-- Check for a nil value
-local is_nil = type_check(value)
- - -
-
-
-
- # - type_error(value, test_type, error_message, level) -
-
-
-
- -

Raises an error if the value is of the wrong type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - error_message - - : - - (string) - - the error message that is returned - -
  • - - - - - -
  • - - level - - : - - (number) - - the level to call the error on (level = 1 is the caller) - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was called -
  • -
- - - - - - - - Usage: -
-- Raise error if value is not a number
-type_error(value, 'number', 'Value must be a number')
- - -
-
-
-
- # - multi_type_check(value, test_types) -
-
-
-
- -

Asserts the argument is one of type test_types

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - the variable to check - -
  • - - - - - -
  • - - test_types - - : - - - the type as a table of strings - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if value is one of test_types -
  • -
- - - - - - - - Usage: -
-- Check for a string or table
-local is_string_or_table = multi_type_check(value, {'string', 'table'})
- - -
-
-
-
- # - multi_type_error(value, test_types, error_message, level) -
-
-
-
- -

Raises an error if the value is of the wrong type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_types - - : - - (table) - - the type as a table of strings - -
  • - - - - - -
  • - - error_message - - : - - (string) - - the error message that is returned - -
  • - - - - - -
  • - - level - - : - - (number) - - the level to call the error on (level = 1 is the caller) - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was called -
  • -
- - - - - - - - Usage: -
-- Raise error if value is not a string or table
-multi_type_error('foo', {'string', 'table'}, 'Value must be a string or table')
- - -
-
-
-
- # - validate_argument_type(value, test_type, param_number[, param_name]) -
-
-
-
- -

Raises an error when the value is the incorrect type, uses a consistent error message format

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - param_number - - : - - (number) - - the number param it is - -
  • - - - - - -
  • - - param_name - - : - - (string) - - the name of the param - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was raised -
  • -
- - - - - - - - Usage: -
-- Output: "Bad argument #2 to "<anon>"; argument is of type string expected number"
-validate_argument_type(value, 'number', 2)
-
-- Output: "Bad argument #2 to "<anon>"; "repeat_count" is of type string expected number"
-validate_argument_type(value, 'number', 2, 'repeat_count')
- - -
-
-
-
- # - validate_argument_multi_type(value, test_types, param_number[, param_name]) -
-
-
-
- -

Raises an error when the value is the incorrect type, uses a consistent error message format

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_types - - : - - (string) - - the types that the value should be - -
  • - - - - - -
  • - - param_number - - : - - (number) - - the number param it is - -
  • - - - - - -
  • - - param_name - - : - - (string) - - the name of the param - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was raised -
  • -
- - - - - - - - Usage: -
-- Output: "Bad argument #2 to "<anon>"; argument is of type number expected string or table"
-validate_argument_type(value, {'string', 'table'}, 2)
-
-- Output: "Bad argument #2 to "<anon>"; "player" is of type number expected string or table"
-validate_argument_type(value, {'string', 'table'}, 2, 'player')
- - -
-
-
-
- # - error_if_runtime() -
-
-
-
- -

Will raise an error if called during runtime

-

- - - - - - - - - - - - - Usage: -
error_if_runtime()
- - -
-
-
-
- # - error_if_runetime_closure(func) -
-
-
-
- -

Will raise an error if the function is a closure

-

- - - Parameters: - -
    - - - - - -
  • - - func - - - - - -
  • - - -
- - - - - - - - - - - - Usage: -
error_if_runetime_closure(func)
- - -
-
-

Value Returns

-
-
-
-
- # - string_contains(s, contains) -
-
-
-
- -

Tests if a string contains a given substring.

-

- - - Parameters: - -
    - - - - - -
  • - - s - - : - - (string) - - the string to check for the substring - -
  • - - - - - -
  • - - contains - - : - - (string) - - the substring to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the substring was found in the string -
  • -
- - - - - - - - Usage: -
-- Test if a string contains a sub string
-local found = string_contains(str, 'foo')
- - -
-
-
-
- # - resolve_value(value) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value which you want to test is not nil and if it is a function then call the function - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value given or returned by value if it is a function -
  • -
- - - - - - - - Usage: -
-- Default value handling
--- if default value is not a function then it is returned
--- if default value is a function then it is called with the first argument being self
-local value = Common.resolve_value(self.defaut_value, self)
- - -
-
-
-
- # - cast_bool(var) -
-
-
-
- -

Converts a varible into its boolean value, nil and false return false

-

- - - Parameters: - -
    - - - - - -
  • - - var - - - - - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the boolean form of the varible -
  • -
- - - - - - - - Usage: -
local bool = cast_bool(var)
- - -
-
-
-
- # - ternary(c, t, f) -
-
-
-
- -

Returns either the second or third argument based on the first argument

-

- - - Parameters: - -
    - - - - - -
  • - - c - - - - - -
  • - - - - - -
  • - - t - - - - - -
  • - - - - - -
  • - - f - - - - - -
  • - - -
- - - - - - - - - - - - Usage: -
ternary(input_string == 'test', 'Input is test', 'Input is not test')
- - -
-
-
-
- # - comma_value(n) -
-
-
-
- -

Returns a string for a number with comma seperators

-

- - - Parameters: - -
    - - - - - -
  • - - n - - : - - (credit http) - - //richard.warburton.it - -
  • - - -
- - - - - - - - - - - - Usage: -
comma_value(input_number)
- - -
-
-
-
- # - set_and_return(tbl, key, value) -
-
-
-
- -

Sets a table element to value while also returning value.

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - to change the element of - -
  • - - - - - -
  • - - key - - : - - (string) - - the key to set the value of - -
  • - - - - - -
  • - - value - - : - - (any) - - the value to set the key as - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value that was set -
  • -
- - - - - - - - Usage: -
-- Set and return value
-local value = set_and_return(players, player.name, player.online_time)
- - -
-
-
-
- # - write_json(path, tbl) -
-
-
-
- -

Writes a table object to a file in json format

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path of the file to write include / to use dir - -
  • - - - - - -
  • - - tbl - - : - - (table) - - the table that will be converted to a json string and wrote to file - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Write a lua table as a json to script-outpt/dump
-write_json('dump', tbl)
- - -
-
-
-
- # - opt_require(path) -
-
-
-
- -

Calls a require that will not error if the file is not found

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path that you want to require - -
  • - - -
- - - - - Returns: -
    -
  • - the returns from that file or nil, error if not loaded -
  • -
- - - - - - - - Usage: -
local file = opt_require('file.not.present') -- will not cause any error
-
-- Require a file without causing errors, for when a file might not exist
-local Module = opt_require 'expcore.common'
- - -
-
-
-
- # - get_file_path([offset=0]) -
-
-
-
- -

Returns a desync safe file path for the current file

-

- - - Parameters: - -
    - - - - - -
  • - - offset - - : - - (number) - - the offset in the stack to get, 0 is current file - - (default: 0) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the file path -
  • -
- - - - - - - - Usage: -
-- Get the current file path
-local file_path = get_file_path()
- - -
-
-
-
- # - enum(tbl) -
-
-
-
- -

Converts a table to an enum

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - table the that will be converted - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new table that acts like an enum -
  • -
- - - - - - - - Usage: -
-- Make an enum
-local colors = enum{
-    'red',
-    'green',
-    'blue'
-}
- - -
-
-
-
- # - auto_complete(options, input[, use_key=false][, rtn_key=false]) -
-
-
-
- -

Returns the closest match to the input

-

- - - Parameters: - -
    - - - - - -
  • - - options - - : - - (table) - - table a of options for the auto complete - -
  • - - - - - -
  • - - input - - : - - (string) - - string the input that will be completed - -
  • - - - - - -
  • - - use_key - - : - - (boolean) - - when true the keys of options will be used as the options - - (default: false) -
  • - - - - - -
  • - - rtn_key - - : - - (boolean) - - when true the the key will be returned rather than the value - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - the list item found that matches the input -
  • -
- - - - - - - - Usage: -
-- Get the element that includes "foo"
-local value = auto_complete(tbl, "foo")
-
-- Get the element with a key that includes "foo"
-local value = auto_complete(tbl, "foo", true)
-
-- Get the key with that includes "foo"
-local key = auto_complete(tbl, "foo", true, true)
- - -
-
-

Formatting

-
-
-
-
- # - get_actor(player_name) -
-
-
-
- -

Returns a valid string with the name of the actor of a command.

-

- - - Parameters: - -
    - - - - - -
  • - - player_name - - : - - (string) - - the name of the player to use rather than server, used only if game.player is nil - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the name of the current actor -
  • -
- - - - - - - - Usage: -
-- Get the current actor
-local player_name = get_actor()
- - -
-
-
-
- # - format_chat_colour(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r, g, b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the message with the color tags included -
  • -
- - - - - - - - Usage: -
-- Use factorio tags to color a chat message
-local message = format_chat_colour('Hello, World!', { r=355, g=100, b=100 })
- - -
-
-
-
- # - format_chat_colour_localized(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour, using localization

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string or table) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r, g, b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the message with the color tags included -
  • -
- - - - - - - - Usage: -
-- Use factorio tags and locale strings to color a chat message
-local message = format_chat_colour_localized('Hello, World!', { r=355, g=100, b=100 })
- - -
-
-
-
- # - format_chat_player_name(player[, raw_string=false]) -
-
-
-
- -

Returns the players name in the players color

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to use the name and color of - -
  • - - - - - -
  • - - raw_string - - : - - (boolean) - - when true a string is returned rather than a localized string - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the players name with tags for the players color -
  • -
- - - - - - - - Usage: -
-- Format a players name using the players color as a string
-local message = format_chat_player_name(game.player, true)
- - -
-
-
-
- # - player_return(value[, colour=defines.colour.white][, player=game.player]) -
-
-
-
- -

Will return a value of any type to the player/server console, allows colour for in-game players

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - a value of any type that will be returned to the player or console - -
  • - - - - - -
  • - - colour - - : - - (defines.color or string) - - the colour of the text for the player, ignored when printing to console - - (default: defines.colour.white) -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that return will go to, if no game.player then returns to server - - (default: game.player) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Return a value to the current actor, rcon included
-player_return('Hello, World!')
-
-- Return a value to the current actor, with color
-player_return('Hello, World!', 'green')
-
-- Return to a player other than the current
-player_return('Hello, World!', nil, player)
- - -
-
-
-
- # - format_time(ticks, options) -
-
-
-
- -

Formats tick into a clean format, denominations from highest to lowest --- time will use : separates --- when a denomination is false it will overflow into the next one

-

- - - Parameters: - -
    - - - - - -
  • - - ticks - - : - - (number) - - the number of ticks that represents a time - -
  • - - - - - -
  • - - options - - : - - (table) - - table a of options to use for the format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - a locale string that can be used -
  • -
- - - - - - - - Usage: -
-- Output: "0h 5m"
-local time = format_time(18000, { hours=true, minutes=true, string=true })
-
-- Output: "0 hours and 5 minutes"
-local time = format_time(18000, { hours=true, minutes=true, string=true, long=true })
-
-- Output: "00:05:00"
-local time = format_time(18000, { hours=true, minutes=true, seconds=true, string=true })
-
-- Output: "--:--:--"
-local time = format_time(18000, { hours=true, minutes=true, seconds=true, string=true, null=true })
- - -
-
-

Factorio

-
-
-
-
- # - copy_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) -
-
-
-
- -

Copies items to the position and stores them in the closest entity of the type given --- Copies the items by prototype name, but keeps them in the original inventory

-

- - - Parameters: - -
    - - - - - -
  • - - items - - : - - (table) - - items which are to be added to the chests, an array of LuaItemStack - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface that the items will be copied to - - (default: navies) -
  • - - - - - -
  • - - position - - : - - (table) - - the position that the items will be copied to {x=100, y=100} - - (default: {0) -
  • - - - - - -
  • - - radius - - : - - (number) - - the radius in which the items are allowed to be placed - - (default: 32) -
  • - - - - - -
  • - - chest_type - - : - - (string) - - the chest type that the items should be copied into - - (default: iron-chest) -
  • - - -
- - - - - Returns: -
    -
  • - (LuaEntity) - the last chest that had items inserted into it -
  • -
- - - - - - - - Usage: -
-- Copy all the items in a players inventory and place them in chests at {0, 0}
-copy_items_stack(game.player.get_main_inventory().get_contents())
- - -
-
-
-
- # - move_items_stack(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) -
-
-
-
- -

Moves items to the position and stores them in the closest entity of the type given --- Differs from move_items by accepting a table of LuaItemStack and transferring them into the inventory - not copying

-

- - - Parameters: - -
    - - - - - -
  • - - items - - : - - (table) - - items which are to be added to the chests, an array of LuaItemStack - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface that the items will be moved to - - (default: navies) -
  • - - - - - -
  • - - position - - : - - (table) - - the position that the items will be moved to {x=100, y=100} - - (default: {0) -
  • - - - - - -
  • - - radius - - : - - (number) - - the radius in which the items are allowed to be placed - - (default: 32) -
  • - - - - - -
  • - - chest_type - - : - - (string) - - the chest type that the items should be moved into - - (default: iron-chest) -
  • - - -
- - - - - Returns: -
    -
  • - (LuaEntity) - the last chest that had items inserted into it -
  • -
- - - - - - - - Usage: -
-- Copy all the items in a players inventory and place them in chests at {0, 0}
-move_items_stack(game.player.get_main_inventory())
- - -
-
-
-
- # - print_grid_value(value, surface, position[, scale=1][, offset=0][, immutable=false]) -
-
-
-
- -

Prints a colored value on a location, color is based on the value.

-

-nb: src is below but the gradent has been edited -https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (number) - - the value to show must be between -1 and 1, scale can be used to achive this - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface to palce the value on - -
  • - - - - - -
  • - - position - - : - - (table) - - {x, y} the possition to palce the value at - -
  • - - - - - -
  • - - scale - - : - - (number) - - how much to scale the colours by - - (default: 1) -
  • - - - - - -
  • - - offset - - : - - (number) - - the offset in the +x +y direction - - (default: 0) -
  • - - - - - -
  • - - immutable - - : - - (boolean) - - if immutable, only set, never do a surface lookup, values never change - - (default: false) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Place a 0 at {0, 0}
-print_grid_value(0, game.player.surface, { x=0, y=0 })
- - -
-
-
-
- # - clear_flying_text(surface) -
-
-
-
- -

Clears all flying text entities on a surface

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface to clear - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Remove all flying text on the surface
-clear_flying_text(game.player.surface)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Datastore.html b/docs/core/Datastore.html deleted file mode 100644 index 79601228..00000000 --- a/docs/core/Datastore.html +++ /dev/null @@ -1,2989 +0,0 @@ - - - - - - - - Datastore core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Datastore core

-

Core Module - Datastore -- A module used to store data in the global table with the option to have it sync to an external source.

-

- - - - - - -

Usage

-
-- Types of Datastore
--- This datastore will not save data externally and can be used to watch for updates on values within it
--- A common use might be to store data for a gui and only update the gui when a value changes
-local LocalDatastore = Datastore.connect('LocalDatastore')
-
--- This datastore will allow you to use the save and request method, this allows you to have persistent data
--- Should be used over auto save as it creates less save requests, but this means you need to tell the data to be saved
--- We use this type for player data as we know the data only needs to be saved when the player leaves
-local PersistentDatastore = Datastore.connect('PersistentDatastore', true) -- save_to_disk
-
--- This datastore is the same as above but the save method will be called automatically when ever you change a value
--- An auto save datastore should be used if the data does not change often, this can be global settings and things of that sort
--- If it is at all possible to setup events to unload and/or save the data then this is preferable
-local AutosaveDatastore = Datastore.connect('AutosaveDatastore', true, true) -- save_to_disk, auto_save
-
--- Finally you can have a datastore that propagates its changes to all other connected servers, this means request does not need to be used
--- This should be used when you might have data conflicts while saving, this is done by pushing the saved value to all active servers
--- The request method has little use after server start as any external changes to the value will be pushed automatically
--- Auto save can also be used with this type and you should follow the same guidelines above for when this should be avoided
-local PropagateDatastore = Datastore.connect('PropagateDatastore', true, false, true) -- save_to_disk, propagate_changes
-
-
-- Using Datastores Locally
--- Once you have your datastore connection setup, any further requests with connect will return the same datastore
--- This is important to know because the settings passed as parameters you have an effect when it is first created
-
--- One useful thing that you might want to set up before runtime is a serializer, this will convert non string keys into strings
--- This serializer will allow use to pass a player object and still have it serialized to the players name
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set_serializer(function(rawKey)
-    return rawKey.name
-end)
-
--- If we want to get data from the datastore we can use get or get_all
-local value = ExampleData:get(player, defaultValue)
-local values = ExampleData:get_all()
-
--- If we want to set data then we can use set, increment, update, or update_all
-ExampleData:set(player, 10)
-ExampleData:increment(player)
-ExampleData:update(player, function(player_name, value)
-    return value * 2
-end)
-ExampleData:update_all(function(player_name, value)
-    return value * 2
-end)
-
--- If we want to remove data then we use remove
-ExampleData:remove(player)
-
--- We can also listen for updates to a value done by any of the above methods with on_update
-ExampleData:on_update(function(player_name, value)
-    game.print(player_name..' has had their example data updated to '..tostring(value))
-end)
-
-- Using Datastore Externally
--- If save_to_disk is used then this opens up the option for persistent data which you can request, save, and remove
--- All of the local methods are still usable put now there is the option for extra events
--- In order for this to work there must be an external script to read datastore.pipe and inject with Datastore.ingest
-
--- To request data you would use request and the on_load event, this event can be used to modify data before it is used
-ExampleData:request(player)
-ExampleData:on_load(function(player_name, value)
-    game.print('Loaded example data for '..player_name)
-    -- A value can be returned here to overwrite the received value
-end)
-
--- To save data you would use save and the on_save event, this event can be used to modify data before it is saved
-ExampleData:save(player)
-ExampleData:on_save(function(player_name, value)
-    game.print('Saved example data for '..player_name)
-    -- A value can be returned here to overwrite the value which is saved
-end)
-
--- To remove data locally but not externally, like if a player logs off, you would use unload and on_unload
-ExampleData:unload(player)
-ExampleData:on_unload(function(player_name, value)
-    game.print('Unloaded example data for '..player_name)
-    -- Any return is ignored, this is event is for cleaning up other data
-end)
-
-- Using Datastore Messaging
--- The message action can be used regardless of save_to_disk being set as no data is saved, but an external script is still required
--- These messages can be used to send data to other servers which doesnt need to be saved such as shouts or commands
--- Using messages is quite simple only using message and on_message
-ExampleData:message(key, message)
-ExampleData:on_message(function(key, message)
-    game.print('Received message '..message)
-end)
-
-- Combined Datastores
--- A combined datastore is a datastore which stores its data inside of another datastore
--- This means that the data is stored more efficiently in the external database and less requests need to be made
--- To understand how combined datastores work think of each key in the parent as a table where the sub datastore is a key in that table
--- Player data is the most used version of the combined datastore, below is how the player data module is setup
-local PlayerData = Datastore.connect('PlayerData', true) -- saveToDisk
-PlayerData:set_serializer(Datastore.name_serializer) -- use player name as key
-PlayerData:combine('Statistics')
-PlayerData:combine('Settings')
-PlayerData:combine('Required')
-
--- You can then further combine datastores to any depth, below we add some possible settings and statistics that we might use
--- Although we dont in this example, each of these functions returns the datastore object which you should use as a local value
-PlayerData.Settings:combine('Color')
-PlayerData.Settings:combine('Quickbar')
-PlayerData.Settings:combine('JoinMessage')
-PlayerData.Statistics:combine('Playtime')
-PlayerData.Statistics:combine('JoinCount')
-
--- Because sub datastore work just like a normal datastore you dont need any special code, using get and set will still return as if it wasnt a sub datastore
--- Things like the serializer and the datastore settings are always the same as the parent so you dont need to worry about setting up the serializer each time
--- And because save, request, and unload methods all point to the root datastore you are able to request and save your data as normal
-
--- If you used get_all on PlayerData this is what you would get:
-{
-    Cooldude2606 = {
-        Settings = {
-            Color = 'ColorValue',
-            Quickbar = 'QuickbarValue',
-            JoinMessage = 'JoinMessageValue'
-        },
-        Statistics = {
-            Playtime = 'PlaytimeValue',
-            JoinCount = 'JoinCountValue'
-        }
-    }
-}
-
--- If you used get_all on PlayerData.Settings this is what you would get:
-{
-    Cooldude2606 = {
-        Color = 'ColorValue',
-        Quickbar = 'QuickbarValue',
-        JoinMessage = 'JoinMessageValue'
-    }
-}
-
--- If you used get_all on PlayerData.Settings.Color this is what you would get:
-{
-    Cooldude2606 = 'ColorValue'
-}
- - - - - - - -

Dependencies

- - - - - - - -
utils.event
- - -

Fields

- - - - - - - - -
global.datastoresSave datastores in the global table
- - -

Datastore Manager

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
metatableMetatable used on datastores
connect(datastoreName[, saveToDisk=false][, autoSave=false][, propagateChanges=false])Make a new datastore connection, if a connection already exists then it is returned
combine(datastoreName, subDatastoreName)Make a new datastore that stores its data inside of another one
ingest(action, datastoreName, key, valueJson)Ingest the result from a request, this is used through a rcon interface to sync data
debug([datastoreName])Debug, Use to get all datastores, or return debug info on a datastore
name_serializer(rawKey)Commonly used serializer, returns the name of the object
- - -

Datastore Internal

- - - - - - - - - - - - - - - - - - - - - - - - -
debug()Debug, Get the debug info for this datastore
raw_get(key[, fromChild=false])Internal, Get data following combine logic
raw_set(key, value)Internal, Set data following combine logic
serialize(rawKey)Internal, Return the serialized key
write_action(action, key, value)Internal, Writes an event to the output file to be saved and/or propagated
- - -

Datastore Local

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
combine(subDatastoreName)Create a new datastore which is stores its data inside of this datastore
set_serializer(callback)Set a callback that will be used to serialize keys which aren't strings
set_default(value, allowSet)Set a default value to be returned by get if no other default is given, using will mean get will never return nil, set using the default will set to nil to save space
set_metadata(tags)Set metadata tags on this datastore which can be accessed by other scripts
get(key[, default])Get a value from local storage, option to have a default value, do not edit the data returned as changes may not save, use update if you want to make changes
set(key, value)Set a value in local storage, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save
increment(key[, delta=1])Increment the value in local storage, only works for number values, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save
update(key, callback)Use a function to update the value locally, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save
remove(key)Remove a value locally and on the external source, works regardless of propagateChanges, requires save_to_disk for external changes
get_all([callback])Get all keys in this datastore, optional filter callback
update_all(callback)Update all keys in this datastore using the same update function
- - -

Datastore External

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
request(key)Request a value from an external source, will trigger on_load when data is received
save(key)Save a value to an external source, will trigger on_save before data is saved, save_to_disk must be set to true
unload(key)Save a value to an external source and remove locally, will trigger on_unload then on_save, save_to_disk is not required for on_unload
message(key, message)Use to send a message over the connection, works regardless of saveToDisk and propagateChanges
save_all([callback])Save all the keys in the datastore, optional filter callback
unload_all([callback])Unload all the keys in the datastore, optional filter callback
- - -

Events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
raise_event(event_name, key[, value][, old_value][, source])Internal, Raise an event on this datastore
on_loadRegister a callback that triggers when data is loaded from an external source, returned value is saved locally
on_saveRegister a callback that triggers before data is saved, returned value is saved externally
on_unloadRegister a callback that triggers before data is unloaded, returned value is ignored
on_messageRegister a callback that triggers when a message is received, returned value is ignored
on_updateRegister a callback that triggers any time a value is changed, returned value is ignored
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - global.datastores -
-
-
-
- -

Save datastores in the global table

-

- - - - - - - - - - - - - - -
-
-

Datastore Manager

-
-
-
-
- # - metatable -
-
-
-
- -

Metatable used on datastores

-

- - - Fields: - -
    - - - - - -
  • - - __index - - - - - -
  • - - - - - -
  • - - __newidnex - - - - - -
  • - - - - - -
  • - - __call - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - connect(datastoreName[, saveToDisk=false][, autoSave=false][, propagateChanges=false]) -
-
-
-
- -

Make a new datastore connection, if a connection already exists then it is returned

-

- - - Parameters: - -
    - - - - - -
  • - - datastoreName - - : - - (string) - - The name that you want the new datastore to have, this can not have any whitespace - -
  • - - - - - -
  • - - saveToDisk - - : - - (boolean) - - When set to true, using the save method with write the data to datastore.pipe - - (default: false) -
  • - - - - - -
  • - - autoSave - - : - - (boolean) - - When set to true, using any method which modifies data will cause the data to be saved - - (default: false) -
  • - - - - - -
  • - - propagateChanges - - : - - (boolean) - - When set to true, using the save method will send the data to all other connected servers - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - The new datastore connection that can be used to access and modify data in the datastore -
  • -
- - - - - - - - Usage: -
-- Connecting to the test datastore which will allow saving to disk
-local ExampleData = Datastore.connect('ExampleData', true) -- saveToDisk
-
- - -
-
-
-
- # - combine(datastoreName, subDatastoreName) -
-
-
-
- -

Make a new datastore that stores its data inside of another one

-

- - - Parameters: - -
    - - - - - -
  • - - datastoreName - - : - - (string) - - The name of the datastore that will contain the data for the new datastore - -
  • - - - - - -
  • - - subDatastoreName - - : - - (string) - - The name of the new datastore, this name will also be used as the key inside the parent datastore - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - The new datastore connection that can be used to access and modify data in the datastore -
  • -
- - - - - - - - Usage: -
-- Setting up a datastore which stores its data inside of another datastore
-local BarData = Datastore.combine('ExampleData', 'Bar')
- - -
-
-
-
- # - ingest(action, datastoreName, key, valueJson) -
-
-
-
- -

Ingest the result from a request, this is used through a rcon interface to sync data

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - The action that should be done, can be: remove, message, propagate, or request - -
  • - - - - - -
  • - - datastoreName - - : - - (string) - - The name of the datastore that should have the action done to it - -
  • - - - - - -
  • - - key - - : - - (string) - - The key of that datastore that is having the action done to it - -
  • - - - - - -
  • - - valueJson - - : - - (string) - - The json string for the value being ingested, remove does not require a value - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Replying to a data request
-Datastore.ingest('request', 'ExampleData', 'TestKey', 'Foo')
- - -
-
-
-
- # - debug([datastoreName]) -
-
-
-
- -

Debug, Use to get all datastores, or return debug info on a datastore

-

- - - Parameters: - -
    - - - - - -
  • - - datastoreName - - : - - (string) - - The name of the datastore to get the debug info of - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Get all the datastores
-local datastores = Datastore.debug()
-
-- Getting the debug info for a datastore
-local debug_info = Datastore.debug('ExampleData')
- - -
-
-
-
- # - name_serializer(rawKey) -
-
-
-
- -

Commonly used serializer, returns the name of the object

-

- - - Parameters: - -
    - - - - - -
  • - - rawKey - - : - - (any) - - The raw key that will be serialized, this can be things like player, force, surface, etc - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - The name of the object that was passed -
  • -
- - - - - - - - Usage: -
-- Using the name serializer for your datastore
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set_serializer(Datastore.name_serializer)
- - -
-
-

Datastore Internal

-
-
-
-
- # - debug() -
-
-
-
- -

Debug, Get the debug info for this datastore

-

- - - - - - Returns: -
    -
  • - (table) - The debug info for this datastore, contains stuff like parent, settings, children, etc -
  • -
- - - - - - - - Usage: -
-- Get the debug info for a datastore
-local ExampleData = Datastore.connect('ExampleData')
-local debug_info = ExampleData:debug()
- - -
-
-
-
- # - raw_get(key[, fromChild=false]) -
-
-
-
- -

Internal, Get data following combine logic

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (string) - - The key to get the value of from this datastore - -
  • - - - - - -
  • - - fromChild - - : - - (boolean) - - If the get request came from a child of this datastore - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (any) - The value that was stored at this key in this datastore -
  • -
- - - - - - - - Usage: -
-- Internal, Get the data from a datastore
-local value = self:raw_get('TestKey')
- - -
-
-
-
- # - raw_set(key, value) -
-
-
-
- -

Internal, Set data following combine logic

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (string) - - The key to set the value of in this datastore - -
  • - - - - - -
  • - - value - - : - - (any) - - The value that will be set at this key - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Internal, Set the value in a datastore
-self:raw_set('TestKey', 'Foo')
- - -
-
-
-
- # - serialize(rawKey) -
-
-
-
- -

Internal, Return the serialized key

-

- - - Parameters: - -
    - - - - - -
  • - - rawKey - - : - - (any) - - The key that needs to be serialized, if it is already a string then it is returned - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - The key after it has been serialized -
  • -
- - - - - - - - Usage: -
-- Internal, Ensure that the key is a string
-key = self:serialize(key)
- - -
-
-
-
- # - write_action(action, key, value) -
-
-
-
- -

Internal, Writes an event to the output file to be saved and/or propagated

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - The action that should be wrote to datastore.pipe, can be request, remove, message, save, propagate - -
  • - - - - - -
  • - - key - - : - - (string) - - The key that the action is being preformed on - -
  • - - - - - -
  • - - value - - : - - (any) - - The value that should be used with the action - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Write a data request to datastore.pipe
-self:write_action('request', 'TestKey')
-
-- Write a data save to datastore.pipe
-self:write_action('save', 'TestKey', 'Foo')
- - -
-
-

Datastore Local

-
-
-
-
- # - combine(subDatastoreName) -
-
-
-
- -

Create a new datastore which is stores its data inside of this datastore

-

- - - Parameters: - -
    - - - - - -
  • - - subDatastoreName - - : - - (string) - - The name of the datastore that will have its data stored in this datastore - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - The new datastore that was created inside of this datastore -
  • -
- - - - - - - - Usage: -
-- Add a new sub datastore
-local ExampleData = Datastore.connect('ExampleData')
-local BarData = ExampleData:combine('Bar')
- - -
-
-
-
- # - set_serializer(callback) -
-
-
-
- -

Set a callback that will be used to serialize keys which aren't strings

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The function that will be used to serialize non string keys passed as an argument - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Set a custom serializer, this would be the same as Datastore.name_serializer
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set_serializer(function(rawKey)
-    return rawKey.name
-end)
- - -
-
-
-
- # - set_default(value, allowSet) -
-
-
-
- -

Set a default value to be returned by get if no other default is given, using will mean get will never return nil, set using the default will set to nil to save space

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - The value that will be deep copied by get if the value is nil and no other default is given - -
  • - - - - - -
  • - - allowSet - - : - - (boolean) - - When true if the default is passed as the value for set it will be set rather than setting nil - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Set a default value to be returned by get
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set_default('Foo')
- - -
-
-
-
- # - set_metadata(tags) -
-
-
-
- -

Set metadata tags on this datastore which can be accessed by other scripts

-

- - - Parameters: - -
    - - - - - -
  • - - tags - - : - - (table) - - A table of tags that you want to set in the metadata for this datastore - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding metadata that could be used by a gui to help understand the stored data
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set_metadata{
-    caption = 'Test Data',
-    tooltip = 'Data used for testing datastores',
-    type = 'table'
-}
- - -
-
-
-
- # - get(key[, default]) -
-
-
-
- -

Get a value from local storage, option to have a default value, do not edit the data returned as changes may not save, use update if you want to make changes

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to get the value of, must be a string unless a serializer is set - -
  • - - - - - -
  • - - default - - : - - (any) - - The default value that will be returned if no value is found in the datastore - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Get a key from the datastore, the default will be deep copied if no value exists in the datastore
-local ExampleData = Datastore.connect('ExampleData')
-local value = ExampleData:get('TestKey')
- - -
-
-
-
- # - set(key, value) -
-
-
-
- -

Set a value in local storage, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to set the value of, must be a string unless a serializer is set - -
  • - - - - - -
  • - - value - - : - - (any) - - The value that you want to set for this key - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Set a value in the datastore, this will trigger on_update, if auto_save is true then will trigger save
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:set('TestKey', 'Foo')
- - -
-
-
-
- # - increment(key[, delta=1]) -
-
-
-
- -

Increment the value in local storage, only works for number values, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to increment the value of, must be a string unless a serializer is set - -
  • - - - - - -
  • - - delta - - : - - (number) - - The amount that you want to increment the value by, can be negative or a decimal - - (default: 1) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Increment a value in a datastore, the value must be a number or nil, if nil 0 is used as the start value
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:increment('TestNumber')
- - -
-
-
-
- # - update(key, callback) -
-
-
-
- -

Use a function to update the value locally, will trigger on_update then on_save, save_to_disk and auto_save is required for on_save

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to apply the update to, must be a string unless a serializer is set - -
  • - - - - - -
  • - - callback - - : - - (function) - - The function that will be used to update the value at this key - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Using a function to update a value, if a value is returned then this will be the new value
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:increment('TestKey', function(key, value)
-    return value..value
-end)
- - -
-
-
-
- # - remove(key) -
-
-
-
- -

Remove a value locally and on the external source, works regardless of propagateChanges, requires save_to_disk for external changes

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to remove locally and externally, must be a string unless a serializer is set - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Remove a key locally and externally
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:remove('TestKey')
- - -
-
-
-
- # - get_all([callback]) -
-
-
-
- -

Get all keys in this datastore, optional filter callback

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The filter function that can be used to filter the results returned - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - All the data that is in this datastore, filtered if a filter was provided -
  • -
- - - - - - - - Usage: -
-- Get all the data in this datastore
-local ExampleData = Datastore.connect('ExampleData')
-local data = ExampleData:get_all()
-
-- Get all the data in this datastore, with a filter
-local ExampleData = Datastore.connect('ExampleData')
-local data = ExampleData:get_all(function(key, value)
-    return type(value) == 'string'
-end)
- - -
-
-
-
- # - update_all(callback) -
-
-
-
- -

Update all keys in this datastore using the same update function

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The update function that will be applied to each key - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Get all the data in this datastore, with a filter
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:update_all(function(key, value)
-    return value..value
-end)
- - -
-
-

Datastore External

-
-
-
-
- # - request(key) -
-
-
-
- -

Request a value from an external source, will trigger on_load when data is received

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to request from an external source, must be a string unless a serializer is set - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Request a key from an external source, on_load is triggered when data is received
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:request('TestKey')
- - -
-
-
-
- # - save(key) -
-
-
-
- -

Save a value to an external source, will trigger on_save before data is saved, save_to_disk must be set to true

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to save to an external source, must be a string unless a serializer is set - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Save a key to an external source, save_to_disk must be set to true for there to be any effect
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:save('TestKey')
- - -
-
-
-
- # - unload(key) -
-
-
-
- -

Save a value to an external source and remove locally, will trigger on_unload then on_save, save_to_disk is not required for on_unload

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to unload from the datastore, must be a string unless a serializer is set - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Unload a key from the datastore, get will now return nil and value will be saved externally if save_to_disk is set to true
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:unload('TestKey')
- - -
-
-
-
- # - message(key, message) -
-
-
-
- -

Use to send a message over the connection, works regardless of saveToDisk and propagateChanges

-

- - - Parameters: - -
    - - - - - -
  • - - key - - : - - (any) - - The key that you want to send a message over, must be a string unless a serializer is set - -
  • - - - - - -
  • - - message - - : - - (any) - - The message that you want to send to other connected servers, or external source - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Send a message to other servers on this key, can listen for messages with on_message
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:message('TestKey', 'Foo')
- - -
-
-
-
- # - save_all([callback]) -
-
-
-
- -

Save all the keys in the datastore, optional filter callback

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The filter function that can be used to filter the keys saved - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Save all the data in this datastore
-local ExampleData = Datastore.connect('ExampleData')
-local data = ExampleData:save_all()
-
-- Save all the data in this datastore, with a filter
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:save_all(function(key, value)
-    return type(value) == 'string'
-end)
- - -
-
-
-
- # - unload_all([callback]) -
-
-
-
- -

Unload all the keys in the datastore, optional filter callback

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - The filter function that can be used to filter the keys unloaded - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Unload all the data in this datastore
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:unload_all()
-
-- Unload all the data in this datastore, with a filter
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:unload_all(function(key, value)
-    return type(value) == 'string'
-end)
- - -
-
-

Events

-
-
-
-
- # - raise_event(event_name, key[, value][, old_value][, source]) -
-
-
-
- -

Internal, Raise an event on this datastore

-

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - (string) - - The name of the event to raise for this datastore - -
  • - - - - - -
  • - - key - - : - - (string) - - The key that this event is being raised for - -
  • - - - - - -
  • - - value - - : - - (any) - - The current value that this key has, might be a deep copy of the value - - (optional) -
  • - - - - - -
  • - - old_value - - : - - (any) - - The previous value that this key has, might be a deep copy of the value - - (optional) -
  • - - - - - -
  • - - source - - : - - (string) - - Where this call came from, used to do event recursion so can be parent or child - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (any) - The value that is left after being passed through all the event handlers -
  • -
- - - - - - - - Usage: -
-- Internal, Getting the value that should be saved
-value = self:raise_event('on_save', key, value)
- - -
-
-
-
- # - on_load -
-
-
-
- -

Register a callback that triggers when data is loaded from an external source, returned value is saved locally

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - The handler that will be registered to the on_load event - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a handler to on_load, returned value will be saved locally, can be used to deserialize the value beyond a normal json
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:on_load(function(key, value)
-    game.print('Test data loaded for: '..key)
-end)
- - -
-
-
-
- # - on_save -
-
-
-
- -

Register a callback that triggers before data is saved, returned value is saved externally

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - The handler that will be registered to the on_load event - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a handler to on_save, returned value will be saved externally, can be used to serialize the value beyond a normal json
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:on_save(function(key, value)
-    game.print('Test data saved for: '..key)
-end)
- - -
-
-
-
- # - on_unload -
-
-
-
- -

Register a callback that triggers before data is unloaded, returned value is ignored

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - The handler that will be registered to the on_load event - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a handler to on_unload, returned value is ignored, can be used to clean up guis or local values related to this data
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:on_load(function(key, value)
-    game.print('Test data unloaded for: '..key)
-end)
- - -
-
-
-
- # - on_message -
-
-
-
- -

Register a callback that triggers when a message is received, returned value is ignored

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - The handler that will be registered to the on_load event - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a handler to on_message, returned value is ignored, can be used to receive messages from other connected servers without saving data
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:on_message(function(key, value)
-    game.print('Test data message for: '..key)
-end)
- - -
-
-
-
- # - on_update -
-
-
-
- -

Register a callback that triggers any time a value is changed, returned value is ignored

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - The handler that will be registered to the on_load event - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a handler to on_update, returned value is ignored, can be used to update guis or send messages when data is changed
-local ExampleData = Datastore.connect('ExampleData')
-ExampleData:on_update(function(key, value)
-    game.print('Test data updated for: '..key)
-end)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/ExpStyle.html b/docs/core/ExpStyle.html deleted file mode 100644 index f0baf989..00000000 --- a/docs/core/ExpStyle.html +++ /dev/null @@ -1,1366 +0,0 @@ - - - - - - - - ExpStyle core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

ExpStyle core

-

Core Module - ExpStyle

-

- - - - - - - - - - - - - -

Dependencies

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

Elements

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

Functions

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

Dependencies

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

Elements

-
-
-
-
- # - alignment -
-
-
-
- -

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

-

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

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

-

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

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

-

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

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

-

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

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

-

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

A table that is inside a vertical scroll area

-

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

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

-

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

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

-

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

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

-

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

Functions

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

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

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the data label element that you want to update - -
  • - - - - - -
  • - - data - - : - - (any) - - the data that you want to pass to the format function - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating the data to the current game tick
-data_label:update_data_element(element,game.tick)
- - -
-
-
-
- # - data_label:update_from_parent(parent, data) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to the data label element that you want to update - -
  • - - - - - -
  • - - data - - : - - (any) - - the data that you want to pass to the format function - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating the data to the current game tick
-data_label:update_from_parent(parent,game.tick)
- - -
-
-
-
- # - time_label:update_time(element, time) -
-
-
-
- -

Updates the time that is on a label

-

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

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

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the unit label element that you want to update - -
  • - - - - - -
  • - - data - - : - - (any) - - the data that you want to pass to the format function - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating the data to the current game tick
-unit_label:update_data_element(element,game.tick)
- - -
-
-
-
- # - unit_label:update_from_parent(parent, data) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to the unit label element that you want to update - -
  • - - - - - -
  • - - data - - : - - (any) - - the data that you want to pass to the format function - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating the data to the current game tick
-unit_label:update_from_parent(parent,game.tick)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/External.html b/docs/core/External.html deleted file mode 100644 index 3622816d..00000000 --- a/docs/core/External.html +++ /dev/null @@ -1,773 +0,0 @@ - - - - - - - - External core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

External core

-

Core Module - External -- A module used to make accessing externally set data easier.

-

- - - - - - -

Usage

-
-- Printing all server to chat
-local External = require 'expcore.external' --- @dep expcore.external
-
-local message = 'id: %s name: %s version: %s status: %s'
-for server_id, server in pairs(External.get_servers()) do
-    local status = External.get_server_status(server_id)
-    game.print(message:format(server_id, server.name, server.version, status))
-end
- - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
valid()Checks that local links are valid, will try to add the links if invalid
get_servers()Gets a table of all the servers, key is the server id, value is the server details
get_servers_filtered(search)Gets a table of all the servers filtered by name, key is the server id, value is the server details
get_current_server()Gets the details of the current server
get_server_details(server_id)Gets the details of the given server
get_server_status(server_id, raw)Gets the status of the given server
get_server_ups()Gets the ups of the current server
request_connection(player, server_id[, self_requested=false])Connect a player to the given server
- - -
- - -

Functions

-
-
-
-
- # - valid() -
-
-
-
- -

Checks that local links are valid, will try to add the links if invalid

-

- - - - - - Returns: -
    -
  • - (boolean) - If the external data is valid, if false you should not call any other methods from External -
  • -
- - - - - - - - Usage: -
-- Check that external data is valid
-if not External.valid() then
-    -- error code here
-end
- - -
-
-
-
- # - get_servers() -
-
-
-
- -

Gets a table of all the servers, key is the server id, value is the server details

-

- - - - - - Returns: -
    -
  • - (table) - A table containing all the servers, key is the server id, value is the server details -
  • -
- - - - - - - - Usage: -
-- Get all servers
-local servers = External.get_servers()
- - -
-
-
-
- # - get_servers_filtered(search) -
-
-
-
- -

Gets a table of all the servers filtered by name, key is the server id, value is the server details

-

- - - Parameters: - -
    - - - - - -
  • - - search - - : - - (string) - - The string to search for, names, short_names and ids are checked for this string. - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - A table containing all the servers filtered by name, key is the server id, value is the server details -
  • -
- - - - - - - - Usage: -
-- Get all servers with public in the name
-local servers = External.get_servers_filtered(public)
- - -
-
-
-
- # - get_current_server() -
-
-
-
- -

Gets the details of the current server

-

- - - - - - Returns: -
    -
  • - (table) - The details of the current server -
  • -
- - - - - - - - Usage: -
-- Get the details of the current server
-local server = External.get_current_server()
- - -
-
-
-
- # - get_server_details(server_id) -
-
-
-
- -

Gets the details of the given server

-

- - - Parameters: - -
    - - - - - -
  • - - server_id - - : - - (string) - - The internal server if for the server you want the details of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - The details of the given server -
  • -
- - - - - - - - Usage: -
-- Get the details of the given server
-local server = External.get_server_details('eu-01')
- - -
-
-
-
- # - get_server_status(server_id, raw) -
-
-
-
- -

Gets the status of the given server

-

- - - Parameters: - -
    - - - - - -
  • - - server_id - - : - - (string) - - The internal server if for the server you want the status of - -
  • - - - - - -
  • - - raw - - : - - (boolean) - - When true Current will not be returned as status but rather the raw status for the server - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - The status of the given server, one of: Online, Modded, Protected, Current, Offline -
  • -
- - - - - - - - Usage: -
-- Get the status of the given server
-local status = External.get_server_status('eu-01')
- - -
-
-
-
- # - get_server_ups() -
-
-
-
- -

Gets the ups of the current server

-

- - - - - - - - - - - - - Usage: -
-- Get the ups of the current server
-local server_ups = External.get_server_ups()
- - -
-
-
-
- # - request_connection(player, server_id[, self_requested=false]) -
-
-
-
- -

Connect a player to the given server

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - The player that you want to request to join a different server - -
  • - - - - - -
  • - - server_id - - : - - (string) - - The internal id of the server to connect to, can also be any address but this will show Unknown Server - -
  • - - - - - -
  • - - self_requested - - : - - (boolean) - - If the player requested the join them selfs, this will hide the message about being asked to switch - - (default: false) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Request that a player joins a different server
-External.request_connection(player, 'eu-01')
-
-- Request that a player joins a different server, by own request
-External.request_connection(player, 'eu-01', true)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Groups.html b/docs/core/Groups.html deleted file mode 100644 index aaffc7a8..00000000 --- a/docs/core/Groups.html +++ /dev/null @@ -1,1468 +0,0 @@ - - - - - - - - Groups core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Groups core

-

Core Module - Permission Groups -- Permission group making for factorio so you never have to make one by hand again

-

- - - - - - -

Usage

-
--- Example Group (Allow All)
--- here we will create an admin group however we do not want them to use the map editor or mess with the permission groups
-Permission_Groups.new_group('Admin') -- this defines a new group called "Admin"
-:allow_all() -- this makes the default to allow any input action unless set other wise
-:disallow{ -- here we disallow the input action we don't want them to use
-    'add_permission_group',
-    'delete_permission_group',
-    'import_permissions_string',
-    'map_editor_action',
-    'toggle_map_editor'
-}
-
--- Example Group (Disallow All)
--- here we will create a group that cant do anything but talk in chat
-Permission_Groups.new_group('Restricted') -- this defines a new group called "Restricted"
-:disallow_all() -- this makes the default to disallow any input action unless set other wise
-:allow('write_to_console') -- here we allow them to chat, {} can be used here if we had more than one action
-
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
expcore.async
- - -

Getters

- - - - - - - - - - - - - - - - -
new_group(name)Defines a new permission group that can have it actions set in the config
get_group_by_name(name)Returns the group with the given name, case sensitive
get_group_from_player(player)Returns the group that a player is in
- - -

Setters

- - - - - - - - - - - - -
reload_permissions()Reloads/creates all permission groups and sets them to they configured state
set_player_group(player, group)Sets a player's group to the one given, a player can only have one group at a time
- - -

Actions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permissions_Groups._prototype:set_action(action, state)Sets the allow state of an action for this group, used internally but is safe to use else where
Permissions_Groups._prototype:allow(actions)Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime
Permissions_Groups._prototype:disallow(actions)Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime
Permissions_Groups._prototype:allow_all()Sets the default state for any actions not given to be allowed, useful with :disallow
Permissions_Groups._prototype:disallow_all()Sets the default state for any action not given to be disallowed, useful with :allow
Permissions_Groups._prototype:is_allowed(action)Returns if an input action is allowed for this group
- - -

Players

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permissions_Groups._prototype:create()Creates or updates the permission group with the configured actions, used internally
Permissions_Groups._prototype:get_raw()Returns the LuaPermissionGroup that was created with this group object, used internally
Permissions_Groups._prototype:add_player(player)Adds a player to this group
Permissions_Groups._prototype:remove_player(player)Removes a player from this group
Permissions_Groups._prototype:get_players([online])Returns all player that are in this group with the option to filter to online/offline only
Permissions_Groups._prototype:print(message)Prints a message to every player in this group
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Getters

-
-
-
-
- # - new_group(name) -
-
-
-
- -

Defines a new permission group that can have it actions set in the config

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the new group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - the new group made with function to allow and disallow actions -
  • -
- - - - - - - - Usage: -
-- Defining a new permission group
-Groups.new_group('Admin')
- - -
-
-
-
- # - get_group_by_name(name) -
-
-
-
- -

Returns the group with the given name, case sensitive

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the group to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that name or nil if non found -
  • -
- - - - - - - - Usage: -
-- Getting a permision group
-local admin_group = Groups.get_group_by_name('Admin')
- - -
-
-
-
- # - get_group_from_player(player) -
-
-
-
- -

Returns the group that a player is in

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the group of can be name index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that player or nil if non found -
  • -
- - - - - - - - Usage: -
-- Get your permission group
-local group = Groups.get_group_from_player(game.player)
- - -
-
-

Setters

-
-
-
-
- # - reload_permissions() -
-
-
-
- -

Reloads/creates all permission groups and sets them to they configured state

-

- - - - - - - - - - - - - Usage: -
-- Reload the permission groups, used internally
-Groups.reload_permissions()
- - -
-
-
-
- # - set_player_group(player, group) -
-
-
-
- -

Sets a player's group to the one given, a player can only have one group at a time

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to effect can be name index etc - -
  • - - - - - -
  • - - group - - : - - (string) - - the name of the group to give to the player - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Set your permission group
-Groups.set_player_group(game.player, 'Admin')
- - -
-
-

Actions

-
-
-
-
- # - Permissions_Groups._prototype:set_action(action, state) -
-
-
-
- -

Sets the allow state of an action for this group, used internally but is safe to use else where

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string or defines.input_action) - - the action that you want to set the state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - the state that you want to set it to, true = allow, false = disallow - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Set an action to be disallowed
-group:set_action('toggle_map_editor', false)
- - -
-
-
-
- # - Permissions_Groups._prototype:allow(actions) -
-
-
-
- -

Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to allow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Allow some actions
-group:allow{
-    'write_to_console'
-}
- - -
-
-
-
- # - Permissions_Groups._prototype:disallow(actions) -
-
-
-
- -

Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to disallow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Disalow some actions
-group:disallow{
-    'add_permission_group',
-    'delete_permission_group',
-    'import_permissions_string',
-    'map_editor_action',
-    'toggle_map_editor'
-}
- - -
-
-
-
- # - Permissions_Groups._prototype:allow_all() -
-
-
-
- -

Sets the default state for any actions not given to be allowed, useful with :disallow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Allow all actions unless given by disallow
-group:allow_all()
- - -
-
-
-
- # - Permissions_Groups._prototype:disallow_all() -
-
-
-
- -

Sets the default state for any action not given to be disallowed, useful with :allow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Disallow all actions unless given by allow
-group:disallow_all()
- - -
-
-
-
- # - Permissions_Groups._prototype:is_allowed(action) -
-
-
-
- -

Returns if an input action is allowed for this group

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (boolean) - true if the group is allowed the action, false other wise -
  • -
- - - - - - - - Usage: -
-- Test if a group is allowed an action
-local allowed = group:is_allowed('write_to_console')
- - -
-
-

Players

-
-
-
-
- # - Permissions_Groups._prototype:create() -
-
-
-
- -

Creates or updates the permission group with the configured actions, used internally

-

- - - - - - Returns: - - - - - - - - - Usage: -
-- Create the permission group so players can be added, used internally
-group:create()
- - -
-
-
-
- # - Permissions_Groups._prototype:get_raw() -
-
-
-
- -

Returns the LuaPermissionGroup that was created with this group object, used internally

-

- - - - - - Returns: - - - - - - - - - Usage: -
-- Get the factorio api permision group, used internally
-local permission_group = group:get_raw()
- - -
-
-
-
- # - Permissions_Groups._prototype:add_player(player) -
-
-
-
- -

Adds a player to this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to add to this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Add a player to this permission group
-group:add_player(game.player)
- - -
-
-
-
- # - Permissions_Groups._prototype:remove_player(player) -
-
-
-
- -

Removes a player from this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to remove from this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was removed successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Remove a player from this permission group
-group:remove_player(game.player)
- - -
-
-
-
- # - Permissions_Groups._prototype:get_players([online]) -
-
-
-
- -

Returns all player that are in this group with the option to filter to online/offline only

-

- - - Parameters: - -
    - - - - - -
  • - - online - - : - - (boolean) - - if nil returns all players, if true online players only, if false returns online players only - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of players that are in this group; filtered if online param is given -
  • -
- - - - - - - - Usage: -
-- Get all players in this group
-local online_players = group:get_players()
-
-- Get all online players in this group
-local online_players = group:get_players(true)
- - -
-
-
-
- # - Permissions_Groups._prototype:print(message) -
-
-
-
- -

Prints a message to every player in this group

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that you want to send to the players - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of players that received the message -
  • -
- - - - - - - - Usage: -
-- Print a message to all players in thie group
-group:print('Hello, World!')
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Gui.html b/docs/core/Gui.html deleted file mode 100644 index 3d124a79..00000000 --- a/docs/core/Gui.html +++ /dev/null @@ -1,4446 +0,0 @@ - - - - - - - - Gui core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Gui core

-

Core Module - Gui -- Used to simplify gui creation using factory functions called element defines

-

- - - - - - -

Usage

-
-- To draw your element you only need to call the factory function
--- You are able to pass any other arguments that are used in your custom functions but the first is always the parent element
-local example_button_element = example_button(parent_element)
-
-- Making a factory function for a button with the caption "Example Button"
--- This method has all the same features as LuaGuiElement.add
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button'
-}
-
-- Making a factory function for a button which is contained within a flow
--- This method is for when you still want to register event handlers but cant use the table method
-local example_flow_with_button =
-Gui.element(function(event_trigger, parent, ...)
-    -- ... shows that all other arguments from the factory call are passed to this function
-    -- Here we are adding a flow which we will then later add a button to
-    local flow =
-    parent.add{ -- paraent is the element which is passed to the factory function
-        name = 'example_flow',
-        type = 'flow'
-    }
-
-    -- Now we add the button to the flow that we created earlier
-    local element =
-    flow.add{
-        name = event_trigger, -- event_trigger should be the name of any elements you want to trigger your event handlers
-        type = 'button',
-        caption = 'Example Button'
-    }
-
-    -- You must return a new element, this is so styles can be applied and returned to the caller
-    -- You may return any of your elements that you added, consider the context in which it will be used for which should be returned
-    return element
-end)
-
-- Styles can be added to any element define, simplest way mimics LuaGuiElement.style[key] = value
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style{
-    height = 25, -- same as element.style.height = 25
-    width = 100 -- same as element.style.width = 25
-}
-
-- Styles can also have a custom function when the style is dynamic and depends on other factors
--- Use this method if your style is dynamic and depends on other factors
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style(function(style, element, ...)
-    -- style is the current style object for the elemenent
-    -- element is the element that is being changed
-    -- ... shows that all other arguments from the factory call are passed to this function
-    local player = game.players[element.player_index]
-    style.height = 25
-    style.width = 100
-    style.font_color = player.color
-end)
-
-- You are able to register event handlers to your elements, these can be factorio events or custom ones
--- All events are checked to be valid before raising any handlers, this means element.valid = true and player.valid = true
-Gui.element{
-    type = 'button',
-    caption = 'Example Button'
-}
-:on_click(function(player, element, event)
-    -- player is the player who interacted with the element to cause the event
-    -- element is a refrence to the element which caused the event
-    -- event is a raw refrence to the event data if player and element are not enough
-    player.print('Clicked: '..element.name)
-end)
-
-- Example from core_defines, Gui.core_defines.hide_left_flow, called like: hide_left_flow(parent_element)
---- Button which hides the elements in the left flow, shows inside the left flow when frames are visible
--- @element hide_left_flow
-local hide_left_flow =
-Gui.element{
-    type = 'sprite-button',
-    sprite = 'utility/close_black',
-    style = 'tool_button',
-    tooltip = {'expcore-gui.left-button-tooltip'}
-}
-:style{
-    padding = -3,
-    width = 18,
-    height = 20
-}
-:on_click(function(player, _,_)
-    Gui.hide_left_flow(player)
-end)
-
-- Eample from defines, Gui.alignment, called like: Gui.alignment(parent, name, horizontal_align, vertical_align)
--- Notice how _ are used to blank arguments that are not needed in that context and how they line up with above
-Gui.alignment =
-Gui.element(function(_, parent, name, _,_)
-    return parent.add{
-        name = name or 'alignment',
-        type = 'flow',
-    }
-end)
-:style(function(style, _,_, horizontal_align, vertical_align)
-    style.padding = {1, 2}
-    style.vertical_align = vertical_align or 'center'
-    style.horizontal_align = horizontal_align or 'right'
-    style.vertically_stretchable  = style.vertical_align ~= 'center'
-    style.horizontally_stretchable = style.horizontal_align ~= 'center'
-end)
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
mod-gui
- - -

Tables

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
eventsString indexed table used to avoid conflict with custom event names, similar to how defines.events works
definesUid indexed array that stores all the factory functions that were defined, no new values will be added during runtime
core_definesAn string indexed table of all the defines which are used by the core of the gui system, used for internal refrence
file_pathsUsed to store the file names where elements were defined, this can be useful to find the uid of an element, mostly for debuging
debug_infoUsed to store extra infomation about elements as they get defined such as the params used and event handlers registered to them
_prototype_elementThe prototype used to store the functions of an element define
_mt_elementThe prototype metatable applied to new element defines
- - -

Fields

- - - - - - - - -
uidThe current highest uid that is being used by a define, will not increase during runtime
- - -

Core Defines

- - - - - - - - - - - - - - - - -
hide_top_flowButton which toggles the top flow elements, version which shows inside the top flow when top flow is visible
show_top_flowButton which toggles the top flow elements, version which shows inside the left flow when top flow is hidden
hide_left_flowButton which hides the elements in the left flow, shows inside the left flow when frames are visible
- - -

Defines

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
alignmentDraw a flow used to align its child elements, default is right align
scroll_tableDraw a scroll pane that has a table inside of it
headerUsed to add a frame with the header style, has the option for a right alignment flow for buttons
footerUsed to add a frame with the footer style, has the option for a right alignment flow for buttons
containerUsed for left frames to give them a nice boarder
barUsed to make a solid white bar in a gui
centered_labelUsed to make a label which is centered and of a certian size
title_labelUsed to make a title which has two bars on either side
- - -

Helper Functions

- - - - - - - - - - - - - - - - - - - - - - - - -
get_player_from_element(element)Get the player that owns a gui element
toggle_enabled_state(element[, state])Will toggle the enabled state of an element or set it to the one given
toggle_visible_state(element[, state])Will toggle the visible state of an element or set it to the one given
destroy_if_valid(element)Destory a gui element without causing any errors, often because the element was already removed
sprite_style(size[, padding=-2][, style])Returns a table to be used as the style for a sprite buttons, produces a sqaure button
- - -

Left Flow

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
left_elementsContains the uids of the elements that will shown on the left flow and their join functions
get_left_flow(player)Gets the flow refered to as the left flow, each player has one left flow
Gui._prototype_element:add_to_left_flow([open_on_join])Sets an element define to be drawn to the left flow when a player joins, includes optional check
left_toolbar_button(sprite, tooltip, element_define[, authenticator])Creates a button on the top flow which will toggle the given element define, the define must exist in the left flow
draw_left_flow(player)Draw all the left elements onto the left flow, internal use only with on join
update_left_flow(player)Update the visible state of the hide button, can be used to check if any frames are visible
hide_left_flow(player)Hides all left elements for a player
get_left_element(player, element_define)Get the element define that is in the left flow, use in events without an element refrence
toggle_left_element(player, element_define[, state])Toggles the visible state of a left element for a given player, can be used to set the visible state
- - -

Element Define

- - - - - - - - - - - - - - - - - - - - -
element(element_define)Used to define new elements for your gui, can be used like LuaGuiElement.add or a custom function
Gui._prototype_element:style(style_define)Used to extent your element define with a style factory, this style will be applied to your element when created, can also be a custom function
Gui._prototype_element:on_custom_event(event_name, handler)Set the handler which will be called for a custom event, only one handler can be used per event per element
Gui._prototype_element:raise_custom_event(event)Raise the handler which is attached to an event; external use should be limited to custom events
- - -

Element Events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gui._prototype_element.on_openCalled when the player opens a GUI.
Gui._prototype_element.on_closeCalled when the player closes the GUI they have open.
Gui._prototype_element.on_clickCalled when LuaGuiElement is clicked.
Gui._prototype_element.on_confirmedCalled when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.
Gui._prototype_element.on_checked_changedCalled when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).
Gui._prototype_element.on_elem_changedCalled when LuaGuiElement element value is changed (related to choose element buttons).
Gui._prototype_element.on_location_changedCalled when LuaGuiElement element location is changed (related to frames in player.gui.screen).
Gui._prototype_element.on_tab_changedCalled when LuaGuiElement selected tab is changed (related to tabbed-panes).
Gui._prototype_element.on_selection_changedCalled when LuaGuiElement selection state is changed (related to drop-downs and listboxes).
Gui._prototype_element.on_switch_changedCalled when LuaGuiElement switch state is changed (related to switches).
Gui._prototype_element.on_text_changedCalled when LuaGuiElement text is changed by the player.
Gui._prototype_element.on_value_changedCalled when LuaGuiElement slider value is changed (related to the slider element).
- - -

Top Flow

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
top_elementsContains the uids of the elements that will shown on the top flow and their auth functions
top_flow_button_styleThe style that should be used for buttons on the top flow
top_flow_button_visible_styleThe style that should be used for buttons on the top flow when their flow is visible
get_top_flow(player)Gets the flow refered to as the top flow, each player has one top flow
Gui._prototype_element:add_to_top_flow([authenticator])Sets an element define to be drawn to the top flow when a player joins, includes optional authenticator
update_top_flow(player)Updates the visible state of all the elements on the players top flow, uses authenticator
toggle_top_flow(player[, state])Toggles the visible state of all the elements on a players top flow, effects all elements
get_top_element(player, element_define)Get the element define that is in the top flow, use in events without an element refrence
toolbar_button(sprite, tooltip[, authenticator])Creates a button on the top flow with consistent styling
toolbar_button_style(button, state)Styles a top flow button depending on the state given
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Tables

-
-
-
-
- # - events -
-
-
-
- -

String indexed table used to avoid conflict with custom event names, similar to how defines.events works

-

- - - - - - - - - - - - - - -
-
-
-
- # - defines -
-
-
-
- -

Uid indexed array that stores all the factory functions that were defined, no new values will be added during runtime

-

- - - - - - - - - - - - - - -
-
-
-
- # - core_defines -
-
-
-
- -

An string indexed table of all the defines which are used by the core of the gui system, used for internal refrence

-

- - - - - - - - - - - - - - -
-
-
-
- # - file_paths -
-
-
-
- -

Used to store the file names where elements were defined, this can be useful to find the uid of an element, mostly for debuging

-

- - - - - - - - - - - - - - -
-
-
-
- # - debug_info -
-
-
-
- -

Used to store extra infomation about elements as they get defined such as the params used and event handlers registered to them

-

- - - - - - - - - - - - - - -
-
-
-
- # - _prototype_element -
-
-
-
- -

The prototype used to store the functions of an element define

-

- - - - - - - - - - - - - - -
-
-
-
- # - _mt_element -
-
-
-
- -

The prototype metatable applied to new element defines

-

- - - Fields: - -
    - - - - - -
  • - - __call - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - uid -
-
-
-
- -

The current highest uid that is being used by a define, will not increase during runtime

-

- - - - - - - - - - - - - - -
-
-

Core Defines

-
-
-
-
- # - hide_top_flow -
-
-
-
- -

Button which toggles the top flow elements, version which shows inside the top flow when top flow is visible

-

- - - - - - - - - - - - - - -
-
-
-
- # - show_top_flow -
-
-
-
- -

Button which toggles the top flow elements, version which shows inside the left flow when top flow is hidden

-

- - - - - - - - - - - - - - -
-
-
-
- # - hide_left_flow -
-
-
-
- -

Button which hides the elements in the left flow, shows inside the left flow when frames are visible

-

- - - - - - - - - - - - - - -
-
-

Defines

-
-
-
-
- # - alignment -
-
-
-
- -

Draw a flow used to align its child elements, default is right align

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the alignment will be added - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the alignment flow which is added - - (default: 'alignment') -
  • - - - - - -
  • - - horizontal_align - - : - - (string) - - the horizontal alignment of the elements in the flow - - (default: 'right') -
  • - - - - - -
  • - - vertical_align - - : - - (string) - - the vertical alignment of the elements in the flow - - (default: 'center') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a right align flow
-local alignment = Gui.alignment(element, 'example_right_alignment')
-
-- Adding a horizontal center and top align flow
-local alignment = Gui.alignment(element, 'example_center_top_alignment', 'center', 'top')
- - -
-
-
-
- # - scroll_table -
-
-
-
- -

Draw a scroll pane that has a table inside of it

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the scroll table will be added - -
  • - - - - - -
  • - - height - - : - - (number) - - the maximum height for the scroll pane - -
  • - - - - - -
  • - - column_count - - : - - (number) - - the number of columns that the table will have - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the scroll pane that is added, the table is always called "table" - - (default: 'scroll') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a scroll table with max height of 200 and column count of 3
-local scroll_table = Gui.scroll_table(element, 200, 3)
- - -
-
-
-
- # - header -
-
-
-
- -

Used to add a frame with the header style, has the option for a right alignment flow for buttons

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the header will be added - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the header - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the header - - (optional) -
  • - - - - - -
  • - - add_alignment - - : - - (boolean) - - when true an alignment flow will be added to the header - - (default: false) -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the header that is being added, the alignment is always called "alignment" - - (default: 'header') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a custom header with a label
-local header = Gui.header(
-    element,
-    'Example Caption',
-    'Example Tooltip'
-)
- - -
-
-
-
- # - footer -
-
-
-
- -

Used to add a frame with the footer style, has the option for a right alignment flow for buttons

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the footer will be added - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the footer - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the footer - - (optional) -
  • - - - - - -
  • - - add_alignment - - : - - (boolean) - - when true an alignment flow will be added to the footer - - (default: false) -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the footer that is being added, the alignment is always called "alignment" - - (default: 'footer') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a custom footer with a label
-local footer = Gui.footer(
-    element,
-    'Example Caption',
-    'Example Tooltip'
-)
- - -
-
-
-
- # - container -
-
-
-
- -

Used for left frames to give them a nice boarder

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the container will be added - -
  • - - - - - -
  • - - name - - : - - (string) - - the name that you want to give to the outer frame, often just event_trigger - -
  • - - - - - -
  • - - width - - : - - (number) - - the minimal width that the frame will have - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a container as a base
-local container = Gui.container(parent, 'my_container', 200)
- - -
-
-
-
- # - bar -
-
-
-
- -

Used to make a solid white bar in a gui

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the bar will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the bar that will be made, if not given bar will strech to fill the parent - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a bar to a gui
-local bar = Gui.bar(parent, 100)
- - -
-
-
-
- # - centered_label -
-
-
-
- -

Used to make a label which is centered and of a certian size

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the label will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the label, must be given in order to center the caption - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the label - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the label - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a centered label
-local label = Gui.centered_label(parent, 100, 'This is centered')
- - -
-
-
-
- # - title_label -
-
-
-
- -

Used to make a title which has two bars on either side

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the label will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the first bar, this can be used to position the label - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the label - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the label - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a centered label
-local label = Gui.centered_label(parent, 100, 'This is centered')
- - -
-
-

Helper Functions

-
-
-
-
- # - get_player_from_element(element) -
-
-
-
- -

Get the player that owns a gui element

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to get the owner of - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaPlayer) - the player that owns this element -
  • -
- - - - - - - - Usage: -
-- Geting the owner of an element
-local player = Gui.get_player_from_element(element)
- - -
-
-
-
- # - toggle_enabled_state(element[, state]) -
-
-
-
- -

Will toggle the enabled state of an element or set it to the one given

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to toggle/set the enabled state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new enabled state that the element has -
  • -
- - - - - - - - Usage: -
-- Toggling the the enabled state
-local new_enabled_state = Gui.toggle_enabled_state(element)
- - -
-
-
-
- # - toggle_visible_state(element[, state]) -
-
-
-
- -

Will toggle the visible state of an element or set it to the one given

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to toggle/set the visible state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state that the element has -
  • -
- - - - - - - - Usage: -
-- Toggling the the visible state
-local new_visible_state = Gui.toggle_visible_state(element)
- - -
-
-
-
- # - destroy_if_valid(element) -
-
-
-
- -

Destory a gui element without causing any errors, often because the element was already removed

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that you want to remove - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the element was valid and has been removed -
  • -
- - - - - - - - Usage: -
-- Remove a child element if it exists
-Gui.destroy_if_valid(element[child_name])
- - -
-
-
-
- # - sprite_style(size[, padding=-2][, style]) -
-
-
-
- -

Returns a table to be used as the style for a sprite buttons, produces a sqaure button

-

- - - Parameters: - -
    - - - - - -
  • - - size - - : - - (number) - - the size that you want the button to be - -
  • - - - - - -
  • - - padding - - : - - (number) - - the padding that you want on the sprite - - (default: -2) -
  • - - - - - -
  • - - style - - : - - (table) - - any extra style settings that you want to have - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the style table to be used with element_define:style() -
  • -
- - - - - - - - Usage: -
-- Adding a sprite button with size 20
-local button =
-Gui.element{
-    type = 'sprite-button',
-    sprite = 'entity/inserter'
-}
-:style(Gui.sprite_style(20))
- - -
-
-

Left Flow

-
-
-
-
- # - left_elements -
-
-
-
- -

Contains the uids of the elements that will shown on the left flow and their join functions

-

- - - - - - - - - - - - - - -
-
-
-
- # - get_left_flow(player) -
-
-
-
- -

Gets the flow refered to as the left flow, each player has one left flow

-

(player)

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the left flow for - -
  • - - -
- - - - - Returns: - - - - - - - - - Usage: -
-- Geting your left flow
-local left_flow = Gui.get_left_flow(game.player)
- - -
-
-
-
- # - Gui._prototype_element:add_to_left_flow([open_on_join]) -
-
-
-
- -

Sets an element define to be drawn to the left flow when a player joins, includes optional check

-

- - - Parameters: - -
    - - - - - -
  • - - open_on_join - - : - - (boolean or function) - - called during first darw to decide if the element should be visible - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define that is used to register events to this element -
  • -
- - - - - - - - Usage: -
-- Adding the example button
-example_flow_with_button:add_to_left_flow(true)
- - -
-
-
-
- # - left_toolbar_button(sprite, tooltip, element_define[, authenticator]) -
-
-
-
- -

Creates a button on the top flow which will toggle the given element define, the define must exist in the left flow

-

- - - Parameters: - -
    - - - - - -
  • - - sprite - - : - - (string) - - the sprite that you want to use on the button - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that you want the button to have - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element define that you want to have toggled by this button, define must exist on the left flow - -
  • - - - - - -
  • - - authenticator - - : - - (function) - - used to decide if the button should be visible to a player - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a button to toggle a left element
-local toolbar_button =
-Gui.left_toolbar_button('entity/inserter', 'Nothing to see here', example_flow_with_button, function(player)
-    return player.admin
-end)
- - -
-
-
-
- # - draw_left_flow(player) -
-
-
-
- -

Draw all the left elements onto the left flow, internal use only with on join

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to draw the elements for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Draw all the left elements
-Gui.draw_left_flow(player)
- - -
-
-
-
- # - update_left_flow(player) -
-
-
-
- -

Update the visible state of the hide button, can be used to check if any frames are visible

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to update the left flow for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if any left element is visible -
  • -
- - - - - - - - Usage: -
-- Check if any left elements are visible
-local visible = Gui.update_left_flow(player)
- - -
-
-
-
- # - hide_left_flow(player) -
-
-
-
- -

Hides all left elements for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to hide the elements for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Hide your left elements
-Gui.hide_left_flow(game.player)
- - -
-
-
-
- # - get_left_element(player, element_define) -
-
-
-
- -

Get the element define that is in the left flow, use in events without an element refrence

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the gui element linked to this define for this player -
  • -
- - - - - - - - Usage: -
-- Get your left element
-local frame = Gui.get_left_element(game.player, example_flow_with_button)
- - -
-
-
-
- # - toggle_left_element(player, element_define[, state]) -
-
-
-
- -

Toggles the visible state of a left element for a given player, can be used to set the visible state

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to toggle the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to toggle - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state of the element -
  • -
- - - - - - - - Usage: -
-- Toggle your example button
-Gui.toggle_top_flow(game.player, example_flow_with_button)
-
-- Show your example button
-Gui.toggle_top_flow(game.player, example_flow_with_button, true)
- - -
-
-

Element Define

-
-
-
-
- # - element(element_define) -
-
-
-
- -

Used to define new elements for your gui, can be used like LuaGuiElement.add or a custom function

-

- - - Parameters: - -
    - - - - - -
  • - - element_define - - : - - (table or function) - - the define information for the gui element, same data as LuaGuiElement.add, or a custom function may be used - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define, this can be considered a factory for the element which can be called to draw the element to any other element -
  • -
- - - - - - - - Usage: -
-- Using element defines like LuaGuiElement.add
--- This returns a factory function to draw a button with the caption "Example Button"
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button'
-}
-
-- Using element defines with a custom factory function
--- This method can be used if you still want to be able register event handlers but it is too complex to be compatible with LuaGuiElement.add
-local example_flow_with_button =
-Gui.element(function(event_trigger, parent, ...)
-    -- ... shows that all other arguments from the factory call are passed to this function
-    -- parent is the element which was passed to the factory function where you should add your new element
-    -- here we are adding a flow which we will then later add a button to
-    local flow =
-    parent.add{
-        name = 'example_flow',
-        type = 'flow'
-    }
-
-    -- event_trigger should be the name of any elements you want to trigger your event handlers, such as on_click or on_state_changed
-    -- now we add the button to the flow that we created earlier
-    local element =
-    flow.add{
-        name = event_trigger,
-        type = 'button',
-        caption = 'Example Button'
-    }
-
-    -- you must return your new element, this is so styles can be applied and returned to the caller
-    -- you may return any of your elements that you add, consider the context in which it will be used for what should be returned
-    return element
-end)
- - -
-
-
-
- # - Gui._prototype_element:style(style_define) -
-
-
-
- -

Used to extent your element define with a style factory, this style will be applied to your element when created, can also be a custom function

-

- - - Parameters: - -
    - - - - - -
  • - - style_define - - : - - (table or function) - - style table where each key and value pair is treated like LuaGuiElement.style[key] = value, a custom function can be used - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define is returned to allow for event handlers to be registered -
  • -
- - - - - - - - Usage: -
-- Using the table method of setting the style
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style{
-    height = 25, -- same as element.style.height = 25
-    width = 100 -- same as element.style.width = 25
-}
-
-- Using the function method to set the style
--- Use this method if your style is dynamic and depends on other factors
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style(function(style, element, ...)
-    -- style is the current style object for the elemenent
-    -- element is the element that is being changed
-    -- ... shows that all other arguments from the factory call are passed to this function
-    local player = game.players[element.player_index]
-    style.height = 25
-    style.width = 100
-    style.font_color = player.color
-end)
- - -
-
-
-
- # - Gui._prototype_element:on_custom_event(event_name, handler) -
-
-
-
- -

Set the handler which will be called for a custom event, only one handler can be used per event per element

-

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - (string) - - the name of the event you want to handler to be called on, often from Gui.events - -
  • - - - - - -
  • - - handler - - : - - (function) - - the handler that you want to be called when the event is raised - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define so more handleres can be registered -
  • -
- - - - - - - - Usage: -
-- Register a handler to "my_custom_event" for this element
-element_deinfe:on_custom_event('my_custom_event', function(event)
-    event.player.print(player.name)
-end)
- - -
-
-
-
- # - Gui._prototype_element:raise_custom_event(event) -
-
-
-
- -

Raise the handler which is attached to an event; external use should be limited to custom events

-

- - - Parameters: - -
    - - - - - -
  • - - event - - : - - (table) - - the event table passed to the handler, must contain fields: name, element - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define so more events can be raised -
  • -
- - - - - - - - Usage: -
 Raising a custom event
-element_define:raise_custom_event{
-    name = 'my_custom_event',
-    element = element
-}
- - -
-
-

Element Events

-
-
-
-
- # - Gui._prototype_element.on_open -
-
-
-
- -

Called when the player opens a GUI.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_open(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_close -
-
-
-
- -

Called when the player closes the GUI they have open.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_close(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_click -
-
-
-
- -

Called when LuaGuiElement is clicked.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_click(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_confirmed -
-
-
-
- -

Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_confirmed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_checked_changed -
-
-
-
- -

Called when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_checked_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_elem_changed -
-
-
-
- -

Called when LuaGuiElement element value is changed (related to choose element buttons).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_elem_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_location_changed -
-
-
-
- -

Called when LuaGuiElement element location is changed (related to frames in player.gui.screen).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_location_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_tab_changed -
-
-
-
- -

Called when LuaGuiElement selected tab is changed (related to tabbed-panes).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_tab_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_selection_changed -
-
-
-
- -

Called when LuaGuiElement selection state is changed (related to drop-downs and listboxes).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_selection_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_switch_changed -
-
-
-
- -

Called when LuaGuiElement switch state is changed (related to switches).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_switch_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_text_changed -
-
-
-
- -

Called when LuaGuiElement text is changed by the player.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_text_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-
-
- # - Gui._prototype_element.on_value_changed -
-
-
-
- -

Called when LuaGuiElement slider value is changed (related to the slider element).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - Usage: -
 element_define:on_value_changed(function(event)
-  event.player.print(table.inspect(event))
-end)
- - -
-
-

Top Flow

-
-
-
-
- # - top_elements -
-
-
-
- -

Contains the uids of the elements that will shown on the top flow and their auth functions

-

- - - - - - - - - - - - - - -
-
-
-
- # - top_flow_button_style -
-
-
-
- -

The style that should be used for buttons on the top flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - top_flow_button_visible_style -
-
-
-
- -

The style that should be used for buttons on the top flow when their flow is visible

-

- - - - - - - - - - - - - - -
-
-
-
- # - get_top_flow(player) -
-
-
-
- -

Gets the flow refered to as the top flow, each player has one top flow

-

(player)

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the flow for - -
  • - - -
- - - - - Returns: - - - - - - - - - Usage: -
-- Geting your top flow
-local top_flow = Gui.get_top_flow(game.player)
- - -
-
-
-
- # - Gui._prototype_element:add_to_top_flow([authenticator]) -
-
-
-
- -

Sets an element define to be drawn to the top flow when a player joins, includes optional authenticator

-

- - - Parameters: - -
    - - - - - -
  • - - authenticator - - : - - (function) - - called during toggle or update to decide weather the element should be visible - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define to allow event handlers to be registered -
  • -
- - - - - - - - Usage: -
-- Adding an element to the top flow on join
-example_button:add_to_top_flow(function(player)
-    -- example button will only be shown if the player is an admin
-    -- note button will not update its state when player.admin is changed Gui.update_top_flow must be called for this
-    return player.admin
-end)
- - -
-
-
-
- # - update_top_flow(player) -
-
-
-
- -

Updates the visible state of all the elements on the players top flow, uses authenticator

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to update the top flow for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Update your top flow
-Gui.update_top_flow(game.player)
- - -
-
-
-
- # - toggle_top_flow(player[, state]) -
-
-
-
- -

Toggles the visible state of all the elements on a players top flow, effects all elements

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to toggle the top flow for - -
  • - - - - - -
  • - - state - - : - - (boolean) - - if given then the state will be set to this - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state of the top flow -
  • -
- - - - - - - - Usage: -
-- Toggle your flow
-Gui.toggle_top_flow(game.player)
-
-- Open your top flow
-Gui.toggle_top_flow(game.player, true)
- - -
-
-
-
- # - get_top_element(player, element_define) -
-
-
-
- -

Get the element define that is in the top flow, use in events without an element refrence

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the gui element linked to this define for this player -
  • -
- - - - - - - - Usage: -
-- Get your top element
-local button = Gui.get_top_element(game.player, example_button)
- - -
-
-
-
- # - toolbar_button(sprite, tooltip[, authenticator]) -
-
-
-
- -

Creates a button on the top flow with consistent styling

-

- - - Parameters: - -
    - - - - - -
  • - - sprite - - : - - (string) - - the sprite that you want to use on the button - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that you want the button to have - -
  • - - - - - -
  • - - authenticator - - : - - (function) - - used to decide if the button should be visible to a player - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a button to the toolbar
-local toolbar_button =
-Gui.left_toolbar_button('entity/inserter', 'Nothing to see here', function(player)
-    return player.admin
-end)
- - -
-
-
-
- # - toolbar_button_style(button, state) -
-
-
-
- -

Styles a top flow button depending on the state given

-

- - - Parameters: - -
    - - - - - -
  • - - button - - : - - (LuaGuiElement) - - the button element to style - -
  • - - - - - -
  • - - state - - : - - (boolean) - - The state the button is in - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Sets the button to the visible style
-Gui.toolbar_button_style(button, true)
-
-- Sets the button to the hidden style
-Gui.toolbar_button_style(button, false)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Permissions-Groups.html b/docs/core/Permissions-Groups.html deleted file mode 100644 index 41fde465..00000000 --- a/docs/core/Permissions-Groups.html +++ /dev/null @@ -1,1435 +0,0 @@ - - - - - - - - Permissions-Groups core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Permissions-Groups core

-

Core Module - Permission Groups -- Permission group making for factorio so you never have to make one by hand again

-

- - - - - - -

Usage

-
--- Example Group (Allow All)
--- here we will create an admin group however we do not want them to use the map editor or mess with the permission groups
-Permission_Groups.new_group('Admin') -- this defines a new group called "Admin"
-:allow_all() -- this makes the default to allow any input action unless set other wise
-:disallow{ -- here we disallow the input action we don't want them to use
-    'add_permission_group',
-    'delete_permission_group',
-    'import_permissions_string',
-    'map_editor_action',
-    'toggle_map_editor'
-}
-
--- Example Group (Disallow All)
--- here we will create a group that cant do anything but talk in chat
-Permission_Groups.new_group('Restricted') -- this defines a new group called "Restricted"
-:disallow_all() -- this makes the default to disallow any input action unless set other wise
-:allow('write_to_console') -- here we allow them to chat, {} can be used here if we had more than one action
-
- - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
expcore.async
- - -

Getters

- - - - - - - - - - - - - - - - -
new_group(name)Defines a new permission group that can have it actions set in the config
get_group_by_name(name)Returns the group with the given name, case sensitive
get_group_from_player(player)Returns the group that a player is in
- - -

Setters

- - - - - - - - - - - - -
reload_permissions()Reloads/creates all permission groups and sets them to they configured state
set_player_group(player, group)Sets a player's group to the one given, a player can only have one group at a time
- - -

Actions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permissions_Groups._prototype:set_action(action, state)Sets the allow state of an action for this group, used internally but is safe to use else where
Permissions_Groups._prototype:allow(actions)Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime
Permissions_Groups._prototype:disallow(actions)Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime
Permissions_Groups._prototype:allow_all()Sets the default state for any actions not given to be allowed, useful with :disallow
Permissions_Groups._prototype:disallow_all()Sets the default state for any action not given to be disallowed, useful with :allow
Permissions_Groups._prototype:is_allowed(action)Returns if an input action is allowed for this group
- - -

Players

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permissions_Groups._prototype:create()Creates or updates the permission group with the configured actions, used internally
Permissions_Groups._prototype:get_raw()Returns the LuaPermissionGroup that was created with this group object, used internally
Permissions_Groups._prototype:add_player(player)Adds a player to this group
Permissions_Groups._prototype:remove_player(player)Removes a player from this group
Permissions_Groups._prototype:get_players([online])Returns all player that are in this group with the option to filter to online/offline only
Permissions_Groups._prototype:print(message)Prints a message to every player in this group
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Getters

-
-
-
-
- # - new_group(name) -
-
-
-
- -

Defines a new permission group that can have it actions set in the config

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the new group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - the new group made with function to allow and disallow actions -
  • -
- - - - - - - - Usage: -
-- Defining a new permission group
-Groups.new_group('Admin')
- - -
-
-
-
- # - get_group_by_name(name) -
-
-
-
- -

Returns the group with the given name, case sensitive

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the group to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that name or nil if non found -
  • -
- - - - - - - - Usage: -
-- Getting a permision group
-local admin_group = Groups.get_group_by_name('Admin')
- - -
-
-
-
- # - get_group_from_player(player) -
-
-
-
- -

Returns the group that a player is in

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the group of can be name index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that player or nil if non found -
  • -
- - - - - - - - Usage: -
-- Get your permission group
-local group = Groups.get_group_from_player(game.player)
- - -
-
-

Setters

-
-
-
-
- # - reload_permissions() -
-
-
-
- -

Reloads/creates all permission groups and sets them to they configured state

-

- - - - - - - - - - - - - Usage: -
-- Reload the permission groups, used internally
-Groups.reload_permissions()
- - -
-
-
-
- # - set_player_group(player, group) -
-
-
-
- -

Sets a player's group to the one given, a player can only have one group at a time

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to effect can be name index etc - -
  • - - - - - -
  • - - group - - : - - (string) - - the name of the group to give to the player - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Set your permission group
-Groups.set_player_group(game.player, 'Admin')
- - -
-
-

Actions

-
-
-
-
- # - Permissions_Groups._prototype:set_action(action, state) -
-
-
-
- -

Sets the allow state of an action for this group, used internally but is safe to use else where

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string or defines.input_action) - - the action that you want to set the state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - the state that you want to set it to, true = allow, false = disallow - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Set an action to be disalowed
-group:set_action('toggle_map_editor', false)
- - -
-
-
-
- # - Permissions_Groups._prototype:allow(actions) -
-
-
-
- -

Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to allow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Allow some actions
-group:allow{
-    'write_to_console'
-}
- - -
-
-
-
- # - Permissions_Groups._prototype:disallow(actions) -
-
-
-
- -

Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to disallow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Disalow some actions
-group:disallow{
-    'add_permission_group',
-    'delete_permission_group',
-    'import_permissions_string',
-    'map_editor_action',
-    'toggle_map_editor'
-}
- - -
-
-
-
- # - Permissions_Groups._prototype:allow_all() -
-
-
-
- -

Sets the default state for any actions not given to be allowed, useful with :disallow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Allow all actions unless given by disallow
-group:allow_all()
- - -
-
-
-
- # - Permissions_Groups._prototype:disallow_all() -
-
-
-
- -

Sets the default state for any action not given to be disallowed, useful with :allow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - Usage: -
-- Disallow all actions unless given by allow
-group:disallow_all()
- - -
-
-
-
- # - Permissions_Groups._prototype:is_allowed(action) -
-
-
-
- -

Returns if an input action is allowed for this group

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (boolean) - true if the group is allowed the action, false other wise -
  • -
- - - - - - - - Usage: -
-- Test if a group is allowed an action
-local allowed = group:is_allowed('write_to_console')
- - -
-
-

Players

-
-
-
-
- # - Permissions_Groups._prototype:create() -
-
-
-
- -

Creates or updates the permission group with the configured actions, used internally

-

- - - - - - Returns: - - - - - - - - - Usage: -
-- Create the permission group so players can be added, used internally
-group:create()
- - -
-
-
-
- # - Permissions_Groups._prototype:get_raw() -
-
-
-
- -

Returns the LuaPermissionGroup that was created with this group object, used internally

-

- - - - - - Returns: - - - - - - - - - Usage: -
-- Get the factorio api permision group, used internally
-local permission_group = group:get_raw()
- - -
-
-
-
- # - Permissions_Groups._prototype:add_player(player) -
-
-
-
- -

Adds a player to this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to add to this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Add a player to this permission group
-group:add_player(game.player)
- - -
-
-
-
- # - Permissions_Groups._prototype:remove_player(player) -
-
-
-
- -

Removes a player from this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to remove from this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was removed successfully, false other wise -
  • -
- - - - - - - - Usage: -
-- Remove a player from this permission group
-group:remove_player(game.player)
- - -
-
-
-
- # - Permissions_Groups._prototype:get_players([online]) -
-
-
-
- -

Returns all player that are in this group with the option to filter to online/offline only

-

- - - Parameters: - -
    - - - - - -
  • - - online - - : - - (boolean) - - if nil returns all players, if true online players only, if false returns online players only - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of players that are in this group; filtered if online param is given -
  • -
- - - - - - - - Usage: -
-- Get all players in this group
-local online_players = group:get_players()
-
-- Get all online players in this group
-local online_players = group:get_players(true)
- - -
-
-
-
- # - Permissions_Groups._prototype:print(message) -
-
-
-
- -

Prints a message to every player in this group

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that you want to send to the players - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of players that received the message -
  • -
- - - - - - - - Usage: -
-- Print a message to all players in thie group
-group:print('Hello, World!')
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/PlayerData.html b/docs/core/PlayerData.html deleted file mode 100644 index 43400919..00000000 --- a/docs/core/PlayerData.html +++ /dev/null @@ -1,556 +0,0 @@ - - - - - - - - PlayerData core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

PlayerData core

-

Core Module - PlayerData -- A module used to store player data in a central datastore to minimize data requests and saves.

-

- - - - - - -

Usage

-
-- Adding a colour setting for players
-local PlayerData = require 'expcore.player_data'
-local PlayerColors = PlayerData.Settings:combine('Color')
-
--- Set the players color when their data is loaded
-PlayerColors:on_load(function(player_name, color)
-    local player = game.players[player_name]
-    player.color = color
-end)
-
--- Overwrite the saved color with the players current color
-PlayerColors:on_save(function(player_name, _)
-    local player = game.players[player_name]
-    return player.color -- overwrite existing data with the current color
-end)
-
-- Add a playtime statistic for players
-local Event = require 'utils.event'
-local PlayerData = require 'expcore.player_data'
-local Playtime = PlayerData.Statistics:combine('Playtime')
-
--- When playtime reaches an hour interval tell the player and say thanks
-Playtime:on_update(function(player_name, playtime)
-    if playtime % 60 == 0 then
-        local hours = playtime / 60
-        local player = game.players[player_name]
-        player.print('Thanks for playing on our servers, you have played for '..hours..' hours!')
-    end
-end)
-
--- Update playtime for players, data is only loaded for online players so update_all can be used
-Event.add_on_nth_tick(3600, function()
-    Playtime:update_all(function(player_name, playtime)
-        return playtime + 1
-    end)
-end)
- - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
utils.event
expcore.async
expcore.datastore
expcore.commands
config.expcore.command_general_parse
- - -

Commands

- - - - - - - - - - - - -
set-data-preferenceSets your data saving preference
data-preferenceGets your data saving preference
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.expcore.command_general_parse -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - set-data-preference -
-
-
-
- -

Sets your data saving preference

-

- - - - - - - - - - - - - - -
-
-
-
- # - data-preference -
-
-
-
- -

Gets your data saving preference

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Roles.html b/docs/core/Roles.html deleted file mode 100644 index c1d9cdea..00000000 --- a/docs/core/Roles.html +++ /dev/null @@ -1,3416 +0,0 @@ - - - - - - - - Roles core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Roles core

-

Core Module - Roles -- Factorio role system to manage custom permissions.

-

- - - - - - -

Usage

-
--- Using Role System (assignment):
---When a map first starts you will want to define on mass all the players you expect to join and the roles to give them:
-Roles.override_player_roles{
-    Cooldude2606 = {'Owner', 'Admin', 'Member'},
-    NotCooldude2606 = {'Member'}
-}
-
---Once the game is running you still want to be able to give role and remove them which is when you would use:
-Roles.assign_player(player, 'Admin', by_player_name) -- this will give the "Admin" role to the player
-Roles.unassign_player(player, {'Admin', 'Moderator'}, by_player_name) -- this will remove "Admin" and "Moderator" role in one go
-
-
--- Using Role System (role testing):
---To comparer two players you can comparer the index of they highest roles, can be used when you want to allow a "write" down type system:
-Roles.get_player_highest_role(playerOne).index < Roles.get_player_highest_role(playerTwo).index -- remember that less means a higher role
-
---Listing all of a players roles can also be useful which is when you would want to use:
-Roles.get_player_roles(player) -- the return is an array that can be looped over however this is not in particular order
-
---Finally you may want to test if a player has a certain role, flag or action allowed which is when you would use:
-Roles.player_has_role(player, 'Admin') -- you can provide a role name if you only want a name based system
-Roles.player_has_flag(player, 'is_donator') -- your roles can be grouped together with flags such as is_donator
-Roles.player_allowed(player, 'game modifiers') -- or you can have an action based system where each action is something the player can do
-
-
--- Example Flag Define:
---Flags can be used to group multiple roles and actions under one catch all, for example if you want a piece of code to only
---be active for your donators then you would add a "is_donator" flag to all your donator roles and then in the code test if
---a player has that tag present:
-
--- give you donators a speed boost when they join; these functions aren't required but can be useful
-Roles.define_flag_trigger('is_donator', function(player, state)
-    if state then
-        player.character_running_speed_modifier = 1.5
-    else
-        player.character_running_speed_modifier = 1
-    end
-end)
-
--- then on all your donator roles you would add
-Roles.new_role('Donator')
-:set_flag('is_donator')
-
--- and in your code you would test for
-if Roles.player_has_flag(player, 'is_donator') then
-    -- some donator only code
-end
-
--- Example Role Define:
---You can't use a role system without any roles so first you must define your roles; each role has a minimum of a name with
---the option for a shorthand:
-Roles.new_role('Administrator', 'Admin')
-
---Next you will want to add any extras you want to have, such as a tag, colour, permission group or any custom flags:
-Roles.new_role('Administrator', 'Admin')
-:set_custom_tag('[Admin]')
-:set_custom_color('red') -- this can be {r=0, g=0, b=0} or a predefined value
-:set_permission_group('Staff') -- a second argument can be added if you have not used the custom permission group config
-:set_flag('is_admin')
-
---You will then want to decide if you want to allow all actions, this should of course be used sparely:
-Roles.new_role('Administrator', 'Admin')
-...extras...
-:set_allow_all()
-
---If you don't do this want this as i would advise you do then you will want to define what the role can do; this comes with
---an optional inheritance system if you like those sort of things in which case disallow may also be of some use to you:
-Roles.new_role('Administrator', 'Admin')
-...extras...
-:set_parent('Moderator') -- the admin can do anything that a moderator can do
-:allow{ -- these actions can be anything just try to keep them without conflicts
-    'command/kill',
-    'gui/game settings'
-}
-
---Here is what the finished admin role would look like:
-Roles.new_role('Administrator', 'Admin')
-:set_custom_tag('[Admin]')
-:set_custom_color('red')
-:set_permission_group('Staff')
-:set_flag('is_admin')
-:set_parent('Moderator')
-:allow{
-    'command/kill',
-    'gui/game settings'
-}
-
--- Example System Define:
---Once all roles are defined these steps must be done to ensure the system is ready to use, this includes setting a default
---role, assigning a root (all permission) role that the server/system will use and the linear order that the roles fall into:
-
-Roles.set_default('Guest')
-Roles.set_root('System')
-
-Roles.define_role_order{
-    'System',
-    'Administrator',
-    'Moderator',
-    'Donator',
-    'Guest'
-}
-
---Just remember that in this example all these roles have not been defined; so make sure all your roles that are used are defined
---before hand; a config file on load is useful for this to ensure that its loaded before the first player even joins.
-
- - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
utils.game
utils.global
utils.event
expcore.permission_groups
expcore.async
utils.color_presets
expcore.common
- - -

Getter

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
debug()Returns a string which contains all roles in index order displaying all data for them
print_to_roles(roles, message)Prints a message to all players in the given roles, may send duplicate message however factorio blocks spam
print_to_roles_higher(role, message)Prints a message to all players who have the given role or one which is higher (excluding default)
print_to_roles_lower(role, message)Prints a message to all players who have the given role or one which is lower (excluding default)
get_role_by_name(name)Get a role for the given name
get_role_by_order(index)Get a role with the given order index
get_role_from_any(any)Gets a role from a name, index or role object (where it is just returned) -nb: this function is used for the input for most outward facing functions
get_player_roles(player)Gets all the roles of the given player, this will always contain the default role
get_player_highest_role(player)Gets the highest role which the player has, can be used to compeer one player to another
- - -

Assignment

- - - - - - - - - - - - - - - - -
assign_player(player, roles[, by_player_name=][, skip_checks=false][, silent=false])Gives a player the given role(s) with an option to pass a by player name used in the log
unassign_player(player, roles[, by_player_name=][, skip_checks=false][, silent=false])Removes a player from the given role(s) with an option to pass a by player name used in the log
override_player_roles([player_name], roles)Overrides all player roles with the given table of roles, useful to mass set roles on game start
- - -

Checks

- - - - - - - - - - - - - - - - -
player_has_role(player, search_role)A test for weather a player has the given role
player_has_flag(player, flag_name)A test for weather a player has the given flag true for at least one of they roles
player_allowed(player, action)A test for weather a player has at least one role which is allowed the given action
- - -

Definitions

- - - - - - - - - - - - - - - - - - - - - - - - -
define_role_order(order)Used to set the role order, higher in the list is better, must be called at least once in config --- nb: function also re links parents due to expected position in the config file
define_flag_trigger(name, callback)Defines a new trigger for when a tag is added or removed from a player
set_default(name)Sets the default role which every player will have, this needs to be called at least once
set_root(name)Sets the root role which will always have all permissions, any server actions act from this role
new_role(name[, short_hand=name])Defines a new role and returns the prototype to allow configuration
- - -

Role Actions

- - - - - - - - - - - - - - - - - - - - -
Roles._prototype:set_allow_all([state=true])Sets the default allow state of the role, true will allow all actions
Roles._prototype:allow(actions)Sets the allow actions for this role, actions in this list will be allowed for this role
Roles._prototype:disallow(actions)Sets the disallow actions for this role, will prevent actions from being allowed regardless of inheritance
Roles._prototype:is_allowed(action)Test for if a role is allowed the given action, mostly internal see Roles.player_allowed
- - -

Role Flags

- - - - - - - - - - - - - - - - -
Roles._prototype:set_flag(name[, value=true])Sets the state of a flag for a role, flags can be used to apply effects to players
Roles._prototype:clear_flags()Clears all flags from this role, individual flags can be removed with set_flag(name, false)
Roles._prototype:has_flag(name)A test for if the role has a flag set
- - -

Role Properties

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Roles._prototype:set_custom_tag(tag)Sets a custom player tag for the role, can be accessed by other code
Roles._prototype:set_custom_color(color)Sets a custom colour for the role, can be accessed by other code
Roles._prototype:set_permission_group(name[, use_factorio_api=false])Sets the permission group for this role, players will be moved to the group of they highest role
Roles._prototype:set_parent(role)Sets the parent for a role, any action not in allow or disallow will be looked for in its parents -nb: this is a recursive action, and changing the allows and disallows will effect all children roles
Roles._prototype:set_auto_assign_condition(callback)Sets an auto assign condition that is checked every 60 seconds, if true is returned then the player will receive the role -nb: this is one way, failing false after already gaining the role will not revoke the role
Roles._prototype:get_auto_assign_condition()Get the auto assign condition for this role, returns nil if no condition is set
Roles._prototype:set_block_auto_assign([state=true])Sets the role to not allow players to have auto assign effect them, useful to keep people locked to a role
- - -

Role Players

- - - - - - - - - - - - - - - - - - - - -
Roles._prototype:add_player(player, skip_check, skip_event)Adds a player to this role, players can have more than one role at a time, used internally see Roles.assign
Roles._prototype:remove_player(player, skip_check, skip_event)Removes a player from this role, players can have more than one role at a time, used internally see Roles.unassign
Roles._prototype:get_players([online=nil])Returns an array of all the players who have this role, can be filtered by online status
Roles._prototype:print(message)Will print a message to all players with this role
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.permission_groups -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.async -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Getter

-
-
-
-
- # - debug() -
-
-
-
- -

Returns a string which contains all roles in index order displaying all data for them

-

- - - - - - Returns: -
    -
  • - (string) - the debug output string -
  • -
- - - - - - - - Usage: -
-- Print the debug string
-game.player.print(Roles.debug())
- - -
-
-
-
- # - print_to_roles(roles, message) -
-
-
-
- -

Prints a message to all players in the given roles, may send duplicate message however factorio blocks spam

-

- - - Parameters: - -
    - - - - - -
  • - - roles - - : - - (table) - - table a of roles which to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Print a message to the given roles
-Roles.print_to_roles({'Administrator', 'Moderator'}, 'Hello, World!')
- - -
-
-
-
- # - print_to_roles_higher(role, message) -
-
-
-
- -

Prints a message to all players who have the given role or one which is higher (excluding default)

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Print a message to the roles above this role, includes the given role
-Roles.print_to_roles_higher('Moderator', 'Hello, World!')
- - -
-
-
-
- # - print_to_roles_lower(role, message) -
-
-
-
- -

Prints a message to all players who have the given role or one which is lower (excluding default)

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Print a message to the roles below this role, includes the given role
-Roles.print_to_roles_higher('Moderator', 'Hello, World!')
- - -
-
-
-
- # - get_role_by_name(name) -
-
-
-
- -

Get a role for the given name

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the role to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role with that name or nil -
  • -
- - - - - - - - Usage: -
-- Get a role by its name
-local role = Roles.get_role_by_name('Moderator')
- - -
-
-
-
- # - get_role_by_order(index) -
-
-
-
- -

Get a role with the given order index

-

- - - Parameters: - -
    - - - - - -
  • - - index - - : - - (number) - - the place in the order list of the role to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role with that index in the order list or nil -
  • -
- - - - - - - - Usage: -
-- Get a role by its index in the order list
-local role = Roles.get_role_by_name(2)
- - -
-
-
-
- # - get_role_from_any(any) -
-
-
-
- -

Gets a role from a name, index or role object (where it is just returned) -nb: this function is used for the input for most outward facing functions

-

- - - Parameters: - -
    - - - - - -
  • - - any - - : - - (number, string or table) - - the value used to find the role - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role that was found or nil see above -
  • -
- - - - - - - - Usage: -
-- Get a role by its name or order
-local role = Roles.get_role_from_any('Moderator')
- - -
-
-
-
- # - get_player_roles(player) -
-
-
-
- -

Gets all the roles of the given player, this will always contain the default role

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the roles of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table where the values are the roles which the player has -
  • -
- - - - - - - - Usage: -
-- Get the roles that a player has
-local roles = Roles.get_player_roles(game.player)
- - -
-
-
-
- # - get_player_highest_role(player) -
-
-
-
- -

Gets the highest role which the player has, can be used to compeer one player to another

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the highest role of - -
  • - - -
- - - - - Returns: -
    -
  • - (the) - role with the highest order index which this player has -
  • -
- - - - - - - - Usage: -
-- Get the highest role that a player has
-local role = Roles.get_player_highest_role(game.player)
- - -
-
-

Assignment

-
-
-
-
- # - assign_player(player, roles[, by_player_name=][, skip_checks=false][, silent=false]) -
-
-
-
- -

Gives a player the given role(s) with an option to pass a by player name used in the log

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be assigned the roles - -
  • - - - - - -
  • - - roles - - : - - (table) - - table a of roles that the player will be given, can be one role and can be role names - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that will be shown in the log - - (default: ) -
  • - - - - - -
  • - - skip_checks - - : - - (boolean) - - when true there will be no checks are done for if the player is valid - - (default: false) -
  • - - - - - -
  • - - silent - - : - - (boolean) - - when true there will be no game message printed - - (default: false) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Assign a player to the Moderator role
-Roles.assign_player(game.player,  'Moderator')
-
-- Assign a player to the Moderator role, even if the player has never been on the map
-Roles.assign_player('Cooldude2606',  'Moderator', nil, true)
- - -
-
-
-
- # - unassign_player(player, roles[, by_player_name=][, skip_checks=false][, silent=false]) -
-
-
-
- -

Removes a player from the given role(s) with an option to pass a by player name used in the log

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will have the roles removed - -
  • - - - - - -
  • - - roles - - : - - (table) - - table a of roles to be removed from the player, can be one role and can be role names - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that will be shown in the logs - - (default: ) -
  • - - - - - -
  • - - skip_checks - - : - - (boolean) - - when true there will be no checks are done for if the player is valid - - (default: false) -
  • - - - - - -
  • - - silent - - : - - (boolean) - - when true there will be no game message printed - - (default: false) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Unassign a player from the Moderator role
-Roles.unassign_player(game.player,  'Moderator')
-
-- Unassign a player from the Moderator role, even if the player has never been on the map
-Roles.unassign_player('Cooldude2606',  'Moderator', nil, true)
- - -
-
-
-
- # - override_player_roles([player_name], roles) -
-
-
-
- -

Overrides all player roles with the given table of roles, useful to mass set roles on game start

-

- - - Parameters: - -
    - - - - - -
  • - - player_name - - : - - (string) - - the player to set the roles for, if not given all roles are overriden - - (optional) -
  • - - - - - -
  • - - roles - - : - - (table) - - table a which is indexed by case sensitive player names and has the value of a table of role names - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Override the roles of a single player, other users are not effected
-Roles.override_player_roles('Cooldude2606', {'Moderator'})
-
-- Override all existing roles, effects all users not just ones listed
-Roles.override_player_roles{
-    ['Cooldude2606'] = {'Administrator', 'Moderator'},
-    ['arty714'] = {'Administrator', 'Moderator'},
-}
- - -
-
-

Checks

-
-
-
-
- # - player_has_role(player, search_role) -
-
-
-
- -

A test for weather a player has the given role

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - search_role - - : - - (string, number or table) - - a pointer to the role that is being searched for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has the role, false otherwise, nil for errors -
  • -
- - - - - - - - Usage: -
-- Test if a player has a role
-local has_role = Roles.player_has_role(game.player, 'Moderator')
- - -
-
-
-
- # - player_has_flag(player, flag_name) -
-
-
-
- -

A test for weather a player has the given flag true for at least one of they roles

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - flag_name - - : - - (string) - - the name of the flag that is being looked for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has at least one role which has the flag set to true, false otherwise, nil for errors -
  • -
- - - - - - - - Usage: -
-- Test if a player has a role
-local has_flag = Roles.player_has_flag(game.player, 'is_donator')
- - -
-
-
-
- # - player_allowed(player, action) -
-
-
-
- -

A test for weather a player has at least one role which is allowed the given action

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - action - - : - - (string) - - the name of the action that is being tested for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has at least one role which is allowed this action, false otherwise, nil for errors -
  • -
- - - - - - - - Usage: -
-- Test if a player has a role
-local has_flag = Roles.player_has_flag(game.player, 'is_donator')
- - -
-
-

Definitions

-
-
-
-
- # - define_role_order(order) -
-
-
-
- -

Used to set the role order, higher in the list is better, must be called at least once in config --- nb: function also re links parents due to expected position in the config file

-

- - - Parameters: - -
    - - - - - -
  • - - order - - : - - (table) - - table a which is keyed only by numbers (start 1) and values are roles in order with highest first - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Define which roles are higher than others
-Roles.define_role_order{
-    'System',
-    'Administrator',
-    'Moderator',
-    'Donator',
-    'Guest'
-}
- - -
-
-
-
- # - define_flag_trigger(name, callback) -
-
-
-
- -

Defines a new trigger for when a tag is added or removed from a player

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag which the roles will have - -
  • - - - - - -
  • - - callback - - : - - (function) - - the function that is called when roles are assigned - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Defining a flag trigger
-Roles.define_flag_trigger('is_donator', function(player, state)
-    player.character_running_speed_modifier = state and 1.5 or 1
-end)
- - -
-
-
-
- # - set_default(name) -
-
-
-
- -

Sets the default role which every player will have, this needs to be called at least once

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the default role - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Setting the default role
-Roles.set_default('Guest')
- - -
-
-
-
- # - set_root(name) -
-
-
-
- -

Sets the root role which will always have all permissions, any server actions act from this role

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the root role - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Setting the root role
-Roles.set_root('System')
- - -
-
-
-
- # - new_role(name[, short_hand=name]) -
-
-
-
- -

Defines a new role and returns the prototype to allow configuration

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the new role, must be unique - -
  • - - - - - -
  • - - short_hand - - : - - (string) - - the shortened version of the name - - (default: name) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the start of the config chain for this role -
  • -
- - - - - - - - Usage: -
-- Defining a new role
-local role = Roles.new_role('Moderator', 'Mod')
- - -
-
-

Role Actions

-
-
-
-
- # - Roles._prototype:set_allow_all([state=true]) -
-
-
-
- -

Sets the default allow state of the role, true will allow all actions

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - true will allow all actions - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Allow all actions for this role, useful for root like roles
-role:set_allow_all()
- - -
-
-
-
- # - Roles._prototype:allow(actions) -
-
-
-
- -

Sets the allow actions for this role, actions in this list will be allowed for this role

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (table) - - indexed with numbers and is an array of action names, order has no effect - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Allow some actions for a role
-role:allow{
-    'command/kill',
-    'gui/game settings'
-}
- - -
-
-
-
- # - Roles._prototype:disallow(actions) -
-
-
-
- -

Sets the disallow actions for this role, will prevent actions from being allowed regardless of inheritance

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (table) - - indexed with numbers and is an array of action names, order has no effect - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Disallow an action for a role, useful if inherit an action from a parent
-role:disallow{
-    'command/kill',
-    'gui/game settings'
-}
- - -
-
-
-
- # - Roles._prototype:is_allowed(action) -
-
-
-
- -

Test for if a role is allowed the given action, mostly internal see Roles.player_allowed

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - the name of the action to test if it is allowed - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if action is allowed, false otherwise -
  • -
- - - - - - - - Usage: -
-- Test if a role is allowed an action
-local allowed = role:is_allowed('command/kill')
- - -
-
-

Role Flags

-
-
-
-
- # - Roles._prototype:set_flag(name[, value=true]) -
-
-
-
- -

Sets the state of a flag for a role, flags can be used to apply effects to players

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag to set the value of - -
  • - - - - - -
  • - - value - - : - - (boolean) - - the state to set the flag to - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Set a flag for a role
-role:set_flag('is_admin')
- - -
-
-
-
- # - Roles._prototype:clear_flags() -
-
-
-
- -

Clears all flags from this role, individual flags can be removed with set_flag(name, false)

-

- - - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Remove all flags from a role
-role:clear_flags()
- - -
-
-
-
- # - Roles._prototype:has_flag(name) -
-
-
-
- -

A test for if the role has a flag set

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the flag is set, false otherwise -
  • -
- - - - - - - - Usage: -
-- Test if a role has a flag
-local has_flag = role:has_flag('is_admin')
- - -
-
-

Role Properties

-
-
-
-
- # - Roles._prototype:set_custom_tag(tag) -
-
-
-
- -

Sets a custom player tag for the role, can be accessed by other code

-

- - - Parameters: - -
    - - - - - -
  • - - tag - - : - - (string) - - the value that the tag will be - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Set a custom tag for this role, other code is required to set the tag
-role:set_custom_tag('Mod')
- - -
-
-
-
- # - Roles._prototype:set_custom_color(color) -
-
-
-
- -

Sets a custom colour for the role, can be accessed by other code

-

- - - Parameters: - -
    - - - - - -
  • - - color - - : - - (table) - - ?string|table can either be and rgb colour or the name of a colour defined in the presets - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Set a custom colour for this role, other code is required to use this value
-role:set_custom_color{ r=255, g=100, b=100}
- - -
-
-
-
- # - Roles._prototype:set_permission_group(name[, use_factorio_api=false]) -
-
-
-
- -

Sets the permission group for this role, players will be moved to the group of they highest role

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the permission group to have players moved to - -
  • - - - - - -
  • - - use_factorio_api - - : - - (boolean) - - when true the custom permission group module is ignored - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Set the permission group for this role, see permission_groups.lua
-role:set_permission_group('Admin')
- - -
-
-
-
- # - Roles._prototype:set_parent(role) -
-
-
-
- -

Sets the parent for a role, any action not in allow or disallow will be looked for in its parents -nb: this is a recursive action, and changing the allows and disallows will effect all children roles

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role that will be the parent; has imminent effect if role is already defined - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Set the parent for this role to inherit all actions allowed
-role:set_parent('Guest')
- - -
-
-
-
- # - Roles._prototype:set_auto_assign_condition(callback) -
-
-
-
- -

Sets an auto assign condition that is checked every 60 seconds, if true is returned then the player will receive the role -nb: this is one way, failing false after already gaining the role will not revoke the role

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - receives only one param which is player to assign, return true to assign the player - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Give this role to a user if there are admin, ran every 60 seconds
-role:set_auto_assign_condition(function(player)
-    return player.admin
-end)
- - -
-
-
-
- # - Roles._prototype:get_auto_assign_condition() -
-
-
-
- -

Get the auto assign condition for this role, returns nil if no condition is set

-

- - - - - - Returns: -
    -
  • - (function) - The callback which was assigned as the auto assign condition -
  • -
- - - - - - - - Usage: -
-- Give this role to a user if there are admin, ran every 60 seconds
-local condition = role:get_auto_assign_condition()
- - -
-
-
-
- # - Roles._prototype:set_block_auto_assign([state=true]) -
-
-
-
- -

Sets the role to not allow players to have auto assign effect them, useful to keep people locked to a role

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when true the players with this role will not be auto assigned to other roles - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - Usage: -
-- Make a role stop players from being auto assigned to other roles
-role:set_block_auto_assign()
- - -
-
-

Role Players

-
-
-
-
- # - Roles._prototype:add_player(player, skip_check, skip_event) -
-
-
-
- -

Adds a player to this role, players can have more than one role at a time, used internally see Roles.assign

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be given this role - -
  • - - - - - -
  • - - skip_check - - : - - (boolean) - - when true player will be taken as the player name (use when player has not yet joined) - -
  • - - - - - -
  • - - skip_event - - : - - (boolean) - - when true the event emit will be skipped, this is used internally with Roles.assign - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully -
  • -
- - - - - - - - Usage: -
-- Assign a player to this role
-role:add_player(game.player)
- - -
-
-
-
- # - Roles._prototype:remove_player(player, skip_check, skip_event) -
-
-
-
- -

Removes a player from this role, players can have more than one role at a time, used internally see Roles.unassign

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will lose this role - -
  • - - - - - -
  • - - skip_check - - : - - (boolean) - - when true player will be taken as the player name (use when player has not yet joined) - -
  • - - - - - -
  • - - skip_event - - : - - (boolean) - - when true the event emit will be skipped, this is used internally with Roles.unassign - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was removed successfully -
  • -
- - - - - - - - Usage: -
-- Unassign a player from this role
-role:remove_player(game.player)
- - -
-
-
-
- # - Roles._prototype:get_players([online=nil]) -
-
-
-
- -

Returns an array of all the players who have this role, can be filtered by online status

-

- - - Parameters: - -
    - - - - - -
  • - - online - - : - - (boolean) - - when given will filter by this online state, nil will return all players - - (default: nil) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - all the players who have this role, indexed order is meaningless -
  • -
- - - - - - - - Usage: -
-- Get all the players with this role
-local players = role:get_players()
-
-- Get all online players with this role
-local players = role:get_players(true)
- - -
-
-
-
- # - Roles._prototype:print(message) -
-
-
-
- -

Will print a message to all players with this role

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be printed to the players - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of players who received the message -
  • -
- - - - - - - - Usage: -
-- Print a message to all players with this role
-role:print('Hello, World!')
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Store.html b/docs/core/Store.html deleted file mode 100644 index 1290cd54..00000000 --- a/docs/core/Store.html +++ /dev/null @@ -1,1503 +0,0 @@ - - - - - - - - Store core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Store core

-

Core Module - Store -- Used to store and watch for updates for values in the global table

-

- - - - - - -

Usage

-
-- Require the module and add a store with no keys
--- Store with no keys does not need a serializer
-local Store = require 'expcore.store' --- @dep expcore.store
-local scenario_diffculty = Store.register()
-
--- When the store is changed this function will trigger
-Store.watch(scenario_diffculty, function(value)
-    game.print('The scenario diffculty has been set to '..value)
-end)
-
-Store.set(scenario_diffculty, 'hard') -- Set the value stored to 'hard'
-Store.get(scenario_diffculty) -- Returns 'hard'
-Store.update(scenario_diffculty, function(value) -- Will set value to 'normal' if no value is present
-    return not value and 'normal'
-end)
-
-- Require the module and add a store with keys
--- Store with keys does not require a serializer but it can be helpful
-local Store = require 'expcore.store' --- @dep expcore.store
-local player_scores = Store.register(function(player) -- Use player name as the key
-    return player.name
-end)
-
--- When any key in the store is changed this function will trigger
-Store.watch(player_scores, function(value, key, old_value)
-    game.print(key..' now has a score of '..value)
-end)
-
-Store.set(player_scores, game.player, 10) -- Set your score to 10
-Store.get(scenario_diffculty, game.player) -- Returns 10
-Store.update(scenario_diffculty, game.player, function(value) -- Add 1 to your score
-    return value + 1
-end)
- - - - - - - -

Dependencies

- - - - - - - -
utils.event
- - -

Tables

- - - - - - - - - - - - - - - - -
serializersAn array of the serializers that stores are using, key is store uids
watchersAn array of watchers that stores will trigger, key is store uids
file_pathsAn index used for debuging to find the file where different stores where registered
- - -

Fields

- - - - - - - - -
uidThe current highest uid that is being used, will not increase during runtime
- - -

Store Setup

- - - - - - - - - - - - - - - - -
validate(store[, key][, error_stack=1])An error checking and serializing function for checking store uids and keys, note key is not required
register([serializer])Required to create new stores and register an serializer to a store, serializer not required
watch(store, watcher)Register a watch function to a store that is called when the value in the store is changed, triggers for any key
- - -

Store Data Management

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get(store[, key])Used to retrive the current data that is stored, key is optional depending on if you are using them
clear(store[, key])Used to clear the data in a store, will trigger any watchers, key is optional depending on if you are using them
set(store[, key], value)Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them
update(store[, key], updater)Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them
map(store, updater)Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present
trigger(store[, key])Used to trigger watcher functions, this may be used to trigger them if you did not use Store.update or Store.set
raw_trigger(store[, key][, value][, old_value])Used to trigger watcher functions, the value and key are passed directly to the watchers regardless if the value is correct
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Tables

-
-
-
-
- # - serializers -
-
-
-
- -

An array of the serializers that stores are using, key is store uids

-

- - - - - - - - - - - - - - -
-
-
-
- # - watchers -
-
-
-
- -

An array of watchers that stores will trigger, key is store uids

-

- - - - - - - - - - - - - - -
-
-
-
- # - file_paths -
-
-
-
- -

An index used for debuging to find the file where different stores where registered

-

- - - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - uid -
-
-
-
- -

The current highest uid that is being used, will not increase during runtime

-

- - - -
    - - - - - -
  • - - uid - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-

Store Setup

-
-
-
-
- # - validate(store[, key][, error_stack=1]) -
-
-
-
- -

An error checking and serializing function for checking store uids and keys, note key is not required

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to check is valid - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to serialize or check is a string - - (optional) -
  • - - - - - -
  • - - error_stack - - : - - (number) - - the position in the stack relative to the current function (1) to raise this error on - - (default: 1) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - if key is given and a serializer is registered, or key was already a string, then the key is returned -
  • -
- - - - - - - - Usage: -
-- Registering a new store and checking that it is valid
--- New store will use player names as the keys
-local player_scores = Store.register(function(player)
-    return player.name
-end)
-
--- player_scores is a valid store and key will be your player name
-local key = Store.validate(player_scores, game.player)
- - -
-
-
-
- # - register([serializer]) -
-
-
-
- -

Required to create new stores and register an serializer to a store, serializer not required

-

- - - Parameters: - -
    - - - - - -
  • - - serializer - - : - - (function) - - the function used to convert non string keys into strings to be used in the store - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the uid for the new store that you have created, use this as the first param to all other functions -
  • -
- - - - - - - - Usage: -
-- Creating a store with no serializer
-local scenario_diffculty = Store.register()
-
-- Creating a store which can take LuaPlayer
-local player_scores = Store.register(function(player)
-    return player.name
-end)
- - -
-
-
-
- # - watch(store, watcher) -
-
-
-
- -

Register a watch function to a store that is called when the value in the store is changed, triggers for any key

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to watch for changes to - -
  • - - - - - -
  • - - watcher - - : - - (function) - - the function that will be called when there is a change to the store - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Printing the changed value to all players, no keys
--- Register the new store, we are not using keys so we dont need a serializer
-local scenario_diffculty = Store.register()
-
--- Register the watcher so that when we change the value the message is printed
-Store.watch(scenario_diffculty, function(value)
-    game.print('The scenario diffculty has been set to '..value)
-end)
-
--- Set a new value for the diffculty and see that it has printed to the game
-Store.set(scenario_diffculty, 'hard')
-
-- Printing the changed value to all players, with keys
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_scores = Store.register(function(player)
-    return player.name
-end)
-
--- Register the watcher so that when we change the value the message is printed
-Store.watch(player_scores, function(value, key, old_value)
-    game.print(key..' now has a score of '..value)
-end)
-
--- Set a new value for your score and see that it has printed to the game
-Store.set(player_scores, game.player, 10)
- - -
-
-

Store Data Management

-
-
-
-
- # - get(store[, key]) -
-
-
-
- -

Used to retrive the current data that is stored, key is optional depending on if you are using them

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to get the value from - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to get the value of, must be a string unless you have a serializer - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the data that is stored -
  • -
- - - - - - - - Usage: -
-- Getting the value of a store with no keys
--- Register the new store, we are not using keys so we dont need a serializer
-local scenario_diffculty = Store.register()
-
--- Get the current diffculty for the scenario
-local diffculty = Store.get(scenario_diffculty)
-
-- Getting the data from a store with keys
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_scores = Store.register(function(player)
-    return player.name
-end)
-
--- Get your current score
-local my_score = Store.get(player_scores, game.player)
-
--- Get all scores
-lcoal scores = Store.get(player_scores)
- - -
-
-
-
- # - clear(store[, key]) -
-
-
-
- -

Used to clear the data in a store, will trigger any watchers, key is optional depending on if you are using them

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to clear - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to clear, must be a string unless you have a serializer - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Clear a store which does not use keys
--- Register the new store, we are not using keys so we dont need a serializer
-local scenario_diffculty = Store.register()
-
--- Clear the scenario diffculty
-Store.clear(scenario_diffculty)
-
-- Clear data that is in a store with keys
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_scores = Store.register(function(player)
-    return player.name
-end)
-
--- Clear your score
-Store.clear(player_scores, game.player)
-
--- Clear all scores
-Store.clear(player_scores)
- - -
-
-
-
- # - set(store[, key], value) -
-
-
-
- -

Used to set the data in a store, will trigger any watchers, key is optional depending on if you are using them

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to set - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to set, must be a string unless you have a serializer - - (optional) -
  • - - - - - -
  • - - value - - : - - (any) - - the value that you want to set - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Setting a store which does not use keys
--- Register the new store, we are not using keys so we dont need a serializer
-local scenario_diffculty = Store.register()
-
--- Set the new scenario diffculty
-Store.set(scenario_diffculty, 'hard')
-
-- Set data in a store with keys
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_scores = Store.register(function(player)
-    return player.name
-end)
-
--- Set your current score
-Store.set(player_scores, game.player, 10)
-
--- Set all scores, note this might not have much use
-Store.set(player_scores, {
-    [game.player.name] = 10,
-    ['SomeOtherPlayer'] = 0
-})
- - -
-
-
-
- # - update(store[, key], updater) -
-
-
-
- -

Used to update the data in a store, use this with tables, will trigger any watchers, key is optional depending on if you are using them

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to update - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to update, must be a string unless you have a serializer - - (optional) -
  • - - - - - -
  • - - updater - - : - - (function) - - the function which is called to make changes to the value, such as changing table keys, if a value is returned it will replace the current value in the store - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Incrementing a global score
--- Because we are only going to have one score so we will not need keys or a serializer
-local game_score = Store.register()
-
--- Setting a default value
-Store.set(game_score, 0)
-
--- We now will update the game score by one, we return the value so that it is set as the new value in the store
-Store.update(game_score, function(value)
-    return value + 1
-end)
-
-- Updating keys in a table of data
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_data = Store.register(function(player)
-    return player.name
-end)
-
--- Setting a default value for your player, used to show the table structure
-Store.set(player_data, game.player, {
-    group = 'Admin',
-    role = 'Owner',
-    show_group_config = false
-})
-
--- Updating the show_group_config key in your player data, note that it would be harder to call set every time
--- We do not need to return anything in this case as we are not replacing all the data
-Store.update(player_data, game.player, function(data)
-    data.show_group_config = not data.show_group_config
-end)
- - -
-
-
-
- # - map(store, updater) -
-
-
-
- -

Used to update all values that are in a store, similar to Store.update but acts on all keys at once, will trigger watchers for every key present

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to map - -
  • - - - - - -
  • - - updater - - : - - (function) - - the function that is called on every key in this store - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Updating keys in a table of data
--- Register the new store, we are not using player names as the keys so it would be useful to accept LuaPlayer objects
-local player_data = Store.register(function(player)
-    return player.name
-end)
-
--- Setting a default value for your player, used to show the table structure
-Store.set(player_data, game.player, {
-    group = 'Admin',
-    role = 'Owner',
-    show_group_config = false
-})
-
--- Updating the show_group_config key for all players, note that it would be harder to call set every time
--- We do not need to return anything in this case as we are not replacing all the data
--- We also have access to the current key being updated if needed
-Store.map(player_data, function(data, key)
-    data.show_group_config = not data.show_group_config
-end)
- - -
-
-
-
- # - trigger(store[, key]) -
-
-
-
- -

Used to trigger watcher functions, this may be used to trigger them if you did not use Store.update or Store.set

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to trigger - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to trigger, must be a string unless you have a serializer - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Faking the update to a store
--- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting
-local scenario_diffculty = Store.register()
-
--- Trigger the watchers with a fake change of diffculty
-Store.trigger(scenario_diffculty)
- - -
-
-
-
- # - raw_trigger(store[, key][, value][, old_value]) -
-
-
-
- -

Used to trigger watcher functions, the value and key are passed directly to the watchers regardless if the value is correct

-

- - - Parameters: - -
    - - - - - -
  • - - store - - : - - (number) - - the uid of the store that you want to trigger - -
  • - - - - - -
  • - - key - - : - - (string or any) - - the key that you want to trigger, must be a string unless you have a serializer - - (optional) -
  • - - - - - -
  • - - value - - : - - (any) - - the new value that is at this key or store, passed directly to the watcher - - (optional) -
  • - - - - - -
  • - - old_value - - : - - (any) - - the old value that was at this key or store often the same if value is a table, passed directly to the watcher - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Triggering a manule call of the watchers
--- The type of store we use does not really matter for this as long as you pass it what you watchers are expecting
-local scenario_diffculty = Store.register()
-
--- Trigger the watchers with a fake change of diffculty
--- This is mostly used internally but it can be useful in other cases
-Store.raw_trigger(scenario_diffculty, nil, 'normal', 'normal')
- - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Sudo.html b/docs/core/Sudo.html deleted file mode 100644 index 27c2542b..00000000 --- a/docs/core/Sudo.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - - Sudo core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Sudo core

-

Core Module - Sudo - - An extention of task and token to allow a single require to register and run functions bypassing all permissions.

-

- - - - - - -

Usage

-

-    -- To use sudo you must register the allowed functions when the files are loaded, often this will just be giving access to
-    -- some functions within a module if you expect that some parts may be blocked by in game permissions or a custom system you have made
-
-    -- This will be blocked if the current player (from a command or gui) is not admin
-    local function make_admin(player)
-        player.admin = true
-    end
-
-    -- Here we give sudo access to the function under the name "make-admin"
-    Sudo.register('make-admin',make_admin)
-
-    -- This will allow us to bypass this by running one tick later outside of any player scope
-    Sudo.run('make-admin',game.player)
- - - - - - - -

Dependencies

- - - - - - - - - - -
utils.task
utils.token
- - -

Functions

- - - - - - - - - - - - - - - - -
register(name, callback)Registers a new callback under the given name, used to avoid desyncs
get(name)Gets the function that is registered under the given name
run(name[, ...])Runs the function that is registered under the given name, you may supply any number of params as needed
- - -
- - -

Dependencies

-
-
-
-
- # - utils.task -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.token -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - register(name, callback) -
-
-
-
- -

Registers a new callback under the given name, used to avoid desyncs

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name that will be used to call this function - -
  • - - - - - -
  • - - callback - - : - - (function) - - the function that will be called by this name - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - get(name) -
-
-
-
- -

Gets the function that is registered under the given name

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the function you want to get - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - run(name[, ...]) -
-
-
-
- -

Runs the function that is registered under the given name, you may supply any number of params as needed

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the function you want to run - -
  • - - - - - -
  • - - ... - - : - - (any) - - the other params that you want to pass to your function - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/core/Toolbar.html b/docs/core/Toolbar.html deleted file mode 100644 index 848922b5..00000000 --- a/docs/core/Toolbar.html +++ /dev/null @@ -1,1669 +0,0 @@ - - - - - - - - Toolbar core - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Toolbar core

-

Core Module - Toolbar

-

- - - - - - - - - - - - - -

Dependencies

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

Permissions

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

Buttons

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

Frames

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

Other Elements

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

Dependencies

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

Permissions

-
-
-
-
- # - allowed(player, concept_name) -
-
-
-
- -

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

-

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

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

-

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

Buttons

-
-
-
-
- # - add_button_concept(concept) -
-
-
-
- -

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

-

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

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

-

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

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

-

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

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

-

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

Frames

-
-
-
-
- # - add_frame_concept(concept) -
-
-
-
- -

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

-

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

Hides all the frames for a player

-

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

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

-

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

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

-

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

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

-

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

Toggles the visibilty of this concept for the given player

-

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

Gets the current visibilty state of this conept for this player

-

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

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

-

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

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

-

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

Other Elements

-
-
-
-
- # - toolbar -
-
-
-
- -

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

-

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

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

-

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

Button which hides all visible toolbar frames, triggers on_hide_frames

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Alt-View.html b/docs/data/Alt-View.html deleted file mode 100644 index 4b2fcc9d..00000000 --- a/docs/data/Alt-View.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - Alt-View data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Alt-View data

-

Stores if you use alt mode or not and auto applies it

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
expcore.player_data
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Bonus.html b/docs/data/Bonus.html deleted file mode 100644 index 9c4aad72..00000000 --- a/docs/data/Bonus.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - - - Bonus data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Bonus data

-

Commands Module - Bonus - - Adds a command that allows players to have increased stats

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
expcore.roles
utils.event
config.bonuses
expcore.commands
expcore.player_data
- - -

Commands

- - - - - - - - -
bonusChanges the amount of bonus you receive
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.bonuses -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - bonus -
-
-
-
- -

Changes the amount of bonus you receive

-

- - - Command Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - range 0-50 the percent increase for your bonus - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Greetings.html b/docs/data/Greetings.html deleted file mode 100644 index 919f2e29..00000000 --- a/docs/data/Greetings.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - - - - Greetings data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Greetings data

-

Greets players on join

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
config.join_messages
expcore.commands
expcore.player_data
- - -

Commands

- - - - - - - - -
join-messageSet your custom join message
- - -
- - -

Dependencies

-
-
-
-
- # - config.join_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - join-message -
-
-
-
- -

Set your custom join message

-

- - - Command Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - The custom join message that will be used - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Player-Colours.html b/docs/data/Player-Colours.html deleted file mode 100644 index 5f785e92..00000000 --- a/docs/data/Player-Colours.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - Player-Colours data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Player-Colours data

-

Gives players random colours when they join, also applies preset colours to those who have them

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
utils.color_presets
config.preset_player_colours
expcore.player_data
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.preset_player_colours -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Quickbar.html b/docs/data/Quickbar.html deleted file mode 100644 index f7e345f4..00000000 --- a/docs/data/Quickbar.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - - - Quickbar data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Quickbar data

-

Commands Module - Quickbar - - Adds a command that allows players to load Quickbar presets

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
config.preset_player_quickbar
expcore.player_data
- - -

Commands

- - - - - - - - -
save-quickbarSaves your quickbar preset to the script-output folder
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.preset_player_quickbar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - save-quickbar -
-
-
-
- -

Saves your quickbar preset to the script-output folder

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/data/Tag.html b/docs/data/Tag.html deleted file mode 100644 index 2473b724..00000000 --- a/docs/data/Tag.html +++ /dev/null @@ -1,565 +0,0 @@ - - - - - - - - Tag data - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Tag data

-

Commands Module - Tag - - Adds a command that allows players to have a custom tag after their name

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
expcore.roles
expcore.player_data
- - -

Commands

- - - - - - - - - - - - - - - - -
tagSets your player tag.
tagSets your player tag color.
tag-clearClears your tag.
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - tag -
-
-
-
- -

Sets your player tag.

-

- - - Command Parameters: - -
    - - - - - -
  • - - tag - - : - - (string) - - the tag that will be after the name, there is a max length - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - tag -
-
-
-
- -

Sets your player tag color.

-

- - - Command Parameters: - -
    - - - - - -
  • - - color - - : - - (string) - - name. - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - tag-clear -
-
-
-
- -

Clears your tag.

-

Or another player if you are admin.

- - - Command Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the tag from, nil will apply to self - - (default: self) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Autofill.html b/docs/guis/Autofill.html deleted file mode 100644 index 68d0e22f..00000000 --- a/docs/guis/Autofill.html +++ /dev/null @@ -1,617 +0,0 @@ - - - - - - - - Autofill gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Autofill gui

-

Gui Module - Autofill - - Adds a button to enable Autofill

-

- - - - - - - - - - - - - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
toggle_item_buttonToggle entity section visibility
header_toggleUsed to assign an event to the header label to trigger a toggle
entity_toggleToggle enitity button, used for toggling autofill for the specific entity - All entity autofill settings will be ignored if its disabled
autofill_section_containerDraw a section header and main scroll
toggle_item_buttonToggle item button, used for toggling autofill for the specific item
amount_textfieldAmount text field for a autofill item
add_autofill_settingAutofill setting, contains a button and a textbox
add_empty_autofill_settingAutofill setting empty, contains filler button and textfield gui elements
autofill_containerMain gui container for the left flow
autofill_toggleButton on the top flow used to toggle autofill container
- - -
- - -

Elements

-
-
-
-
- # - toggle_item_button -
-
-
-
- -

Toggle entity section visibility

-

- - - - - - - - - - - - - - -
-
-
-
- # - header_toggle -
-
-
-
- -

Used to assign an event to the header label to trigger a toggle

-

- - - - - - - - - - - - - - -
-
-
-
- # - entity_toggle -
-
-
-
- -

Toggle enitity button, used for toggling autofill for the specific entity - All entity autofill settings will be ignored if its disabled

-

- - - - - - - - - - - - - - -
-
-
-
- # - autofill_section_container -
-
-
-
- -

Draw a section header and main scroll

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_item_button -
-
-
-
- -

Toggle item button, used for toggling autofill for the specific item

-

- - - - - - - - - - - - - - -
-
-
-
- # - amount_textfield -
-
-
-
- -

Amount text field for a autofill item

-

- - - - - - - - - - - - - - -
-
-
-
- # - add_autofill_setting -
-
-
-
- -

Autofill setting, contains a button and a textbox

-

- - - - - - - - - - - - - - -
-
-
-
- # - add_empty_autofill_setting -
-
-
-
- -

Autofill setting empty, contains filler button and textfield gui elements

-

- - - - - - - - - - - - - - -
-
-
-
- # - autofill_container -
-
-
-
- -

Main gui container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - autofill_toggle -
-
-
-
- -

Button on the top flow used to toggle autofill container

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Player-List.html b/docs/guis/Player-List.html deleted file mode 100644 index a976d1d5..00000000 --- a/docs/guis/Player-List.html +++ /dev/null @@ -1,731 +0,0 @@ - - - - - - - - Player-List gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Player-List gui

-

Gui Module - Player List - - Adds a player list to show names and play time; also includes action buttons which can preform actions to players

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
expcore.datastore
utils.event
config.gui.player_list_actions
utils.color_presets
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open_action_barButton used to open the action bar
close_action_barButton used to close the action bar
reason_confirmButton used to confirm a reason
add_player_baseSet of elements that are used to make up a row of the player table
add_action_barAdds all the buttons and flows that make up the action bar
player_list_containerMain player list container for the left flow
toggle_player_listButton on the top flow used to toggle the player list container
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.gui.player_list_actions -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - open_action_bar -
-
-
-
- -

Button used to open the action bar

-

- - - - - - - - - - - - - - -
-
-
-
- # - close_action_bar -
-
-
-
- -

Button used to close the action bar

-

- - - - - - - - - - - - - - -
-
-
-
- # - reason_confirm -
-
-
-
- -

Button used to confirm a reason

-

- - - - - - - - - - - - - - -
-
-
-
- # - add_player_base -
-
-
-
- -

Set of elements that are used to make up a row of the player table

-

- - - - - - - - - - - - - - -
-
-
-
- # - add_action_bar -
-
-
-
- -

Adds all the buttons and flows that make up the action bar

-

- - - - - - - - - - - - - - -
-
-
-
- # - player_list_container -
-
-
-
- -

Main player list container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_player_list -
-
-
-
- -

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

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Readme.html b/docs/guis/Readme.html deleted file mode 100644 index 49b7f603..00000000 --- a/docs/guis/Readme.html +++ /dev/null @@ -1,1023 +0,0 @@ - - - - - - - - Readme gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Readme gui

-

Gui Module - Readme - - Adds a main gui that contains lots of important information about our server

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
utils.event
expcore.gui
expcore.roles
expcore.commands
expcore.player_data
expcore.external
expcore.common
util
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub_contentSub content area used within the content areas
title_tableTable which has a title above it above it
title_table_scrollScroll to be used with Gui.title_label tables
join_serverUsed to connect to servers in server list
welcome_contentContent area for the welcome tab
rules_contentContent area for the rules tab
commands_contentContent area for the commands tab
servers_contentContent area for the servers tab
backers_contentContent area for the servers tab
commands_contentContent area for the player data tab
readmeMain readme container for the center flow
readme_toggleToggle button for the readme gui
- - -

Tables

- - - - - - - - -
tooltipnetwork panel black, warning black, download black
- - -

Fields

- - - - - - - - -
hovered_spritenetwork panel white, warning white, download white
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.external -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - sub_content -
-
-
-
- -

Sub content area used within the content areas

-

- - - - - - - - - - - - - - -
-
-
-
- # - title_table -
-
-
-
- -

Table which has a title above it above it

-

- - - - - - - - - - - - - - -
-
-
-
- # - title_table_scroll -
-
-
-
- -

Scroll to be used with Gui.title_label tables

-

- - - - - - - - - - - - - - -
-
-
-
- # - join_server -
-
-
-
- -

Used to connect to servers in server list

-

- - - - - - - - - - - - - - -
-
-
-
- # - welcome_content -
-
-
-
- -

Content area for the welcome tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - rules_content -
-
-
-
- -

Content area for the rules tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - commands_content -
-
-
-
- -

Content area for the commands tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - servers_content -
-
-
-
- -

Content area for the servers tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - backers_content -
-
-
-
- -

Content area for the servers tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - commands_content -
-
-
-
- -

Content area for the player data tab

-

- - - - - - - - - - - - - - -
-
-
-
- # - readme -
-
-
-
- -

Main readme container for the center flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - readme_toggle -
-
-
-
- -

Toggle button for the readme gui

-

- - - - - - - - - - - - - - -
-
-

Tables

-
-
-
-
- # - tooltip -
-
-
-
- -

network panel black, warning black, download black

-

- - - Fields: - -
    - - - - - -
  • - - wrong_version - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - hovered_sprite -
-
-
-
- -

network panel white, warning white, download white

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Rocket-Info.html b/docs/guis/Rocket-Info.html deleted file mode 100644 index 3897a19d..00000000 --- a/docs/guis/Rocket-Info.html +++ /dev/null @@ -1,731 +0,0 @@ - - - - - - - - Rocket-Info gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Rocket-Info gui

-

Gui Module - Rocket Info - - Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
utils.event
config.gui.rockets
utils.color_presets
modules.control.rockets
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
toggle_launchButton to toggle the auto launch on a rocket silo
launch_rocketButton to remotely launch a rocket from a silo
silo_cordsXY cords that allow zoom to map when pressed
rocket_entryBase element for each rocket in the progress list
data_labelData label which contains a name and a value label pair
rocket_list_containerMain gui container for the left flow
toggle_rocket_infoButton on the top flow used to toggle the container
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.gui.rockets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.rockets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - toggle_launch -
-
-
-
- -

Button to toggle the auto launch on a rocket silo

-

- - - - - - - - - - - - - - -
-
-
-
- # - launch_rocket -
-
-
-
- -

Button to remotely launch a rocket from a silo

-

- - - - - - - - - - - - - - -
-
-
-
- # - silo_cords -
-
-
-
- -

XY cords that allow zoom to map when pressed

-

- - - - - - - - - - - - - - -
-
-
-
- # - rocket_entry -
-
-
-
- -

Base element for each rocket in the progress list

-

- - - - - - - - - - - - - - -
-
-
-
- # - data_label -
-
-
-
- -

Data label which contains a name and a value label pair

-

- - - - - - - - - - - - - - -
-
-
-
- # - rocket_list_container -
-
-
-
- -

Main gui container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_rocket_info -
-
-
-
- -

Button on the top flow used to toggle the container

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Science-Info.html b/docs/guis/Science-Info.html deleted file mode 100644 index 47bef742..00000000 --- a/docs/guis/Science-Info.html +++ /dev/null @@ -1,610 +0,0 @@ - - - - - - - - Science-Info gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Science-Info gui

-

Gui Module - Science Info - - Adds a science info gui that shows production usage and net for the different science packs as well as an eta

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.gui
utils.event
config.gui.science
modules.control.production
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - -
production_labelData label that contains the value and the surfix
science_pack_baseAdds 4 elements that show the data for a science pack
task_list_containerMain task list container for the left flow
toggle_science_infoButton on the top flow used to toggle the task list container
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.gui.science -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.production -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - production_label -
-
-
-
- -

Data label that contains the value and the surfix

-

- - - - - - - - - - - - - - -
-
-
-
- # - science_pack_base -
-
-
-
- -

Adds 4 elements that show the data for a science pack

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_list_container -
-
-
-
- -

Main task list container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_science_info -
-
-
-
- -

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

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Task-List.html b/docs/guis/Task-List.html deleted file mode 100644 index f71ab47d..00000000 --- a/docs/guis/Task-List.html +++ /dev/null @@ -1,1134 +0,0 @@ - - - - - - - - Task-List gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Task-List gui

-

Gui Module - Task List - - Adds a task list to the game which players can add, remove and edit items on

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
utils.event
expcore.roles
expcore.datastore
config.gui.tasks
modules.control.tasks
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
add_new_taskButton displayed in the header bar, used to add a new task
no_tasks_foundHeader displayed when no tasks are in the task list
subfooter_frameFrame element with the right styling
subfooter_labelLabel element preset
subfooter_actionsAction flow that contains action buttons
task_list_itemButton element with a flow around it to fix duplicate name inside of the scroll flow
task_listScrollable list of all tasks
task_view_edit_buttonButton element inside the task view footer to start editing a task
task_view_close_buttonButton to close the task view footer
task_view_delete_buttonButton to delete the task inside the task view footer
task_view_footerSubfooter inside the tasklist container that holds all the elements for viewing a task
task_message_textfieldTextfield element used in both the task create and edit footers
task_edit_confirm_buttonButton to confirm the changes inside the task edit footer
edit_task_discard_buttonButton to discard the changes inside the task edit footer
task_edit_footerSubfooter inside the tasklist container that holds all the elements for editing a task
task_create_confirm_buttonButton to confirm the changes inside the task create footer
task_create_discard_buttonButton to discard the changes inside the task create footer
task_create_footerSubfooter inside the tasklist container that holds all the elements to create a new task
task_list_containerMain task list container for the left flow
toggle_left_elementButton on the top flow used to toggle the task list container
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.gui.tasks -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.tasks -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - add_new_task -
-
-
-
- -

Button displayed in the header bar, used to add a new task

-

- - - - - - - - - - - - - - -
-
-
-
- # - no_tasks_found -
-
-
-
- -

Header displayed when no tasks are in the task list

-

- - - - - - - - - - - - - - -
-
-
-
- # - subfooter_frame -
-
-
-
- -

Frame element with the right styling

-

- - - - - - - - - - - - - - -
-
-
-
- # - subfooter_label -
-
-
-
- -

Label element preset

-

- - - - - - - - - - - - - - -
-
-
-
- # - subfooter_actions -
-
-
-
- -

Action flow that contains action buttons

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_list_item -
-
-
-
- -

Button element with a flow around it to fix duplicate name inside of the scroll flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_list -
-
-
-
- -

Scrollable list of all tasks

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_view_edit_button -
-
-
-
- -

Button element inside the task view footer to start editing a task

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_view_close_button -
-
-
-
- -

Button to close the task view footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_view_delete_button -
-
-
-
- -

Button to delete the task inside the task view footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_view_footer -
-
-
-
- -

Subfooter inside the tasklist container that holds all the elements for viewing a task

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_message_textfield -
-
-
-
- -

Textfield element used in both the task create and edit footers

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_edit_confirm_button -
-
-
-
- -

Button to confirm the changes inside the task edit footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - edit_task_discard_button -
-
-
-
- -

Button to discard the changes inside the task edit footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_edit_footer -
-
-
-
- -

Subfooter inside the tasklist container that holds all the elements for editing a task

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_create_confirm_button -
-
-
-
- -

Button to confirm the changes inside the task create footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_create_discard_button -
-
-
-
- -

Button to discard the changes inside the task create footer

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_create_footer -
-
-
-
- -

Subfooter inside the tasklist container that holds all the elements to create a new task

-

- - - - - - - - - - - - - - -
-
-
-
- # - task_list_container -
-
-
-
- -

Main task list container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_left_element -
-
-
-
- -

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

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/Warps-List.html b/docs/guis/Warps-List.html deleted file mode 100644 index 8a4b5cf0..00000000 --- a/docs/guis/Warps-List.html +++ /dev/null @@ -1,1100 +0,0 @@ - - - - - - - - Warps-List gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warps-List gui

-

Gui Module - Warp List - - Adds a warp list gui which allows players to add and remove warp points

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.datastore
utils.global
utils.event
expcore.roles
utils.color_presets
config.gui.warps
modules.control.warps
expcore.common
- - -

Elements

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
add_new_warpWill add a new warp to the list, checks if the player is too close to an existing one
warp_icon_buttonWarp icon button, this will trigger a warp when the player is able to
warp_icon_editingThe button that is visible when the warp is in edit state
warp_labelWarp label, visible if the player is not in edit state
warp_statusWarp status, visible if the player is not in edit state - This will show if the warp is connected or not
warp_textfieldWarp textfield, visible if the player is in edit state
confirm_edit_buttonConfirms the edit to name or icon of the warp
cancel_edit_buttonCancels the editing changes of the selected warp name or icon
remove_warp_buttonRemoves a warp from the list, including the physical area and map tag
edit_warp_buttonOpens edit mode for the warp
add_warp_elementsSet of three elements which make up each row of the warp table
warp_timerThis timer controls when a player is able to warp, eg every 60 seconds
warp_list_containerMain warp list container for the left flow
toggle_warp_listButton on the top flow used to toggle the warp list container
- - -

Functions

- - - - - - - - -
update_all_warp_elements(player, timer, warp_id)Update the warp buttons for a player
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.datastore -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.gui.warps -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.warps -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - add_new_warp -
-
-
-
- -

Will add a new warp to the list, checks if the player is too close to an existing one

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_icon_button -
-
-
-
- -

Warp icon button, this will trigger a warp when the player is able to

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_icon_editing -
-
-
-
- -

The button that is visible when the warp is in edit state

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_label -
-
-
-
- -

Warp label, visible if the player is not in edit state

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_status -
-
-
-
- -

Warp status, visible if the player is not in edit state - This will show if the warp is connected or not

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_textfield -
-
-
-
- -

Warp textfield, visible if the player is in edit state

-

- - - - - - - - - - - - - - -
-
-
-
- # - confirm_edit_button -
-
-
-
- -

Confirms the edit to name or icon of the warp

-

- - - - - - - - - - - - - - -
-
-
-
- # - cancel_edit_button -
-
-
-
- -

Cancels the editing changes of the selected warp name or icon

-

- - - - - - - - - - - - - - -
-
-
-
- # - remove_warp_button -
-
-
-
- -

Removes a warp from the list, including the physical area and map tag

-

- - - - - - - - - - - - - - -
-
-
-
- # - edit_warp_button -
-
-
-
- -

Opens edit mode for the warp

-

- - - - - - - - - - - - - - -
-
-
-
- # - add_warp_elements -
-
-
-
- -

Set of three elements which make up each row of the warp table

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_timer -
-
-
-
- -

This timer controls when a player is able to warp, eg every 60 seconds

-

- - - - - - - - - - - - - - -
-
-
-
- # - warp_list_container -
-
-
-
- -

Main warp list container for the left flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - toggle_warp_list -
-
-
-
- -

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

-

- - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - update_all_warp_elements(player, timer, warp_id) -
-
-
-
- -

Update the warp buttons for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - - - - -
  • - - - - - -
  • - - timer - - - - - -
  • - - - - - -
  • - - warp_id - - : - - - Get the warp table - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/guis/server-ups.html b/docs/guis/server-ups.html deleted file mode 100644 index 91d8636e..00000000 --- a/docs/guis/server-ups.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - - server-ups gui - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

server-ups gui

-

Gui Module - Server UPS - - Adds a server ups counter in the top right and a command to toggle is

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
expcore.gui
utils.event
expcore.commands
expcore.external
expcore.player_data
- - -

Elements

- - - - - - - - -
server_upsLabel to show the server ups
- - -

Commands

- - - - - - - - -
server-upsToggles if the server ups is visbile
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.external -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.player_data -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Elements

-
-
-
-
- # - server_ups -
-
-
-
- -

Label to show the server ups

-

- - - - - - - - - - - - - - -
-
-

Commands

-
-
-
-
- # - server-ups -
-
-
-
- -

Toggles if the server ups is visbile

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 59eeed60..00000000 --- a/docs/index.html +++ /dev/null @@ -1,634 +0,0 @@ - - - - - - - - ExpGaming Scenario - - - - - - - -
-
- - - - - - - -
- - -

Core

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AsyncCore Module - Async -- An extention of task and token to allow a single require to register and run async functions.
CommandsCore Module - Commands -- Factorio command making module that makes commands with better parse and more modularity
CommonCore Module - Common -- Adds some commonly used functions used in many modules
DatastoreCore Module - Datastore -- A module used to store data in the global table with the option to have it sync to an external source.
ExternalCore Module - External -- A module used to make accessing externally set data easier.
GuiCore Module - Gui -- Used to simplify gui creation using factory functions called element defines
GroupsCore Module - Permission Groups -- Permission group making for factorio so you never have to make one by hand again
PlayerDataCore Module - PlayerData -- A module used to store player data in a central datastore to minimize data requests and saves.
RolesCore Module - Roles -- Factorio role system to manage custom permissions.
-

Control

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JailControl Module - Jail - - Adds a way to jail players.
ProductionControl Module - Production - - Common functions used to track production of items
ProtectionControl Module - Protection - - Controls protected entities
ReportsControl Module - Reports - - Adds a way to report players and store report messages.
RocketsControl Module - Rockets - - Stores rocket stats for each force.
SelectionControl Module - Selection - - Controls players who have a selection planner, mostly event handlers
TasksControl Module - Tasks -- Stores tasks for each force.
WarningsControl Module - Warnings - - Adds a way to give and remove warnings to players.
WarpsControl Module - Warps -- Stores warps for each force.
-

Addons

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Advanced-StartAdds a better method of player starting items based on production levels.
afk-kickKicks players when all players on the server are afk
Chat-PopupsCreates flying text entities when a player sends a message in chat; - also displays a ping above users who are named in the message
Chat-ReplyAdds auto replies to chat messages; as well as chat commands
CompilatronAdds a compilatron that walks around the spawn area; adapted from redmew code
Damage-PopupsDisplays the amount of dmg that is done by players to entities; - also shows player health when a player is attacked
Death-LoggerMakes markers on the map where places have died and reclaims items if not recovered
DeconlogLog certain actions into a file when events are triggered
Discord-AlertsSends alert messages to our discord server when certain events are triggered
FAGCAllows the FAGC clientside bot to receive information about bans and unbans and propagate that information to other servers
Inventory-ClearWill move players items to spawn when they are banned or kicked, option to clear on leave
NukeprotectDisable new players from having certain items in their inventory, most commonly nukes
Pollution-GradingMakes polution look much nice of the map, ie not one big red mess
protection-jailWhen a player triggers protection multiple times they are automatically jailed
report-jailWhen a player is reported, the player is automatically jailed if the combined playtime of the reporters exceeds the reported player
Scorched-EarthWhen a player walks around the tiles under them will degrade over time, the same is true when entites are built
Spawn-AreaAdds a custom spawn area with chests and afk turrets
Tree-DeconMakes trees which are marked for decon "decay" quickly to allow faster building
-

Guis

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AutofillGui Module - Autofill - - Adds a button to enable Autofill
Player-ListGui Module - Player List - - Adds a player list to show names and play time; also includes action buttons which can preform actions to players
ReadmeGui Module - Readme - - Adds a main gui that contains lots of important information about our server
Rocket-InfoGui Module - Rocket Info - - Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets
Science-InfoGui Module - Science Info - - Adds a science info gui that shows production usage and net for the different science packs as well as an eta
server-upsGui Module - Server UPS - - Adds a server ups counter in the top right and a command to toggle is
Task-ListGui Module - Task List - - Adds a task list to the game which players can add, remove and edit items on
Warps-ListGui Module - Warp List - - Adds a warp list gui which allows players to add and remove warp points
-

Data

- - - - - - - - - - - - - - - - - - - - - - - - - -
Alt-ViewStores if you use alt mode or not and auto applies it
BonusCommands Module - Bonus - - Adds a command that allows players to have increased stats
GreetingsGreets players on join
Player-ColoursGives players random colours when they join, also applies preset colours to those who have them
QuickbarCommands Module - Quickbar - - Adds a command that allows players to load Quickbar presets
TagCommands Module - Tag - - Adds a command that allows players to have a custom tag after their name
-

Commands

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Admin-ChatCommands Module - Admin Chat - - Adds a command that allows admins to talk in a private chat
Admin-MarkersCommands Module - Admin Markers - - Adds a command that creates map markers which can only be edited by admins
Cheat-ModeCommands Module - Cheat Mode - - Adds a command that allows players to enter cheat mode
Clear-InventoryCommands Module - Clear Inventory - - Adds a command that allows admins to clear people's inventorys
ConnectCommands Module - Connect - - Adds a commands that allows you to request a player move to another server
DebugCommands Module - Debug - - Adds a command that opens the debug frame
FindCommands Module - Find - - Adds a command that zooms in on the given player
HelpCommands Module - Help - - Adds a better help command that allows searching of descriotions and names
HomeCommands Module - Home - - Adds a command that allows setting and teleporting to your home position
InterfaceCommands Module - Interface - - Adds a command that acts as a direct link to the the active softmod, for debug use
JailCommands Module - Jail - - Adds a commands that allow admins to jail and unjail
KillCommands Module - Kill - - Adds a command that allows players to kill them selfs and others
LastLocationCommands Module - Last location - - Adds a command that will return the last location of a player
MeCommands Module - Me - - Adds a command that adds * around your message in the chat
ProtectionCommands Module - Protection - - Adds commands that can add and remove protection
RainbowCommands Module - Rainbow - - Adds a command that prints your message in rainbow font
RepairCommands Module - Repair - - Adds a command that allows an admin to repair and revive a large area
ReportsCommands Module - Reports - - Adds a commands that allow players to report other players
RolesCommands Module - Roles - - Adds a commands that allow interaction with the role system
InventorySearchCommands Module - Inventory Search - - Adds commands that will search all players inventories for an item
SpawnCommands Module - Spawn - - Adds a command that allows players to teleport to their spawn point
SpectateCommands Module - Spectate - - Adds commands relating to spectate and follow
TeleportCommands Module - Teleport - - Adds a command that allows players to teleport to other players
WarningsCommands Module - Warnings - - Adds a commands that allow admins to warn other players
-

Configs

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
File-LoaderThis contains a list of all files that will be loaded and the order they are loaded in; - to stop a file from loading add "--" in front of it, remove the "--" to have the file be loaded; - config files should be loaded after all modules are loaded; - core files should be required by modules and not be present in this list;
Advanced-StartThis file is used to setup the map starting settings and the items players will start with
BonusesLists all bonuses which can be used, name followed by min max
Chat-ReplyThis file defines the different triggers for the chat bot
CompilatronConfig file for the compliatrons including where they spawn and what messages they show
Death-LoggerThis config controls what happens when a player dies mostly about map markers and item collection; - allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present; - if not present then the commands will not be loaded into the game
DeconlogThis config controls whether actions such as deconning by players without sufficient permissions is logged or not
Discord-AlertsConfig file used to enable and disable different push messages for discord
Commands-Auth-AdminThis is a very simple config file which adds a admin only auth function; - not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua; - either way you can change the requirements to be "admin" if you wanted to
Commands-Auth-RolesThis will make commands only work if the role has been allowed it in the role config
Commands-Color-ParseThis will make commands only work when a valid color from the presets has been selected
Commands-ParseThis file contains some common command param parse functions; -this file is less of a config and more of a requirement but you may wish to change how some behave; -as such you need to be confident with lua but you edit this config file; -use Commands.add_parse('name',function(input, player, reject) end) to add a parse; -see ./expcore/commands.lua for more details
Commands-Parse-RolesAdds some parse functions that can be used with the role system
Commands-Auth-Runtime-DisableThis config for command auth allows commands to be globally enabled and disabled during runtime; - this config adds Commands.disable and Commands.enable to enable and disable commands for all users
Permission-GroupsUse this file to add new permission groups to the game; - start with Permission_Groups.new_group('name'); - then use either :allow_all() or :disallow_all() to set the default for non specified actions; - then use :allow{} and :disallow{} to specify certain actions to allow/disallow
RolesThis is the main config file for the role system; file includes defines for roles and role flags and default values
AutofillThis file contains all the different settings for the autofill system and gui
Player-ListConfig for the different action buttons that show on the player list; - each button has the button define(s) given along side an auth function, and optional reason callback; - if a reason callback is used then Store.set(action_name_store,player.name,'BUTTON_NAME') should be called during on_click; - buttons can be removed from the gui by commenting them out of the config at the bottom of this file; - the key used for the name of the button is the permission name used by the role system;
RocketsThis file controls what will show in each section of the rocket info gui
ScienceConfig file for the science info gui
TasksConfig file for the tasks gui
WarpsThis file contains all the different settings for the warp system and gui
inventory_clearConfig to control when players items are removed, this is a list of event names that will trigger inventory clear
Pollution-GradingThis controls how pollution is viewed on the map
Popup-MessagesA combination of config settings for different popup values like chat and damage
Preset-Player-ColoursPreset colours that players get when they join the server, if not in the list then will be given a random colour (which isnt disallowed)
Preset-Player-QuickbarPreset quickbar items that players can load
RepairConfig file for the repair command
Scorched-EarthThis file controls the placement/degrading of tiles as players build and walk
Spawn-AreaUsed to config the spawn generation settings yes there is alot here i know just ignore the long tables at the end (they were generated with a command)
StatisticsA list of all tracked statistics and the events which trigger them
WarningsConfig file for the warning system, this is very similar to reports but is for the use of moderators rather than normal users.
-

Modules

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
controlPlease go to ./config if you want to change settings, each file is commented with what it does - if it is not in ./config then you should not attempt to change it unless you know what you are doing - all files which are loaded (including the config files) are present in ./config/file_loader.lua - this file is the landing point for all scenarios please DO NOT edit directly, further comments are to aid development
modules.addons.station-auto-nameLuaPlayerBuiltEntityEventFilters -Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name = "fast-inserter"}})
overrides.debug
overrides.mathTakes two points and calculates the slope of a line
overrides.tableSearches a table to remove a specific element without an index
utils.eventThis Module allows for registering multiple handlers to the same event, overcoming the limitation of script.register.
utils.event_coreDo not use this function, use Event.add instead as it has safety checks.
utils.taskThreading simulation module - Task.sleep()
-

Topics

- - - - - - - -
README.md
LICENSE
- - - - - - -
-
-
- - - - diff --git a/docs/modules/ExpStyle.html b/docs/modules/ExpStyle.html deleted file mode 100644 index fede875a..00000000 --- a/docs/modules/ExpStyle.html +++ /dev/null @@ -1,1343 +0,0 @@ - - - - - - - - ExpStyle module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

ExpStyle module

-

Core Module - ExpStyle

-

- - - - - - - - - - - - - -

Dependencies

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

Elements

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

Functions

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

Dependencies

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

Elements

-
-
-
-
- # - container -
-
-
-
- -

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

-

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

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

-

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

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

-

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

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

-

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

A table that is inside a vertical scroll area

-

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

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

-

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

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

-

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

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

-

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

Functions

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

Updates the time that is on a label

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the label that you want to update - -
  • - - - - - -
  • - - time - - : - - (number) - - the number of tick you want it to show - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Update the time to show game time
-time_label:update_time(element,game.time)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/Gui.html b/docs/modules/Gui.html deleted file mode 100644 index 4ff9023c..00000000 --- a/docs/modules/Gui.html +++ /dev/null @@ -1,4332 +0,0 @@ - - - - - - - - Gui module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Gui module

-

Core Module - Gui -- Gui defines that are used internally by the gui system

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event
mod-gui
utils.event
mod-gui
- - -

Tables

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
eventsString indexed table used to avoid conflict with custom event names, similar to how defines.events works
definesUid indexed array that stores all the factory functions that were defined, no new values will be added during runtime
core_definesAn string indexed table of all the defines which are used by the core of the gui system, used for internal refrence
file_pathsUsed to store the file names where elements were defined, this can be useful to find the uid of an element, mostly for debuging
debug_infoUsed to store extra infomation about elements as they get defined such as the params used and event handlers registered to them
_prototype_elementThe prototype used to store the functions of an element define
_mt_elementThe prototype metatable applied to new element defines
- - -

Fields

- - - - - - - - -
uidThe current highest uid that is being used by a define, will not increase during runtime
- - -

Core Defines

- - - - - - - - - - - - - - - - -
hide_top_flowButton which toggles the top flow elements, version which shows inside the top flow when top flow is visible
show_top_flowButton which toggles the top flow elements, version which shows inside the left flow when top flow is hidden
hide_left_flowButton which hides the elements in the left flow, shows inside the left flow when frames are visible
- - -

Defines

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
alignmentDraw a flow used to align its child elements, default is right align
scroll_tableDraw a scroll pane that has a table inside of it
headerUsed to add a frame with the header style, has the option for a right alignment flow for buttons
footerUsed to add a frame with the footer style, has the option for a right alignment flow for buttons
containerUsed for left frames to give them a nice boarder
barUsed to make a solid white bar in a gui
centered_labelUsed to make a label which is centered and of a certian size
title_labelUsed to make a title which has two bars on either side
- - -

Helper Functions

- - - - - - - - - - - - - - - - - - - - - - - - -
get_player_from_element(element)Get the player that owns a gui element
toggle_enabled_state(element[, state])Will toggle the enabled state of an element or set it to the one given
toggle_visible_state(element[, state])Will toggle the visible state of an element or set it to the one given
destroy_if_valid(element)Destory a gui element without causing any errors, often because the element was already removed
sprite_style(size[, padding=-2][, style])Returns a table to be used as the style for a sprite buttons, produces a sqaure button
- - -

Left Flow

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
left_elementsContains the uids of the elements that will shown on the left flow and their join functions
get_left_flow(player)Gets the flow refered to as the left flow, each player has one left flow
Gui._prototype_element:add_to_left_flow([open_on_join])Sets an element define to be drawn to the left flow when a player joins, includes optional check
left_toolbar_button(sprite, tooltip, element_define[, authenticator])Creates a button on the top flow which will toggle the given element define, the define must exist in the left flow
draw_left_flow(player)Draw all the left elements onto the left flow, internal use only with on join
update_left_flow(player)Update the visible state of the hide button, can be used to check if any frames are visible
hide_left_flow(player)Hides all left elements for a player
get_left_element(player, element_define)Get the element define that is in the left flow, use in events without an element refrence
toggle_left_element(player, element_define[, state])Toggles the visible state of a left element for a given player, can be used to set the visible state
- - -

Element Define

- - - - - - - - - - - - - - - - - - - - -
element(element_define)Used to define new elements for your gui, can be used like LuaGuiElement.add or a custom function
Gui._prototype_element:style(style_define)Used to extent your element define with a style factory, this style will be applied to your element when created, can also be a custom function
Gui._prototype_element:on_custom_event(event_name, handler)Set the handler which will be called for a custom event, only one handler can be used per event per element
Gui._prototype_element:raise_custom_event(event)Raise the handler which is attached to an event; external use should be limited to custom events
- - -

Element Events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Gui._prototype_element.on_openCalled when the player opens a GUI.
Gui._prototype_element.on_closeCalled when the player closes the GUI they have open.
Gui._prototype_element.on_clickCalled when LuaGuiElement is clicked.
Gui._prototype_element.on_confirmedCalled when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.
Gui._prototype_element.on_checked_changedCalled when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).
Gui._prototype_element.on_elem_changedCalled when LuaGuiElement element value is changed (related to choose element buttons).
Gui._prototype_element.on_location_changedCalled when LuaGuiElement element location is changed (related to frames in player.gui.screen).
Gui._prototype_element.on_tab_changedCalled when LuaGuiElement selected tab is changed (related to tabbed-panes).
Gui._prototype_element.on_selection_changedCalled when LuaGuiElement selection state is changed (related to drop-downs and listboxes).
Gui._prototype_element.on_switch_changedCalled when LuaGuiElement switch state is changed (related to switches).
Gui._prototype_element.on_text_changedCalled when LuaGuiElement text is changed by the player.
Gui._prototype_element.on_value_changedCalled when LuaGuiElement slider value is changed (related to the slider element).
- - -

Top Flow

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
top_elementsContains the uids of the elements that will shown on the top flow and their auth functions
top_flow_button_styleThe style that should be used for buttons on the top flow
top_flow_button_visible_styleThe style that should be used for buttons on the top flow when their flow is visible
get_top_flow(player)Gets the flow refered to as the top flow, each player has one top flow
Gui._prototype_element:add_to_top_flow([authenticator])Sets an element define to be drawn to the top flow when a player joins, includes optional authenticator
update_top_flow(player)Updates the visible state of all the elements on the players top flow, uses authenticator
toggle_top_flow(player[, state])Toggles the visible state of all the elements on a players top flow, effects all elements
get_top_element(player, element_define)Get the element define that is in the top flow, use in events without an element refrence
toolbar_button(sprite, tooltip[, authenticator])Creates a button on the top flow with consistent styling
toolbar_button_style(button, state)Styles a top flow button depending on the state given
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Tables

-
-
-
-
- # - events -
-
-
-
- -

String indexed table used to avoid conflict with custom event names, similar to how defines.events works

-

- - - - - - - - - - - - - - -
-
-
-
- # - defines -
-
-
-
- -

Uid indexed array that stores all the factory functions that were defined, no new values will be added during runtime

-

- - - - - - - - - - - - - - -
-
-
-
- # - core_defines -
-
-
-
- -

An string indexed table of all the defines which are used by the core of the gui system, used for internal refrence

-

- - - - - - - - - - - - - - -
-
-
-
- # - file_paths -
-
-
-
- -

Used to store the file names where elements were defined, this can be useful to find the uid of an element, mostly for debuging

-

- - - - - - - - - - - - - - -
-
-
-
- # - debug_info -
-
-
-
- -

Used to store extra infomation about elements as they get defined such as the params used and event handlers registered to them

-

- - - - - - - - - - - - - - -
-
-
-
- # - _prototype_element -
-
-
-
- -

The prototype used to store the functions of an element define

-

- - - - - - - - - - - - - - -
-
-
-
- # - _mt_element -
-
-
-
- -

The prototype metatable applied to new element defines

-

- - - Fields: - -
    - - - - - -
  • - - __call - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - uid -
-
-
-
- -

The current highest uid that is being used by a define, will not increase during runtime

-

- - - -
    - - - - - -
  • - - uid - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-

Core Defines

-
-
-
-
- # - hide_top_flow -
-
-
-
- -

Button which toggles the top flow elements, version which shows inside the top flow when top flow is visible

-

- - - - - - - - - - - - - - -
-
-
-
- # - show_top_flow -
-
-
-
- -

Button which toggles the top flow elements, version which shows inside the left flow when top flow is hidden

-

- - - - - - - - - - - - - - -
-
-
-
- # - hide_left_flow -
-
-
-
- -

Button which hides the elements in the left flow, shows inside the left flow when frames are visible

-

- - - - - - - - - - - - - - -
-
-

Defines

-
-
-
-
- # - alignment -
-
-
-
- -

Draw a flow used to align its child elements, default is right align

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the alignment will be added - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the alignment flow which is added - - (default: 'alignment') -
  • - - - - - -
  • - - horizontal_align - - : - - (string) - - the horizontal alignment of the elements in the flow - - (default: 'right') -
  • - - - - - -
  • - - vertical_align - - : - - (string) - - the vertical alignment of the elements in the flow - - (default: 'center') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a right align flow
-local alignment = Gui.alignment(element,'example_right_alignment')
-
-- Adding a horizontal center and top align flow
-local alignment = Gui.alignment(element,'example_center_top_alignment','center','top')
- - -
-
-
-
- # - scroll_table -
-
-
-
- -

Draw a scroll pane that has a table inside of it

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the scroll table will be added - -
  • - - - - - -
  • - - height - - : - - (number) - - the maximum height for the scroll pane - -
  • - - - - - -
  • - - column_count - - : - - (number) - - the number of columns that the table will have - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the scroll pane that is added, the table is always called "table" - - (default: 'scroll') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a scroll table with max height of 200 and column count of 3
-local scroll_table = Gui.scroll_table(element,200,3)
- - -
-
-
-
- # - header -
-
-
-
- -

Used to add a frame with the header style, has the option for a right alignment flow for buttons

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the header will be added - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the header - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the header - - (optional) -
  • - - - - - -
  • - - add_alignment - - : - - (boolean) - - when true an alignment flow will be added to the header - - (default: false) -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the header that is being added, the alignment is always called "alignment" - - (default: 'header') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a custom header with a label
-local header = Gui.header(
-    element,
-    'Example Caption',
-    'Example Tooltip'
-)
- - -
-
-
-
- # - footer -
-
-
-
- -

Used to add a frame with the footer style, has the option for a right alignment flow for buttons

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the footer will be added - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the footer - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the footer - - (optional) -
  • - - - - - -
  • - - add_alignment - - : - - (boolean) - - when true an alignment flow will be added to the footer - - (default: false) -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the footer that is being added, the alignment is always called "alignment" - - (default: 'footer') -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a custom footer with a label
-local footer = Gui.footer(
-    element,
-    'Example Caption',
-    'Example Tooltip'
-)
- - -
-
-
-
- # - container -
-
-
-
- -

Used for left frames to give them a nice boarder

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the container will be added - -
  • - - - - - -
  • - - name - - : - - (string) - - the name that you want to give to the outer frame, often just event_trigger - -
  • - - - - - -
  • - - width - - : - - (number) - - the minimal width that the frame will have - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a container as a base
-local container = Gui.container(parent,'my_container',200)
- - -
-
-
-
- # - bar -
-
-
-
- -

Used to make a solid white bar in a gui

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the bar will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the bar that will be made, if not given bar will strech to fill the parent - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a bar to a gui
-local bar = Gui.bar(parent, 100)
- - -
-
-
-
- # - centered_label -
-
-
-
- -

Used to make a label which is centered and of a certian size

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the label will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the label, must be given in order to center the caption - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the label - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the label - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a centered label
-local label = Gui.centered_label(parent, 100, 'This is centered')
- - -
-
-
-
- # - title_label -
-
-
-
- -

Used to make a title which has two bars on either side

-

- - - Properties / Events: - -
    - - - - - -
  • - - parent - - : - - (LuaGuiElement) - - the parent element to which the label will be added - -
  • - - - - - -
  • - - width - - : - - (number) - - the width of the first bar, this can be used to position the label - -
  • - - - - - -
  • - - caption - - : - - (string or LocalizedString) - - the caption that will be shown on the label - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that will be shown on the label - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Adding a centered label
-local label = Gui.centered_label(parent, 100, 'This is centered')
- - -
-
-

Helper Functions

-
-
-
-
- # - get_player_from_element(element) -
-
-
-
- -

Get the player that owns a gui element

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to get the owner of - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaPlayer) - the player that owns this element -
  • -
- - - - - - - - Usage: -
-- Geting the owner of an element
-local player = Gui.get_player_from_element(element)
- - -
-
-
-
- # - toggle_enabled_state(element[, state]) -
-
-
-
- -

Will toggle the enabled state of an element or set it to the one given

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to toggle/set the enabled state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new enabled state that the element has -
  • -
- - - - - - - - Usage: -
-- Toggling the the enabled state
-local new_enabled_state = Gui.toggle_enabled_state(element)
- - -
-
-
-
- # - toggle_visible_state(element[, state]) -
-
-
-
- -

Will toggle the visible state of an element or set it to the one given

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element to toggle/set the visible state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state that the element has -
  • -
- - - - - - - - Usage: -
-- Toggling the the visible state
-local new_visible_state = Gui.toggle_visible_state(element)
- - -
-
-
-
- # - destroy_if_valid(element) -
-
-
-
- -

Destory a gui element without causing any errors, often because the element was already removed

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that you want to remove - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the element was valid and has been removed -
  • -
- - - - - - - - Usage: -
-- Remove a child element if it exists
-Gui.destroy_if_valid(element[child_name])
- - -
-
-
-
- # - sprite_style(size[, padding=-2][, style]) -
-
-
-
- -

Returns a table to be used as the style for a sprite buttons, produces a sqaure button

-

- - - Parameters: - -
    - - - - - -
  • - - size - - : - - (number) - - the size that you want the button to be - -
  • - - - - - -
  • - - padding - - : - - (number) - - the padding that you want on the sprite - - (default: -2) -
  • - - - - - -
  • - - style - - : - - (table) - - any extra style settings that you want to have - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the style table to be used with element_define:style() -
  • -
- - - - - - - - Usage: -
-- Adding a sprite button with size 20
-local button =
-Gui.element{
-    type = 'sprite-button',
-    sprite = 'entity/inserter'
-}
-:style(Gui.sprite_style(20))
- - -
-
-

Left Flow

-
-
-
-
- # - left_elements -
-
-
-
- -

Contains the uids of the elements that will shown on the left flow and their join functions

-

- - - - - - - - - - - - - - -
-
-
-
- # - get_left_flow(player) -
-
-
-
- -

Gets the flow refered to as the left flow, each player has one left flow

-

(player)

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the left flow for - -
  • - - -
- - - - - Returns: - - - - - - - - - Usage: -
-- Geting your left flow
-local left_flow = Gui.get_left_flow(game.player)
- - -
-
-
-
- # - Gui._prototype_element:add_to_left_flow([open_on_join]) -
-
-
-
- -

Sets an element define to be drawn to the left flow when a player joins, includes optional check

-

- - - Parameters: - -
    - - - - - -
  • - - open_on_join - - : - - (boolean or function) - - called during first darw to decide if the element should be visible - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define that is used to register events to this element -
  • -
- - - - - - - - Usage: -
-- Adding the example button
-example_flow_with_button:add_to_left_flow(true)
- - -
-
-
-
- # - left_toolbar_button(sprite, tooltip, element_define[, authenticator]) -
-
-
-
- -

Creates a button on the top flow which will toggle the given element define, the define must exist in the left flow

-

- - - Parameters: - -
    - - - - - -
  • - - sprite - - : - - (string) - - the sprite that you want to use on the button - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that you want the button to have - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element define that you want to have toggled by this button, define must exist on the left flow - -
  • - - - - - -
  • - - authenticator - - : - - (function) - - used to decide if the button should be visible to a player - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a button to toggle a left element
-local toolbar_button =
-Gui.left_toolbar_button('entity/inserter', 'Nothing to see here', example_flow_with_button, function(player)
-    return player.admin
-end)
- - -
-
-
-
- # - draw_left_flow(player) -
-
-
-
- -

Draw all the left elements onto the left flow, internal use only with on join

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to draw the elements for - -
  • - - -
- - - - - - - - - - - - Usage: -
 Draw all the left elements
-Gui.draw_left_flow(player)
- - -
-
-
-
- # - update_left_flow(player) -
-
-
-
- -

Update the visible state of the hide button, can be used to check if any frames are visible

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to update the left flow for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if any left element is visible -
  • -
- - - - - - - - Usage: -
-- Check if any left elements are visible
-local visible = Gui.update_left_flow(player)
- - -
-
-
-
- # - hide_left_flow(player) -
-
-
-
- -

Hides all left elements for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to hide the elements for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Hide your left elements
-Gui.hide_left_flow(game.player)
- - -
-
-
-
- # - get_left_element(player, element_define) -
-
-
-
- -

Get the element define that is in the left flow, use in events without an element refrence

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the gui element linked to this define for this player -
  • -
- - - - - - - - Usage: -
-- Get your left element
-local frame = Gui.get_left_element(game.player, example_flow_with_button)
- - -
-
-
-
- # - toggle_left_element(player, element_define[, state]) -
-
-
-
- -

Toggles the visible state of a left element for a given player, can be used to set the visible state

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to toggle the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to toggle - -
  • - - - - - -
  • - - state - - : - - (boolean) - - with given will set the state, else state will be toggled - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state of the element -
  • -
- - - - - - - - Usage: -
-- Toggle your example button
-Gui.toggle_top_flow(game.player, example_flow_with_button)
-
-- Show your example button
-Gui.toggle_top_flow(game.player, example_flow_with_button, true)
- - -
-
-

Element Define

-
-
-
-
- # - element(element_define) -
-
-
-
- -

Used to define new elements for your gui, can be used like LuaGuiElement.add or a custom function

-

- - - Parameters: - -
    - - - - - -
  • - - element_define - - : - - (table or function) - - the define information for the gui element, same data as LuaGuiElement.add, or a custom function may be used - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define, this can be considered a factory for the element which can be called to draw the element to any other element -
  • -
- - - - - - - - Usage: -
-- Using element defines like LuaGuiElement.add
--- This returns a factory function to draw a button with the caption "Example Button"
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button'
-}
-
-- Using element defines with a custom factory function
--- This method can be used if you still want to be able register event handlers but it is too complex to be compatible with LuaGuiElement.add
-local example_flow_with_button =
-Gui.element(function(event_trigger,parent,...)
-    -- ... shows that all other arguments from the factory call are passed to this function
-    -- parent is the element which was passed to the factory function where you should add your new element
-    -- here we are adding a flow which we will then later add a button to
-    local flow =
-    parent.add{
-        name = 'example_flow',
-        type = 'flow'
-    }
-
-    -- event_trigger should be the name of any elements you want to trigger your event handlers, such as on_click or on_state_changed
-    -- now we add the button to the flow that we created earlier
-    local element =
-    flow.add{
-        name = event_trigger,
-        type = 'button',
-        caption = 'Example Button'
-    }
-
-    -- you must return your new element, this is so styles can be applied and returned to the caller
-    -- you may return any of your elements that you add, consider the context in which it will be used for what should be returned
-    return element
-end)
- - -
-
-
-
- # - Gui._prototype_element:style(style_define) -
-
-
-
- -

Used to extent your element define with a style factory, this style will be applied to your element when created, can also be a custom function

-

- - - Parameters: - -
    - - - - - -
  • - - style_define - - : - - (table or function) - - style table where each key and value pair is treated like LuaGuiElement.style[key] = value, a custom function can be used - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define is returned to allow for event handlers to be registered -
  • -
- - - - - - - - Usage: -
-- Using the table method of setting the style
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style{
-    height = 25, -- same as element.style.height = 25
-    width = 100 -- same as element.style.width = 25
-}
-
-- Using the function method to set the style
--- Use this method if your style is dynamic and depends on other factors
-local example_button =
-Gui.element{
-    type = 'button',
-    caption = 'Example Button',
-    style = 'forward_button' -- factorio styles can be applied here
-}
-:style(function(style,element,...)
-    -- style is the current style object for the elemenent
-    -- element is the element that is being changed
-    -- ... shows that all other arguments from the factory call are passed to this function
-    local player = game.players[element.player_index]
-    style.height = 25
-    style.width = 100
-    style.font_color = player.color
-end)
- - -
-
-
-
- # - Gui._prototype_element:on_custom_event(event_name, handler) -
-
-
-
- -

Set the handler which will be called for a custom event, only one handler can be used per event per element

-

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - (string) - - the name of the event you want to handler to be called on, often from Gui.events - -
  • - - - - - -
  • - - handler - - : - - (function) - - the handler that you want to be called when the event is raised - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define so more handleres can be registered -
  • -
- - - - - - - - Usage: -
-- Register a handler to "my_custom_event" for this element
-element_deinfe:on_custom_event('my_custom_event', function(event)
-    event.player.print(player.name)
-end)
- - -
-
-
-
- # - Gui._prototype_element:raise_custom_event(event) -
-
-
-
- -

Raise the handler which is attached to an event; external use should be limited to custom events

-

- - - Parameters: - -
    - - - - - -
  • - - event - - : - - (table) - - the event table passed to the handler, must contain fields: name, element - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the element define so more events can be raised -
  • -
- - - - - - - - Usage: -
 Raising a custom event
-element_define:raise_custom_event{
-    name = 'my_custom_event',
-    element = element
-}
- - -
-
-

Element Events

-
-
-
-
- # - Gui._prototype_element.on_open -
-
-
-
- -

Called when the player opens a GUI.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_close -
-
-
-
- -

Called when the player closes the GUI they have open.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_click -
-
-
-
- -

Called when LuaGuiElement is clicked.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_confirmed -
-
-
-
- -

Called when a LuaGuiElement is confirmed, for example by pressing Enter in a textfield.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_checked_changed -
-
-
-
- -

Called when LuaGuiElement checked state is changed (related to checkboxes and radio buttons).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_elem_changed -
-
-
-
- -

Called when LuaGuiElement element value is changed (related to choose element buttons).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_location_changed -
-
-
-
- -

Called when LuaGuiElement element location is changed (related to frames in player.gui.screen).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_tab_changed -
-
-
-
- -

Called when LuaGuiElement selected tab is changed (related to tabbed-panes).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_selection_changed -
-
-
-
- -

Called when LuaGuiElement selection state is changed (related to drop-downs and listboxes).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_switch_changed -
-
-
-
- -

Called when LuaGuiElement switch state is changed (related to switches).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_text_changed -
-
-
-
- -

Called when LuaGuiElement text is changed by the player.

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Gui._prototype_element.on_value_changed -
-
-
-
- -

Called when LuaGuiElement slider value is changed (related to the slider element).

-

- - - -
    - - - - - -
  • - - handler - - : - - (function) - - the event handler which will be called - -
  • - - -
- - - - - - - - - - - - - -
-
-

Top Flow

-
-
-
-
- # - top_elements -
-
-
-
- -

Contains the uids of the elements that will shown on the top flow and their auth functions

-

- - - - - - - - - - - - - - -
-
-
-
- # - top_flow_button_style -
-
-
-
- -

The style that should be used for buttons on the top flow

-

- - - - - - - - - - - - - - -
-
-
-
- # - top_flow_button_visible_style -
-
-
-
- -

The style that should be used for buttons on the top flow when their flow is visible

-

- - - - - - - - - - - - - - -
-
-
-
- # - get_top_flow(player) -
-
-
-
- -

Gets the flow refered to as the top flow, each player has one top flow

-

(player)

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the flow for - -
  • - - -
- - - - - Returns: - - - - - - - - - Usage: -
-- Geting your top flow
-local top_flow = Gui.get_top_flow(game.player)
- - -
-
-
-
- # - Gui._prototype_element:add_to_top_flow([authenticator]) -
-
-
-
- -

Sets an element define to be drawn to the top flow when a player joins, includes optional authenticator

-

- - - Parameters: - -
    - - - - - -
  • - - authenticator - - : - - (function) - - called during toggle or update to decide weather the element should be visible - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new element define to allow event handlers to be registered -
  • -
- - - - - - - - Usage: -
-- Adding an element to the top flow on join
-example_button:add_to_top_flow(function(player)
-    -- example button will only be shown if the player is an admin
-    -- note button will not update its state when player.admin is changed Gui.update_top_flow must be called for this
-    return player.admin
-end)
- - -
-
-
-
- # - update_top_flow(player) -
-
-
-
- -

Updates the visible state of all the elements on the players top flow, uses authenticator

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to update the top flow for - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Update your top flow
-Gui.update_top_flow(game.player)
- - -
-
-
-
- # - toggle_top_flow(player[, state]) -
-
-
-
- -

Toggles the visible state of all the elements on a players top flow, effects all elements

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to toggle the top flow for - -
  • - - - - - -
  • - - state - - : - - (boolean) - - if given then the state will be set to this - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new visible state of the top flow -
  • -
- - - - - - - - Usage: -
-- Toggle your flow
-Gui.toggle_top_flow(game.player)
-
-- Open your top flow
-Gui.toggle_top_flow(game.player,true)
- - -
-
-
-
- # - get_top_element(player, element_define) -
-
-
-
- -

Get the element define that is in the top flow, use in events without an element refrence

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that you want to get the element for - -
  • - - - - - -
  • - - element_define - - : - - (table) - - the element that you want to get - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the gui element linked to this define for this player -
  • -
- - - - - - - - Usage: -
-- Get your top element
-local button = Gui.get_top_element(game.player, example_button)
- - -
-
-
-
- # - toolbar_button(sprite, tooltip[, authenticator]) -
-
-
-
- -

Creates a button on the top flow with consistent styling

-

- - - Parameters: - -
    - - - - - -
  • - - sprite - - : - - (string) - - the sprite that you want to use on the button - -
  • - - - - - -
  • - - tooltip - - : - - (string or LocalizedString) - - the tooltip that you want the button to have - -
  • - - - - - -
  • - - authenticator - - : - - (function) - - used to decide if the button should be visible to a player - - (optional) -
  • - - -
- - - - - - - - - - - - Usage: -
-- Add a button to the toolbar
-local toolbar_button =
-Gui.left_toolbar_button('entity/inserter', 'Nothing to see here', function(player)
-    return player.admin
-end)
- - -
-
-
-
- # - toolbar_button_style(button, state) -
-
-
-
- -

Styles a top flow button depending on the state given

-

- - - Parameters: - -
    - - - - - -
  • - - button - - : - - (LuaGuiElement) - - the button element to style - -
  • - - - - - -
  • - - state - - : - - (boolean) - - The state the button is in - -
  • - - -
- - - - - - - - - - - - Usage: -
-- Sets the button to the visible style
-Gui.toolbar_button_style(button, true)
-
-- Sets the button to the hidden style
-Gui.toolbar_button_style(button, false)
- - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/Jail.html b/docs/modules/Jail.html deleted file mode 100644 index a03abf37..00000000 --- a/docs/modules/Jail.html +++ /dev/null @@ -1,1169 +0,0 @@ - - - - - - - - Jail module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Jail module

-

Control Module - Jail - - Adds a way to jail players and temp ban players.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Jail = require 'modules.control.jail'
-
-    -- This will move 'MrBiter' to the jail role and remove all other roles from them
-    -- the player name and reason are only so they can be included in the event for user feedback
-    Jail.jail_player('MrBiter','Cooldude2606','Likes biters too much')
-
-    -- This will give 'MrBiter' all his roles back and remove him from jail
-    -- again as above the player name is only used in the event for user feedback
-    Jail.unjail_player('MrBiter','Cooldude2606')
-
-    -- Temp ban works the same as jail but will store the reason and move the players items to spawn
-    -- this is meant to be used as a more permiment jail but not as strong as a ban
-    Jail.temp_ban_player('MrBiter','Cooldude2606','Likes biters too much')
- - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - -
expcore.rolesAllows moving players into the jail role
utils.gameAllows accessing a player from any value
utils.globalAllows storing data in the global table
expcore.commonUse of move_items to clear inventroies
- - -

Events

- - - - - - - - - - - - - - - - - - - - -
on_player_jailedWhen a player is assigned to jail
on_player_unjailedWhen a player is unassigned from jail
on_player_temp_bannedWhen a player is temp banned
on_player_untemp_bannedWhen a temp ban is removed from a player
- - -

Jail functions

- - - - - - - - - - - - - - - - -
is_jailed (player)Checks if the player is currently in jail
jail_player (player, by_player_name[, reason='Non given.'])Moves a player to jail and removes all other roles
unjail_player (player, by_player_name)Moves a player out of jail and restores all roles previously removed
- - -

Temp ban functions

- - - - - - - - - - - - - - - - -
is_temp_banned (player)Checks if a player is temp banned
temp_ban_player (player, by_player_name[, reason='Non given.'])Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn
untemp_ban_player (player, by_player_name)Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- -

Allows moving players into the jail role

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- -

Allows accessing a player from any value

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- -

Allows storing data in the global table

-

- - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- -

Use of move_items to clear inventroies

-

- - - - - - - - - - - - - - -
-
-

Events

-
-
-
-
- # - on_player_jailed -
-
-
-
- -

When a player is assigned to jail

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was jailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who jailed the other player - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was jailed - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_player_unjailed -
-
-
-
- -

When a player is unassigned from jail

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was unjailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who unjailed the other player - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_player_temp_banned -
-
-
-
- -

When a player is temp banned

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was temp banned - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who temp banned the other player - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was temp banned - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_player_untemp_banned -
-
-
-
- -

When a temp ban is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who was untemp banned - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who untemp banned the other player - -
  • - - -
- - - - - - - - - - - - - -
-
-

Jail functions

-
-
-
-
- # - is_jailed (player) -
-
-
-
- -

Checks if the player is currently in jail

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if they are in jail - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player is currently in jail -
  • -
- - - - - - - - - -
-
-
-
- # - jail_player (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Moves a player to jail and removes all other roles

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player who will be jailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the jailing - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being jailed - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - wheather the user was jailed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - unjail_player (player, by_player_name) -
-
-
-
- -

Moves a player out of jail and restores all roles previously removed

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be unjailed - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that is doing the unjail - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player was unjailed successfully -
  • -
- - - - - - - - - -
-
-

Temp ban functions

-
-
-
-
- # - is_temp_banned (player) -
-
-
-
- -

Checks if a player is temp banned

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if they are temp banned - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player is temp banned -
  • -
- - - - - - - - - -
-
-
-
- # - temp_ban_player (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be temp banned - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the temp ban - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being temp banned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player was successfully temp banned -
  • -
- - - - - - - - - -
-
-
-
- # - untemp_ban_player (player, by_player_name) -
-
-
-
- -

Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player who is being removed from temp ban - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the untemp ban - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the player was successfully removed -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/Production.html b/docs/modules/Production.html deleted file mode 100644 index ca9dbceb..00000000 --- a/docs/modules/Production.html +++ /dev/null @@ -1,1281 +0,0 @@ - - - - - - - - Production module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Production module

-

Control Module - Production - - Common functions used to track production of items

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Production = require 'modules.control.production'
-
-    -- This will return the less precise index from the one given
-    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
-    -- the other precision work like wise
-    Production.precision_up(defines.flow_precision_index.one_second)
-
-    -- The get production function is used to get production, consumion and net
-    -- it may be used for any item and with any precision level, use total for total
-    Production.get_production(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
-
-    -- The fluctuations works by compearing recent production with the average over time
-    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
-    Production.get_fluctuations(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
-
-    -- ETA is calculated based on what function you use but all share a similar method
-    -- for production eta it will take current production average given by the precision
-    -- and work out how many ticks it will require to make the required amount (1000 by default)
-    Production.get_production_eta(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute,250000)
-
-    -- Both get_color and format_number are helper functions to help format production stats
-    -- get_color will return green,orange,red,or grey based on the active_value
-    -- the passive_value is used when active_value is 0 and can only return orange,red,or grey
-    Production.get_color(clamp,active_value,passive_value)
- - - - - - - -

Dependencies

- - - - - - - - - - - - -
resources.color_presetsProvides colors for Production.get_color
utilProvides format_number function to add surfixs
- - -

Precision

- - - - - - - - - - - - - - - - -
precision_up (precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
precision_down (precision)Gets the next greater precision index value, eg 1 minute -> 1 second
precision_ticks (precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
- - -

Stats

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_production_total (force, item_name)Returns the production data for the whole game time
get_production (force, item_name, precision)Returns the production data for the given precision game time
get_fluctuations (force, item_name, precision)Returns the current fluctuation from the average
get_production_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
get_consumsion_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
get_net_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
- - -

Formating

- - - - - - - - - - - - -
get_color (clamp, active_value, passive_value)Returns a color value bassed on the value that was given
format_number (value)Returns three parts used to format a number
- - -
- - -

Dependencies

-
-
-
-
- # - resources.color_presets -
-
-
-
- -

Provides colors for Production.get_color

-

- - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- -

Provides format_number function to add surfixs

-

- - - - - - - - - - - - - - -
-
-

Precision

-
-
-
-
- # - precision_up (precision) -
-
-
-
- -

Gets the next lesser precision index value, eg 1 second -> 1 minute

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_down (precision) -
-
-
-
- -

Gets the next greater precision index value, eg 1 minute -> 1 second

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_ticks (precision) -
-
-
-
- -

Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (number) - the number of ticks in this time -
  • -
- - - - - - - - - -
-
-

Stats

-
-
-
-
- # - get_production_total (force, item_name) -
-
-
-
- -

Returns the production data for the whole game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains total made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production (force, item_name, precision) -
-
-
-
- -

Returns the production data for the given precision game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_fluctuations (force, item_name, precision) -
-
-
-
- -

Returns the current fluctuation from the average

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_consumsion_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be consumed - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to consume this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_net_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce but not consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made but not used - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce, but not use, this ammount of items -
  • -
- - - - - - - - - -
-
-

Formating

-
-
-
-
- # - get_color (clamp, active_value, passive_value) -
-
-
-
- -

Returns a color value bassed on the value that was given

-

- - - Parameters: - -
    - - - - - -
  • - - clamp - - : - - (number) - - value which seperates the different colours - -
  • - - - - - -
  • - - active_value - - : - - (number) - - first value tested, tested against clamp - -
  • - - - - - -
  • - - passive_value - - : - - (number) - - second value tested, tested against 0 - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains r,g,b keys -
  • -
- - - - - - - - - -
-
-
-
- # - format_number (value) -
-
-
-
- -

Returns three parts used to format a number

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (number) - - the value to format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the sign for the number -
  • -
  • - (string) - the surfix for any unit used -
  • -
  • - (string) - the number formated -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/Reports.html b/docs/modules/Reports.html deleted file mode 100644 index 35edb453..00000000 --- a/docs/modules/Reports.html +++ /dev/null @@ -1,1026 +0,0 @@ - - - - - - - - Reports module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Reports module

-

Control Module - Reports - - Adds a way to report players and store report messages.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Reports = require 'modules.control.reports'
-
-    -- This will place a report on "MrBiter" (must be a valid player) the report will have been made
-    -- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
-    -- seen by using Reports.get_report.
-    Reports.report_player('MrBiter','Cooldude2606','Liking biters too much') -- true
-
-    -- The other get methods can be used to get all the reports on a player or to test if a player is reported.
-    Reports.get_report('MrBiter','Cooldude2606') -- 'Liking biters too much'
-
-    -- This will remove the warning on 'MrBiter' (must be a valid player) which was made by 'Cooldude2606'.
-    Reports.remove_report('MrBiter','Cooldude2606') -- true
-
-    -- This will remove all the report that have been made against 'MrBiter'. Note that the remove event will
-    -- be triggered once per report issused.
-    Reports.remove_all('MrBiter') -- true
-
- - - - - - - -

Events

- - - - - - - - - - - - -
on_player_reportedWhen a player is reported
on_report_removedWhen a report is removed from a player
- - -

Dependencies

- - - - - - - - - - - - -
utils.gameAllows getting player from any value
utils.globalAllows storing of data in global table
- - -

Get functions

- - - - - - - - - - - - - - - - - - - - -
get_reports (player)Gets a list of all reports that a player has against them
get_report (player, by_player_name)Gets a single report against a player given the name of the player who made the report
is_reported (player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
count_reports (player[, custom_count])Counts the number of reports that a player has aganist them
- - -

Set functions

- - - - - - - - - - - - - - - - -
report_player (player, by_player_name[, reason='Non given.'])Adds a report to a player, each player can only report another player once
remove_report (player, reported_by_name)Removes a report from a player
remove_all (player)Removes all reports from a player
- - -
- - -

Events

-
-
-
-
- # - on_player_reported -
-
-
-
- -

When a player is reported

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who got reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason given for the report - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_report_removed -
-
-
-
- -

When a report is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who has the report removed - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player who made the removed report - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who removed the report - -
  • - - -
- - - - - - - - - - - - - -
-
-

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- -

Allows getting player from any value

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- -

Allows storing of data in global table

-

- - - - - - - - - - - - - - -
-
-

Get functions

-
-
-
-
- # - get_reports (player) -
-
-
-
- -

Gets a list of all reports that a player has against them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a list of all reports, key is by player name, value is reason -
  • -
- - - - - - - - - -
-
-
-
- # - get_report (player, by_player_name) -
-
-
-
- -

Gets a single report against a player given the name of the player who made the report

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - -
- - - - - Returns: -
    -
  • - (string or nil) - string is the reason that the player was reported, if the player is not reported -
  • -
- - - - - - - - - -
-
-
-
- # - is_reported (player[, by_player_name]) -
-
-
-
- -

Checks if a player is reported, option to get if reported by a certain player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - when given will check if reported by this player - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - if the player has been reported -
  • -
- - - - - - - - - -
-
-
-
- # - count_reports (player[, custom_count]) -
-
-
-
- -

Counts the number of reports that a player has aganist them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the reports for - -
  • - - - - - -
  • - - custom_count - - : - - (function) - - when given this function will be used to count the reports - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of reports that the user has -
  • -
- - - - - - - - - -
-
-

Set functions

-
-
-
-
- # - report_player (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a report to a player, each player can only report another player once

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add the report to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that is making the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being reported - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was added successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_report (player, reported_by_name) -
-
-
-
- -

Removes a report from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the report from - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player that made the report - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was removed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_all (player) -
-
-
-
- -

Removes all reports from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the reports from - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the reports were removed successfully -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/Warnings.html b/docs/modules/Warnings.html deleted file mode 100644 index 69fcc9c9..00000000 --- a/docs/modules/Warnings.html +++ /dev/null @@ -1,1279 +0,0 @@ - - - - - - - - Warnings module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

Warnings module

-

Control Module - Warnings - - Adds a way to give and remove warnings to players.

-

- - - - - - -

Usage

-

-    -- This will add a warning to the player
-    Warnings.add_warning('MrBiter','Cooldude2606','Killed too many biters')
-
-    -- This will remove a warning from a player, second name is just who is doing the action
-    Warnings.remove_warning('MrBiter','Cooldude2606')
-
-    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
-    -- this is so it can be used for greifer protection without being too agressive
-    Warnings.add_script_warning('MrBiter','Killed too many biters')
-
-    -- Both normal and script warnings can also be cleared, this will remove all warnings
-    Warnings.clear_warnings('MrBiter','Cooldude2606')
- - - - - - - -

Events

- - - - - - - - - - - - - - - - - - - - -
on_warning_addedWhen a warning is added to a player
on_warning_removedWhen a warning is removed from a player
on_script_warning_addedWhen a warning is added to a player, by the script
on_script_warning_removedWhen a warning is remnoved from a player, by the script
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_warnings (player)Gets an array of warnings that the player has, always returns a list even if emtpy
count_warnings (player)Gets the number of warnings that a player has on them
add_warning (player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
remove_warning (player, by_player_name)Removes a warning from a player, always removes the earlyist warning, fifo
clear_warnings (player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
get_script_warnings (player)Gets an array of all the script warnings that a player has
count_script_warnings (player)Gets the number of script warnings that a player has on them
add_script_warning (player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
remove_script_warning (player)Removes a script warning from a player
clear_script_warnings (player)Removes all script warnings from a player, emits event for each warning removed
- - -
- - -

Events

-
-
-
-
- # - on_warning_added -
-
-
-
- -

When a warning is added to a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_warning_removed -
-
-
-
- -

When a warning is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_by_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who is removing the warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_added -
-
-
-
- -

When a warning is added to a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_removed -
-
-
-
- -

When a warning is remnoved from a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - get_warnings (player) -
-
-
-
- -

Gets an array of warnings that the player has, always returns a list even if emtpy

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the warning for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of all the warnings on this player, contains tick, by_player_name and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_warnings (player) -
-
-
-
- -

Gets the number of warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the warnings for - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_warning (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a warning to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_warning (player, by_player_name) -
-
-
-
- -

Removes a warning from a player, always removes the earlyist warning, fifo

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a warning from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_warnings (player, by_player_name) -
-
-
-
- -

Removes all warnings from a player, will trigger remove event for each warning

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the warnings from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true when warnings were cleared succesfully -
  • -
- - - - - - - - - -
-
-
-
- # - get_script_warnings (player) -
-
-
-
- -

Gets an array of all the script warnings that a player has

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of all the script warnings a player has, contains tick and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_script_warnings (player) -
-
-
-
- -

Gets the number of script warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_script_warning (player[, reason='Non given.']) -
-
-
-
- -

Adds a script warning to a player, this may add a full warning if max script warnings is met

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a script warning to - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_script_warning (player) -
-
-
-
- -

Removes a script warning from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a script warning from - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_script_warnings (player) -
-
-
-
- -

Removes all script warnings from a player, emits event for each warning removed

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the script warnings from - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/addons.advanced-start.html b/docs/modules/addons.advanced-start.html deleted file mode 100644 index 71ef2c75..00000000 --- a/docs/modules/addons.advanced-start.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module addons.advanced-start

-

Adds a better method of player starting items based on production levels.

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/addons.chat-popups.html b/docs/modules/addons.chat-popups.html deleted file mode 100644 index df8efb1e..00000000 --- a/docs/modules/addons.chat-popups.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module addons.chat-popups

-

Creates flying text entities when a player sends a message in chat - also displays a ping above users who are named in the message

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/addons.damage-popups.html b/docs/modules/addons.damage-popups.html deleted file mode 100644 index 89bc2255..00000000 --- a/docs/modules/addons.damage-popups.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module addons.damage-popups

-

Displays the amount of dmg that is done by players to entities - also shows player health when a player is attacked

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/config._file_loader.html b/docs/modules/config._file_loader.html deleted file mode 100644 index 6feb3502..00000000 --- a/docs/modules/config._file_loader.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - config._file_loader module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config._file_loader module

-

This contains a list of all files that will be loaded and the order they are loaded in - to stop a file from loading add "--" in front of it, remove the "--" to have the file be loaded - config files should be loaded after all modules are loaded - core files should be required by modules and not be present in this list

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.action_buttons.html b/docs/modules/config.action_buttons.html deleted file mode 100644 index 0dd6dbf0..00000000 --- a/docs/modules/config.action_buttons.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - - - config.action_buttons module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.action_buttons module

-

Config for the different action buttons that show on the player list - each button has the button define(s) given along side an auth function, and optional reason callback - if a reason callback is used then Store.set(action_name_store,player.name,'BUTTON_NAME') should be called during on_click - buttons can be removed from the gui by commenting them out of the config at the bottom of this file - the key used for the name of the button is the permission name used by the role system

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
expcore.store
utils.game
modules.control.reports
modules.control.warnings
modules.control.jail
resources.color_presets
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.reports -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.warnings -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.jail -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.advanced_start.html b/docs/modules/config.advanced_start.html deleted file mode 100644 index 5c01fd7d..00000000 --- a/docs/modules/config.advanced_start.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - config.advanced_start module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.advanced_start module

-

This file is used to setup the map starting settings and the items players will start with

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.bonuses.html b/docs/modules/config.bonuses.html deleted file mode 100644 index 15f7f5a8..00000000 --- a/docs/modules/config.bonuses.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - config.bonuses module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.bonuses module

-

Lists all bonuses which can be used, name followed by min max

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.chat_reply.html b/docs/modules/config.chat_reply.html deleted file mode 100644 index 0f1367a1..00000000 --- a/docs/modules/config.chat_reply.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - config.chat_reply module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.chat_reply module

-

This file defines the different triggers for the chat bot

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.death_logger.html b/docs/modules/config.death_logger.html deleted file mode 100644 index d800df68..00000000 --- a/docs/modules/config.death_logger.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - config.death_logger module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.death_logger module

-

This config controls what happens when a player dies mostly about map markers and item collection - allow_teleport_to_body_command and allow_collect_bodies_command can be over ridden if command_auth_runtime_disable is present - if not present then the commands will not be loaded into the game

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.discord_alerts.html b/docs/modules/config.discord_alerts.html deleted file mode 100644 index d90c30e2..00000000 --- a/docs/modules/config.discord_alerts.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - config.discord_alerts module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.discord_alerts module

-

Config file used to enable and disable different push messages for discord

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.expcore-commands.auth_admin.html b/docs/modules/config.expcore-commands.auth_admin.html deleted file mode 100644 index 7948bb6c..00000000 --- a/docs/modules/config.expcore-commands.auth_admin.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - config.expcore-commands.auth_admin module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.expcore-commands.auth_admin module

-

This is a very simple config file which adds a admin only auth function - not much to change here its more so it can be enabled and disabled from ./config/file_loader.lua - either way you can change the requirements to be "admin" if you wanted to

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.commands
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.expcore-commands.auth_roles.html b/docs/modules/config.expcore-commands.auth_roles.html deleted file mode 100644 index d7b9bc5f..00000000 --- a/docs/modules/config.expcore-commands.auth_roles.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - config.expcore-commands.auth_roles module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.expcore-commands.auth_roles module

-

This will make commands only work if the role has been allowed it in the role config

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
expcore.roles
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.expcore-commands.auth_runtime_disable.html b/docs/modules/config.expcore-commands.auth_runtime_disable.html deleted file mode 100644 index 93ea32d7..00000000 --- a/docs/modules/config.expcore-commands.auth_runtime_disable.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - config.expcore-commands.auth_runtime_disable module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.expcore-commands.auth_runtime_disable module

-

This config for command auth allows commands to be globally enabled and disabled during runtime - this config adds Commands.disable and Commands.enable to enable and disable commands for all users

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.global
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.expcore-commands.parse_general.html b/docs/modules/config.expcore-commands.parse_general.html deleted file mode 100644 index 7fe058b7..00000000 --- a/docs/modules/config.expcore-commands.parse_general.html +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - config.expcore-commands.parse_general module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.expcore-commands.parse_general module

-

This file contains some common command param parse functions - this file is less of a config and more of a requirement but you may wish to change how some behave - as such you need to be confident with lua but you edit this config file - use Commands.add_parse('name',function(input,player,reject) end) to add a parse - see ./expcore/commands.lua for more details

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
expcore.commands
utils.game
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.expcore-commands.parse_roles.html b/docs/modules/config.expcore-commands.parse_roles.html deleted file mode 100644 index 2c0885f6..00000000 --- a/docs/modules/config.expcore-commands.parse_roles.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - config.expcore-commands.parse_roles module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.expcore-commands.parse_roles module

-

Adds some parse functions that can be used with the role system

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.commands
expcore.roles
expcore.common
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.commands -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.permission_groups.html b/docs/modules/config.permission_groups.html deleted file mode 100644 index fc44964f..00000000 --- a/docs/modules/config.permission_groups.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - - - config.permission_groups module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.permission_groups module

-

Use this file to add new permission groups to the game - start with Permission_Groups.new_group('name') - then use either :allow_all() or :disallow_all() to set the default for non specified actions - then use :allow{} and :disallow{} to specify certain actions to allow/disallow

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
utils.game
expcore.permission_groups
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.permission_groups -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.popup_messages.html b/docs/modules/config.popup_messages.html deleted file mode 100644 index 1fe88709..00000000 --- a/docs/modules/config.popup_messages.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - config.popup_messages module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.popup_messages module

-

A combination of config settings for different popup values like chat and damage

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.rockets.html b/docs/modules/config.rockets.html deleted file mode 100644 index 908b558a..00000000 --- a/docs/modules/config.rockets.html +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - config.rockets module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.rockets module

-

This file controls what will show in each section of the rocket info gui

-

- - - - - - - - - - - - - -

Fields

- - - - - - - - - - - - -
show_statsThe data that will show in the stats section
show_progressThe data and buttons in the build progress section
- - -
- - -

Fields

-
-
-
-
- # - show_stats -
-
-
-
- -

The data that will show in the stats section

-

- - - - - - - - - - - - - - -
-
-
-
- # - show_progress -
-
-
-
- -

The data and buttons in the build progress section

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.roles.html b/docs/modules/config.roles.html deleted file mode 100644 index ce60d7ec..00000000 --- a/docs/modules/config.roles.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - config.roles module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.roles module

-

This is the main config file for the role system; file includes defines for roles and role flags and default values

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
expcore.roles
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/config.scorched_earth.html b/docs/modules/config.scorched_earth.html deleted file mode 100644 index 0b10a247..00000000 --- a/docs/modules/config.scorched_earth.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - config.scorched_earth module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.scorched_earth module

-

This file controls the placement/degrading of tiles as players build and walk

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.spawn_area.html b/docs/modules/config.spawn_area.html deleted file mode 100644 index 01013de6..00000000 --- a/docs/modules/config.spawn_area.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - config.spawn_area module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.spawn_area module

-

Used to config the spawn generation settings yes there is alot here i know just ignore the long tables at the end (they were generated with a command)

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.warnings.html b/docs/modules/config.warnings.html deleted file mode 100644 index 4fc67842..00000000 --- a/docs/modules/config.warnings.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - config.warnings module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.warnings module

-

Config file for the warning system, this is very similar to reports but is for the use of moderators rather than normal users.

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/config.warps.html b/docs/modules/config.warps.html deleted file mode 100644 index e0a4c5e2..00000000 --- a/docs/modules/config.warps.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - config.warps module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

config.warps module

-

This file contains all the different settings for the warp system and gui

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/control.html b/docs/modules/control.html deleted file mode 100644 index 6222f5dd..00000000 --- a/docs/modules/control.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - control module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

control module

-

Please go to ./config if you want to change settings, each file is commented with what it does - if it is not in ./config then you should not attempt to change it unless you know what you are doing - all files which are loaded (including the config files) are present in ./config/file_loader.lua - this file is the landing point for all scenarios please DO NOT edit directly, further comments are to aid development

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/control.reports.html b/docs/modules/control.reports.html deleted file mode 100644 index eee1ba64..00000000 --- a/docs/modules/control.reports.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module control.reports

-

Gets a list of all reports that a player has against them

-

- - -

Get functions

- - - - - - - - - - - - - - - - - -
Reports.get_reports (player)Gets a list of all reports that a player has against them
Reports.get_report (player[, by_player_name='server'])Gets a single report against a player given the name of the player who made the report
Reports.is_reported (player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
Reports.count (player[, custom_count])Counts the number of reports that a player has aganist them
-

Set functions

- - - - - - - - - - - - - -
Reports.report_player (player[, by_player_name='server'[, reason='Non Given.']])Adds a report to a player, each player can only report another player once
Reports.remove_report (player[, by_player_name='server'])Removes a report from a player
Reports.remove_all (player)Removes all reports from a player
- -
-
- - -

Get functions

- - - Functions used to get information from reports -
-
- - Reports.get_reports (player) -
-
- Gets a list of all reports that a player has against them - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the report for -
  • -
- -

Returns:

-
    - - table - a list of all reports, key is by player name, value is reason -
- - - - -
-
- - Reports.get_report (player[, by_player_name='server']) -
-
- Gets a single report against a player given the name of the player who made the report - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the report for -
  • -
  • by_player_name - string - the name of the player who made the report - (default 'server') -
  • -
- -

Returns:

-
    - - string or nil - string is the reason that the player was reported, if the player is not reported -
- - - - -
-
- - Reports.is_reported (player[, by_player_name]) -
-
- Checks if a player is reported, option to get if reported by a certain player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to check if reported -
  • -
  • by_player_name - string - when given will check if reported by this player - (optional) -
  • -
- -

Returns:

-
    - - boolean - if the player has been reported -
- - - - -
-
- - Reports.count (player[, custom_count]) -
-
- Counts the number of reports that a player has aganist them - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to count the reports for -
  • -
  • custom_count - function - when given this function will be used to count the reports - (optional) -
  • -
- -

Returns:

-
    - - number - the number of reports that the user has -
- - - - -
-
-

Set functions

- - - Functions used to get information from reports -
-
- - Reports.report_player (player[, by_player_name='server'[, reason='Non Given.']]) -
-
- Adds a report to a player, each player can only report another player once - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to add the report to -
  • -
  • by_player_name - string - the name of the player that is making the report - (default 'server') -
  • -
  • reason - string - the reason that the player is being reported - (default 'Non Given.') -
  • -
- -

Returns:

-
    - - boolean - whether the report was added successfully -
- - - - -
-
- - Reports.remove_report (player[, by_player_name='server']) -
-
- Removes a report from a player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to remove the report from -
  • -
  • by_player_name - string - the name of the player that made the report - (default 'server') -
  • -
- -

Returns:

-
    - - boolean - whether the report was removed successfully -
- - - - -
-
- - Reports.remove_all (player) -
-
- Removes all reports from a player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to remove the reports from -
  • -
- -

Returns:

-
    - - boolean - whether the reports were removed successfully -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 18:40:35 -
-
- - diff --git a/docs/modules/expcore.commands.html b/docs/modules/expcore.commands.html deleted file mode 100644 index 1ff1dfca..00000000 --- a/docs/modules/expcore.commands.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - expcore.commands module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.commands module

-

Factorio command making module that makes commands with better parse and more modularity

-

-[[

- - - -
    -
  • Author: Cooldude2606
  • -
- - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/expcore.common.html b/docs/modules/expcore.common.html deleted file mode 100644 index 3b4cbc89..00000000 --- a/docs/modules/expcore.common.html +++ /dev/null @@ -1,2444 +0,0 @@ - - - - - - - - expcore.common module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.common module

-

Adds some commonly used functions used in many modules

-

-[[

- - - -
    -
  • Author: cooldude2606
  • -
- - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
resources.color_presets
utils.game
util
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Common.type_check(value[, test_type=nil])Compare types faster for faster validation of params
Common.type_check_error(value, test_type, error_message, level)Raises an error if the value is of the wrong type
Common.param_check(value, test_type, param_name, param_number)Raises an error when the value is the incorrect type, uses a consistent error message format
Common.player_return(value[, colour=defines.colour.white][, player=game.player])Will return a value of any type to the player/server console, allows colour for in-game players
Common.write_json(path, tbl)Writes a table object to a file in json format
Common.opt_require(path)Calls a require that will not error if the file is not found
Common.ext_require(path, ...)Calls a require and returns only the keys given, file must return a table
Common.format_time(ticks, options)Formats tick into a clean format, denominations from highest to lowest - long will use words rather than letters - time will use : separates - string will return a string not a locale string - when a denomination is false it will overflow into the next one
Common.move_items(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest])Moves items to the position and stores them in the closest entity of the type given
Common.print_grid_value(value, surface, position, scale, offset, immutable)https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31 - Prints a colored value on a location.
Common.print_colored_grid_value(value, surface, position, offset, immutable, color_value, base_color, delta_color, under_bound, over_bound)Prints a colored value on a location.
Common.clear_flying_text(surface)Clears all flying text entities on a surface
Common.string_contains(s, contains)Tests if a string contains a given substring.
Common.extract_keys(tbl, ...)Extracts certain keys from a table
Common.enum(tbl)Converts a table to an enum
Common.auto_complete(options, input[, use_key=false][, rtn_key=false])Returns the closest match to the input
Common.table_values(table[, sorted][, as_string])Returns a copy of all of the values in the table.
Common.table_keys(table[, sorted][, as_string])Returns a copy of all of the keys in the table.
Common.table_alphanumsort(tbl)Returns the list is a sorted way that would be expected by people (this is by key)
Common.table_keysort(tbl)Returns the list is a sorted way that would be expected by people (this is by key) (faster alternative than above)
Common.format_chat_colour(message, color)Returns a message with valid chat tags to change its colour
Common.format_chat_colour_localized(message, color)Returns a message with valid chat tags to change its colour, using localization
Common.format_chat_player_name(player[, raw_string=false])Returns the players name in the players color
- - -
- - -

Dependencies

-
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Common.type_check(value[, test_type=nil]) -
-
-
-
- -

Compare types faster for faster validation of params

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value to be tested - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type to test for if not given then it tests for nil - - (default: nil) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - is v of type test_type -
  • -
- - - - - - - - Usage: -
type_check('foo','string') -- return true
-
type_check('foo') -- return false
- - -
-
-
-
- # - Common.type_check_error(value, test_type, error_message, level) -
-
-
-
- -

Raises an error if the value is of the wrong type

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - error_message - - : - - (string) - - the error message that is returned - -
  • - - - - - -
  • - - level - - : - - (number) - - the level to call the error on (level = 1 means the caller) - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was called -
  • -
- - - - - - - - Usage: -
type_check_error('foo','number','Value must be a number') -- will raise error "Value must be a number"
- - -
-
-
-
- # - Common.param_check(value, test_type, param_name, param_number) -
-
-
-
- -

Raises an error when the value is the incorrect type, uses a consistent error message format

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (any) - - the value that you want to test the type of - -
  • - - - - - -
  • - - test_type - - : - - (string) - - the type that the value should be - -
  • - - - - - -
  • - - param_name - - : - - (string) - - the name of the param - -
  • - - - - - -
  • - - param_number - - : - - (number) - - the number param it is - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if no error was raised -
  • -
- - - - - - - - Usage: -
param_check('foo','number','repeat_count',2) -- will raise error "Invalid param #02 given to <anon>; repeat_count is not of type number"
- - -
-
-
-
- # - Common.player_return(value[, colour=defines.colour.white][, player=game.player]) -
-
-
-
- -

Will return a value of any type to the player/server console, allows colour for in-game players

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - any value of any type that will be returned to the player or console - -
  • - - - - - -
  • - - colour - - : - - (defines.color or string) - - the colour of the text for the player, ignored when printing to console - - (default: defines.colour.white) -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that return will go to, if no game.player then returns to server - - (default: game.player) -
  • - - -
- - - - - - - - - - - - Usage: -
player_return('Hello, World!') -- returns 'Hello, World!' to game.player or server console
-
player_return('Hello, World!','green') -- returns 'Hello, World!' to game.player with colour green or server console
-
player_return('Hello, World!',nil,player) -- returns 'Hello, World!' to the given player
- - -
-
-
-
- # - Common.write_json(path, tbl) -
-
-
-
- -

Writes a table object to a file in json format

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path of the file to write include / to use dir - -
  • - - - - - -
  • - - tbl - - : - - (table) - - the table that will be converted to a json string and wrote to file - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Common.opt_require(path) -
-
-
-
- -

Calls a require that will not error if the file is not found

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path that you want to require - -
  • - - -
- - - - - Returns: -
    -
  • - the returns from that file or nil, error if not loaded -
  • -
- - - - - - - - Usage: -
local file = opt_require('file.not.present') -- will not cause any error
- - -
-
-
-
- # - Common.ext_require(path, ...) -
-
-
-
- -

Calls a require and returns only the keys given, file must return a table

-

- - - Parameters: - -
    - - - - - -
  • - - path - - : - - (string) - - the path that you want to require - -
  • - - - - - -
  • - - ... - - : - - (string) - - the name of the keys that you want returned - -
  • - - -
- - - - - Returns: -
    -
  • - the keys in the order given -
  • -
- - - - - - - - Usage: -
local extract, param_check = ext_require('expcore.common','extract','param_check') --- @dep expcore.common
- - -
-
-
-
- # - Common.format_time(ticks, options) -
-
-
-
- -

Formats tick into a clean format, denominations from highest to lowest - long will use words rather than letters - time will use : separates - string will return a string not a locale string - when a denomination is false it will overflow into the next one

-

- - - Parameters: - -
    - - - - - -
  • - - ticks - - : - - (number) - - the number of ticks that represents a time - -
  • - - - - - -
  • - - options - - : - - (table) - - table a of options to use for the format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - a locale string that can be used -
  • -
- - - - - - - - - -
-
-
-
- # - Common.move_items(items[, surface=navies][, position={0][, radius=32][, chest_type=iron-chest]) -
-
-
-
- -

Moves items to the position and stores them in the closest entity of the type given

-

- - - Parameters: - -
    - - - - - -
  • - - items - - : - - (table) - - items which are to be added to the chests, ['name']=count - -
  • - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface that the items will be moved to - - (default: navies) -
  • - - - - - -
  • - - position - - : - - (table) - - the position that the items will be moved to {x=100,y=100} - - (default: {0) -
  • - - - - - -
  • - - radius - - : - - (number) - - the radius in which the items are allowed to be placed - - (default: 32) -
  • - - - - - -
  • - - chest_type - - : - - (string) - - the chest type that the items should be moved into - - (default: iron-chest) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Common.print_grid_value(value, surface, position, scale, offset, immutable) -
-
-
-
- -

https://github.com/Refactorio/RedMew/blob/9184b2940f311d8c9c891e83429fc57ec7e0c4a2/map_gen/maps/diggy/debug.lua#L31 - Prints a colored value on a location.

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - between -1 and 1 - -
  • - - - - - -
  • - - surface - - : - - - LuaSurface - -
  • - - - - - -
  • - - position - - : - - - Position {x, y} - -
  • - - - - - -
  • - - scale - - : - - - float - -
  • - - - - - -
  • - - offset - - : - - - float - -
  • - - - - - -
  • - - immutable - - : - - - bool if immutable, only set, never do a surface lookup, values never change - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Common.print_colored_grid_value(value, surface, position, offset, immutable, color_value, base_color, delta_color, under_bound, over_bound) -
-
-
-
- -

Prints a colored value on a location.

-

When given a color_value and a delta_color, - will change the color of the text from the base to base + value * delta. This will - make the color of the text range from 'base_color' to 'base_color + delta_color' - as the color_value ranges from 0 to 1

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - - of number to be displayed - -
  • - - - - - -
  • - - surface - - : - - - LuaSurface - -
  • - - - - - -
  • - - position - - : - - - Position {x, y} - -
  • - - - - - -
  • - - offset - - : - - - float position offset - -
  • - - - - - -
  • - - immutable - - : - - - bool if immutable, only set, never do a surface lookup, values never change - -
  • - - - - - -
  • - - color_value - - : - - - float How far along the range of values of colors the value is to be displayed - -
  • - - - - - -
  • - - base_color - - : - - - {r,g,b} The color for the text to be if color_value is 0 - -
  • - - - - - -
  • - - delta_color - - : - - - {r,g,b} The amount to correct the base_color if color_value is 1 - -
  • - - - - - -
  • - - under_bound - - : - - - {r,g,b} The color to be used if color_value < 0 - -
  • - - - - - -
  • - - over_bound - - : - - - {r,g,b} The color to be used if color_value > 1 - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Common.clear_flying_text(surface) -
-
-
-
- -

Clears all flying text entities on a surface

-

- - - Parameters: - -
    - - - - - -
  • - - surface - - : - - (LuaSurface) - - the surface to clear - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Common.string_contains(s, contains) -
-
-
-
- -

Tests if a string contains a given substring.

-

- - - Parameters: - -
    - - - - - -
  • - - s - - : - - (string) - - the string to check for the substring - -
  • - - - - - -
  • - - contains - - : - - (string) - - the substring to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the substring was found in the string -
  • -
- - - - - - - - - -
-
-
-
- # - Common.extract_keys(tbl, ...) -
-
-
-
- -

Extracts certain keys from a table

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - table the which contains the keys - -
  • - - - - - -
  • - - ... - - : - - (string) - - the names of the keys you want extracted - -
  • - - -
- - - - - Returns: -
    -
  • - the keys in the order given -
  • -
- - - - - - - - Usage: -
local key_three, key_one = extract({key_one='foo',key_two='bar',key_three=true},'key_three','key_one')
- - -
-
-
-
- # - Common.enum(tbl) -
-
-
-
- -

Converts a table to an enum

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - table the that will be converted - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new table that acts like an enum -
  • -
- - - - - - - - - -
-
-
-
- # - Common.auto_complete(options, input[, use_key=false][, rtn_key=false]) -
-
-
-
- -

Returns the closest match to the input

-

- - - Parameters: - -
    - - - - - -
  • - - options - - : - - (table) - - table a of options for the auto complete - -
  • - - - - - -
  • - - input - - : - - (string) - - string the input that will be completed - -
  • - - - - - -
  • - - use_key - - : - - (boolean) - - when true the keys of options will be used as the options - - (default: false) -
  • - - - - - -
  • - - rtn_key - - : - - (boolean) - - when true the the key will be returned rather than the value - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - the list item found that matches the input -
  • -
- - - - - - - - - -
-
-
-
- # - Common.table_values(table[, sorted][, as_string]) -
-
-
-
- -

Returns a copy of all of the values in the table.

-

- - - Parameters: - -
    - - - - - -
  • - - table - - : - - (table) - - tbl the to copy the keys from, or an empty table if tbl is nil - -
  • - - - - - -
  • - - sorted - - : - - (boolean) - - whether to sort the keys (slower) or keep the random order from pairs() - - (optional) -
  • - - - - - -
  • - - as_string - - : - - (boolean) - - whether to try and parse the values as strings, or leave them as their existing type - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (array) - an array with a copy of all the values in the table -
  • -
- - - - - - - - - -
-
-
-
- # - Common.table_keys(table[, sorted][, as_string]) -
-
-
-
- -

Returns a copy of all of the keys in the table.

-

- - - Parameters: - -
    - - - - - -
  • - - table - - : - - (table) - - tbl the to copy the keys from, or an empty table if tbl is nil - -
  • - - - - - -
  • - - sorted - - : - - (boolean) - - whether to sort the keys (slower) or keep the random order from pairs() - - (optional) -
  • - - - - - -
  • - - as_string - - : - - (boolean) - - whether to try and parse the keys as strings, or leave them as their existing type - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (array) - an array with a copy of all the keys in the table -
  • -
- - - - - - - - - -
-
-
-
- # - Common.table_alphanumsort(tbl) -
-
-
-
- -

Returns the list is a sorted way that would be expected by people (this is by key)

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - the table to be sorted - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the sorted table -
  • -
- - - - - - - - - -
-
-
-
- # - Common.table_keysort(tbl) -
-
-
-
- -

Returns the list is a sorted way that would be expected by people (this is by key) (faster alternative than above)

-

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - (table) - - the table to be sorted - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the sorted table -
  • -
- - - - - - - - - -
-
-
-
- # - Common.format_chat_colour(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r,g,b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the message with the color tags included -
  • -
- - - - - - - - - -
-
-
-
- # - Common.format_chat_colour_localized(message, color) -
-
-
-
- -

Returns a message with valid chat tags to change its colour, using localization

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string or table) - - the message that will be in the output - -
  • - - - - - -
  • - - color - - : - - (table) - - a color which contains r,g,b as its keys - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the message with the color tags included -
  • -
- - - - - - - - - -
-
-
-
- # - Common.format_chat_player_name(player[, raw_string=false]) -
-
-
-
- -

Returns the players name in the players color

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to use the name and color of - -
  • - - - - - -
  • - - raw_string - - : - - (boolean) - - when true a is returned rather than a localized string - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the players name with tags for the players color -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.buttons.html b/docs/modules/expcore.gui.buttons.html deleted file mode 100644 index db445924..00000000 --- a/docs/modules/expcore.gui.buttons.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.buttons

-

Gui class define for buttons and sprite buttons -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - -
Button.new_button ([name])Creates a new button element define
Button._prototype:set_sprites (sprite[, hovered_sprite[, clicked_sprite]])Adds sprites to a button making it a spirte 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
- -
-
- - -

Functions

- -
-
- - Button.new_button ([name]) -
-
- Creates a new button element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new button element define -
- - - - -
-
- - Button._prototype:set_sprites (sprite[, hovered_sprite[, clicked_sprite]]) -
-
- Adds sprites to a button making it a spirte button - - -

Parameters:

-
    -
  • sprite - SpritePath - the sprite path for the default sprite for the button -
  • -
  • hovered_sprite - SpritePath - the sprite path for the sprite when the player hovers over the button - (optional) -
  • -
  • clicked_sprite - SpritePath - the sprite path for the sprite when the player clicks the button - (optional) -
  • -
- -

Returns:

-
    - - self - returns the button define to allow chaining -
- - - - -
-
- - Button._prototype:set_click_filter (filter[, ...]) -
-
- Adds a click / mouse button filter to the button - - -

Parameters:

-
    -
  • filter - table - ?string|table either a of mouse buttons or the first mouse button to filter, with a table true means allowed -
  • -
  • ... - table - when filter is not a you can add the mouse buttons one after each other - (optional) -
  • -
- -

Returns:

-
    - - self - returns the button define to allow chaining -
- - - - -
-
- - Button._prototype:set_key_filter (filter[, ...]) -
-
- Adds a control key filter to the button - - -

Parameters:

-
    -
  • filter - table - ?string|table either a of control keys or the first control keys to filter, with a table true means allowed -
  • -
  • ... - table - when filter is not a you can add the control keyss one after each other - (optional) -
  • -
- -

Returns:

-
    - - self - returns the button define to allow chaining -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.center.html b/docs/modules/expcore.gui.center.html deleted file mode 100644 index 4aa127e1..00000000 --- a/docs/modules/expcore.gui.center.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.center

-

Gui structure define for center gui frames -[[

-

- - -

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 (permision_name)Creates a new center frame define
CenterFrames._prototype:set_auto_focus ([state=true])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=update])Creates an event handler that will trigger one of its functions, use with Event.add
- -
-
- - -

Functions

- -
-
- - CenterFrames.get_flow (player) -
-
- Gets the center flow for a player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the flow for -
  • -
- -

Returns:

-
    - - LuaGuiElement - the center flow -
- - - - -
-
- - CenterFrames.clear_flow (player) -
-
- Clears the center flow for a player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to clear the flow for -
  • -
- - - - - -
-
- - CenterFrames.draw_frame (player, name) -
-
- Draws the center frame for a player, if already open then will do nothing - - -

Parameters:

-
    -
  • player - LuaPlayer - the player that will have the frame drawn -
  • -
  • name - string - the name of the hui that will drawn -
  • -
- -

Returns:

-
    - - LuaGuiElement - the new frame that was made -
- - - - -
-
- - CenterFrames.redraw_frame (player, name) -
-
- Draws the center frame for a player, if already open then will destroy it and redraw - - -

Parameters:

-
    -
  • player - LuaPlayer - the player that will have the frame drawn -
  • -
  • name - string - the name of the hui that will drawn -
  • -
- -

Returns:

-
    - - LuaGuiElement - the new frame that was made -
- - - - -
-
- - CenterFrames.toggle_frame (player, name[, state]) -
-
- Toggles if the frame is currently open or not, will open if closed and close if open - - -

Parameters:

-
    -
  • player - LuaPlayer - the player that will have the frame toggled -
  • -
  • name - string - the name of the hui that will be toggled -
  • -
  • state - boolean - when set will force a state for the frame - (optional) -
  • -
- -

Returns:

-
    - - boolean - if the frame if no open or closed -
- - - - -
-
- - CenterFrames.new_frame (permision_name) -
-
- Creates a new center frame define - - -

Parameters:

-
    -
  • permision_name - string - the name that can be used with the permision system -
  • -
- -

Returns:

-
    - - table - the new center frame define -
- - - - -
-
- - CenterFrames._prototype:set_auto_focus ([state=true]) -
-
- Sets the frame to be the current active gui when opened and closes all other frames - - -

Parameters:

-
    -
  • state - boolean - when true will auto close other frames and set this frame as player.opened - (default true) -
  • -
- - - - - -
-
- - 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) - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to draw the frame for -
  • -
- -

Returns:

-
    - - LuaGuiElement - the new frame that was drawn -
- - - - -
-
- - 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) - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to draw the frame for -
  • -
- -

Returns:

-
    - - LuaGuiElement - the new frame that was drawn -
- - - - -
-
- - CenterFrames._prototype:toggle_frame (player) -
-
- Toggles if the frame is open, if open it will close it and if closed it will open it - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to draw the frame for -
  • -
- -

Returns:

-
    - - boolean - with the gui frame is now open -
- - - - -
-
- - CenterFrames._prototype:event_handler ([action=update]) -
-
- Creates an event handler that will trigger one of its functions, use with Event.add - - -

Parameters:

-
    -
  • action - string - the action to take on this event - (default update) -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.checkboxs.html b/docs/modules/expcore.gui.checkboxs.html deleted file mode 100644 index 12c17dd4..00000000 --- a/docs/modules/expcore.gui.checkboxs.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.checkboxs

-

Gui class define for checkboxs and radiobuttons -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Checkbox.new_checkbox ([name])Creates a new checkbox element define
Checkbox.new_radiobutton ([name])Creates a new radiobutton element define, has all functions checkbox has
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)
Checkbox._prototype_radiobutton:get_store (category, internal)Gets the stored value of the radiobutton or the option set if present
Checkbox._prototype_radiobutton:set_store (category, value, internal)Sets the stored value of the radiobutton or the option set if present
Checkbox.new_option_set (name, callback, categorize)Registers a new option set that can be linked to radiobutotns (only one can be true at a time)
Checkbox.draw_option_set (name, element)Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
Checkbox.reset_radiobuttons (element[, exclude[, recursive=false]])Sets all radiobutotn in a element to false (unless excluded) and can act recursivly
- -
-
- - -

Functions

- -
-
- - Checkbox.new_checkbox ([name]) -
-
- Creates a new checkbox element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new checkbox element define -
- - - - -
-
- - Checkbox.new_radiobutton ([name]) -
-
- Creates a new radiobutton element define, has all functions checkbox has - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new button element define -
- - - - -
-
- - 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) - - -

Parameters:

-
    -
  • option_set - string - the name of the option set to add this element to -
  • -
  • option_name - string - the name of this option that will be used to idenitife it -
  • -
- -

Returns:

-
    - - self - the define to allow chaining -
- - - - -
-
- - Checkbox._prototype_radiobutton:get_store (category, internal) -
-
- Gets the stored value of the radiobutton or the option set if present - - -

Parameters:

-
    -
  • category - string - [opt] the category to get such as player name or force name -
  • -
  • internal - boolean - used to prevent stackover flow -
  • -
- -

Returns:

-
    - - any - the value that is stored for this define -
- - - - -
-
- - Checkbox._prototype_radiobutton:set_store (category, value, internal) -
-
- Sets the stored value of the radiobutton or the option set if present - - -

Parameters:

-
    -
  • category - string - [opt] the category to get such as player name or force name -
  • -
  • value - boolean - the value to set for this define, must be valid for its type ie for checkbox etc -
  • -
  • internal - boolean - used to prevent stackover flow -
  • -
- -

Returns:

-
    - - boolean - true if the value was set -
- - - - -
-
- - Checkbox.new_option_set (name, callback, categorize) -
-
- Registers a new option set that can be linked to radiobutotns (only one can be true at a time) - - -

Parameters:

-
    -
  • name - string - the name of the option set, must be unique -
  • -
  • callback - function - the update callback when the value of the option set chagnes - callback param - value string - the new selected option for this option set - callback param - category string - the category that updated if categorize was used -
  • -
  • categorize - function - the function used to convert an element into a string -
  • -
- -

Returns:

-
    - - string - the name of this option set to be passed to add_as_option -
- - - - -
-
- - Checkbox.draw_option_set (name, element) -
-
- Draws all radiobuttons that are part of an option set at once (Gui.draw will not work) - - -

Parameters:

-
    -
  • name - string - the name of the option set to draw the radiobuttons of -
  • -
  • element - LuaGuiElement - the parent element that the radiobuttons will be drawn to -
  • -
- - - - - -
-
- - Checkbox.reset_radiobuttons (element[, exclude[, recursive=false]]) -
-
- Sets all radiobutotn in a element to false (unless excluded) and can act recursivly - - -

Parameters:

-
    -
  • element - LuaGuiElement - the root gui element to start setting radio buttons from -
  • -
  • exclude - table - ?string|table the name of the radiobutton to exclude or a of radiobuttons where true will set the state true - (optional) -
  • -
  • recursive - number or boolean - if true will recur as much as possible, if a will recur that number of times - (default false) -
  • -
- -

Returns:

-
    - - boolean - true if successful -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.concepts.center.html b/docs/modules/expcore.gui.concepts.center.html deleted file mode 100644 index c2353ac0..00000000 --- a/docs/modules/expcore.gui.concepts.center.html +++ /dev/null @@ -1,1126 +0,0 @@ - - - - - - - - expcore.gui.concepts.center module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.concepts.center module

-

Gui structure define for center gui frames -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
expcore.gui.concepts.toolbar
utils.game
- - -

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)Creates a new center frame define
CenterFrames._prototype:set_auto_focus([state=true])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=update])Creates an event handler that will trigger one of its functions, use with Event.add
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.toolbar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - CenterFrames.get_flow(player) -
-
-
-
- -

Gets the center flow for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the flow for - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - CenterFrames.clear_flow(player) -
-
-
-
- -

Clears the center flow for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the flow for - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - CenterFrames.draw_frame(player, name) -
-
-
-
- -

Draws the center frame for a player, if already open then will do nothing

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will have the frame drawn - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the hui that will drawn - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - CenterFrames.redraw_frame(player, name) -
-
-
-
- -

Draws the center frame for a player, if already open then will destroy it and redraw

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will have the frame drawn - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the hui that will drawn - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - CenterFrames.toggle_frame(player, name[, state]) -
-
-
-
- -

Toggles if the frame is currently open or not, will open if closed and close if open

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will have the frame toggled - -
  • - - - - - -
  • - - name - - : - - (string) - - the name of the hui that will be toggled - -
  • - - - - - -
  • - - state - - : - - (boolean) - - when set will force a state for the frame - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - if the frame if no open or closed -
  • -
- - - - - - - - - -
-
-
-
- # - CenterFrames.new_frame(permission_name) -
-
-
-
- -

Creates a new center frame define

-

- - - Parameters: - -
    - - - - - -
  • - - permission_name - - : - - (string) - - the name that can be used with the permission system - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new center frame define -
  • -
- - - - - - - - - -
-
-
-
- # - CenterFrames._prototype:set_auto_focus([state=true]) -
-
-
-
- -

Sets the frame to be the current active gui when opened and closes all other frames

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when true will auto close other frames and set this frame as player.opened - - (default: true) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to draw the frame for - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to draw the frame for - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - CenterFrames._prototype:toggle_frame(player) -
-
-
-
- -

Toggles if the frame is open, if open it will close it and if closed it will open it

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to draw the frame for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - with the gui frame is now open -
  • -
- - - - - - - - - -
-
-
-
- # - CenterFrames._prototype:event_handler([action=update]) -
-
-
-
- -

Creates an event handler that will trigger one of its functions, use with Event.add

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - the action to take on this event - - (default: update) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.concepts.left.html b/docs/modules/expcore.gui.concepts.left.html deleted file mode 100644 index 8c7b6772..00000000 --- a/docs/modules/expcore.gui.concepts.left.html +++ /dev/null @@ -1,1476 +0,0 @@ - - - - - - - - expcore.gui.concepts.left module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.concepts.left module

-

Gui structure define for left frames -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
expcore.gui.concepts.toolbar
expcore.gui.elements.buttons
mod-gui
utils.game
utils.event
- - -

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=true])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:_internal_draw(player)Creates the gui for the first time, used internally
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=false])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=false])Redraws the frame for all players, see redraw
LeftFrames._prototype:event_handler([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.concepts.toolbar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.buttons -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - LeftFrames.get_flow(player) -
-
-
-
- -

Gets the left frame flow for a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the flow of - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - LeftFrames.get_frame(name, player) -
-
-
-
- -

Gets one frame from the left flow by its name

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the gui frame to get - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the frame of - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the frame in the left frame flow with that name -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames.get_open(player) -
-
-
-
- -

Gets all open frames for a player, if non are open it will remove the close all button

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the flow of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains all the open (and registered) frames for the player -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames.toggle_frame(name, player[, state]) -
-
-
-
- -

Toggles the visibility of a left frame, or sets its visibility state

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the gui frame to toggle - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the frame of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - when given will be the state that the visibility is set to - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new state of the visibility -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames.new_frame(permission_name) -
-
-
-
- -

Creates a new left frame define

-

- - - Parameters: - -
    - - - - - -
  • - - permission_name - - : - - (string) - - the name that can be used with the permission system - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new left frame define -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:set_open_by_default([state=true]) -
-
-
-
- -

Sets if the frame is visible when a player joins, can also be a function to return a boolean

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean or function) - - 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 - - (default: true) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:set_direction(direction) -
-
-
-
- -

Sets the direction of the frame, either vertical or horizontal

-

- - - Parameters: - -
    - - - - - -
  • - - direction - - : - - (string) - - the direction to have the elements be added to the frame - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:_internal_draw(player) -
-
-
-
- -

Creates the gui for the first time, used internally

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to draw the frame to - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:get_frame(player) -
-
-
-
- -

Gets the frame for this define from the left frame flow

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the frame of - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the frame in the left frame flow for this define -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:is_open(player) -
-
-
-
- -

Returns if the player currently has this define visible

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the frame of - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if it is open/visible -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:toggle(player) -
-
-
-
- -

Toggles the visibility of the left frame

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to toggle the frame of - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - the new state of the visibility -
  • -
- - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:update(player) -
-
-
-
- -

Updates the contents of the left frame, first tries update callback, other wise will clear and redraw

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to update the frame of - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:update_all([update_offline=false]) -
-
-
-
- -

Updates the frame for all players, see update

-

- - - Parameters: - -
    - - - - - -
  • - - update_offline - - : - - (boolean) - - when true will update the frame for offline players - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:redraw(player) -
-
-
-
- -

Redraws the frame by calling on_draw, will always clear the frame

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to update the frame of - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:redraw_all([update_offline=false]) -
-
-
-
- -

Redraws the frame for all players, see redraw

-

- - - Parameters: - -
    - - - - - -
  • - - update_offline - - : - - (boolean) - - when true will update the frame for offline players - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - LeftFrames._prototype:event_handler([action=update]) -
-
-
-
- -

Creates an event handler that will trigger one of its functions, use with Event.add

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - the action to take on this event - - (default: update) -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.concepts.popups.html b/docs/modules/expcore.gui.concepts.popups.html deleted file mode 100644 index ec65c5df..00000000 --- a/docs/modules/expcore.gui.concepts.popups.html +++ /dev/null @@ -1,1012 +0,0 @@ - - - - - - - - expcore.gui.concepts.popups module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.concepts.popups module

-

Gui structure define for popup gui -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
utils.game
utils.event
expcore.gui.elements.progress-bar
expcore.gui.elements.buttons
mod-gui
resources.color_presets
utils.global
- - -

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.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
- - -

Fields

- - - - - - - - - - - - -
PopupFrames.close_progressProgress bar which when depleted will close the popup frame
PopupFrames.close_buttonA button which can be used to close the gui before the timer runs out
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.progress-bar -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.buttons -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - PopupFrames.get_flow(player) -
-
-
-
- -

Gets the left flow that contains the popup frames

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the flow for - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - 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

-

- - - Parameters: - -
    - - - - - -
  • - - define_name - - : - - (string) - - the name of the define that you want to open for the player - -
  • - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to open the popup for - -
  • - - - - - -
  • - - open_time - - : - - (number) - - the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default - - (optional) -
  • - - - - - -
  • - - ... - - : - - (any) - - the other params that you want to pass to your on_draw event - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the frame that was drawn, the inner gui flow which contains the content -
  • -
- - - - - - - - - -
-
-
-
- # - PopupFrames.new_popup([name]) -
-
-
-
- -

Creates a new popup frame define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the 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

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the number of ticks, by default, the popup will be open for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the define to allow for chaining -
  • -
- - - - - - - - - -
-
-
-
- # - 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

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to open the popup for - -
  • - - - - - -
  • - - open_time - - : - - (number) - - the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default - - (optional) -
  • - - - - - -
  • - - ... - - : - - (any) - - the other params that you want to pass to your on_draw event - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the frame that was drawn, the inner gui flow which contains the content -
  • -
- - - - - - - - - -
-
-

Fields

-
-
-
-
- # - 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

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.concepts.toolbar.html b/docs/modules/expcore.gui.concepts.toolbar.html deleted file mode 100644 index c7846884..00000000 --- a/docs/modules/expcore.gui.concepts.toolbar.html +++ /dev/null @@ -1,635 +0,0 @@ - - - - - - - - expcore.gui.concepts.toolbar module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.concepts.toolbar module

-

Gui structure for the toolbar (top left) -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.elements.buttons
expcore.roles
utils.event
utils.game
mod-gui
- - -

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
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.elements.buttons -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Toolbar.new_button([name]) -
-
-
-
- -

Adds a new button to the toolbar

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - when given allows an alias to the button for the permission system - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the button define -
  • -
- - - - - - - - - -
-
-
-
- # - Toolbar.add_button(button) -
-
-
-
- -

Adds an existing buttton to the toolbar

-

- - - Parameters: - -
    - - - - - -
  • - - button - - : - - (table) - - the button define for the button to be added - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Toolbar.update(player) -
-
-
-
- -

Updates the player's toolbar with an new buttons or expected change in auth return

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to update the toolbar for - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.core.html b/docs/modules/expcore.gui.core.html deleted file mode 100644 index 67781766..00000000 --- a/docs/modules/expcore.gui.core.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - expcore.gui.core module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.core module

-

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 -[[

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.dropdown.html b/docs/modules/expcore.gui.dropdown.html deleted file mode 100644 index 8f7b876d..00000000 --- a/docs/modules/expcore.gui.dropdown.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.dropdown

-

Gui class define for dropdowns and list boxs -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dropdown.new_dropdown ([name])Creates a new dropdown element define
Dropdown.new_list_box ([name])Creates a new list box element define
Dropdown._prototype:new_static_options (options[, ...], the)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
- -
-
- - -

Functions

- -
-
- - Dropdown.new_dropdown ([name]) -
-
- Creates a new dropdown element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new dropdown element define -
- - - - -
-
- - Dropdown.new_list_box ([name]) -
-
- Creates a new list box element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new list box element define -
- - - - -
-
- - Dropdown._prototype:new_static_options (options[, ...], the) -
-
- Adds new static options to the dropdown which will trigger the general callback - - -

Parameters:

-
    -
  • options - table - ?string|table either a of option strings or the first option string, with a table values are the options -
  • -
  • ... - table - when options is not a you can add the options one after each other - (optional) -
  • -
  • the - self - define to allow chaining -
  • -
- - - - - -
-
- - 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) - - -

Parameters:

-
    -
  • callback - function - the function that will run to get the options for the dropdown - callback param - player LuaPlayer - the player that the element is being drawn to - callback param - element LuaGuiElement - the element that is being drawn - callback return - table - the values of this table will be appended to the static options of the dropdown -
  • -
- -

Returns:

-
    - - self - the define to allow chaining -
- - - - -
-
- - 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) - - -

Parameters:

-
    -
  • option - string - the name of the option to trigger the callback on; if not already added then will be added as an option -
  • -
  • callback - function - the function that will be called when that option is selected - callback param - player LuaPlayer - the player who owns the gui element - callback param - element LuaGuiElement - the element which is being effected - callback param - value string - the new option that has been selected -
  • -
- -

Returns:

-
    - - self - the define to allow chaining -
- - - - -
-
- - Dropdown.select_value (element, value) -
-
- Selects the option from a dropdown or list box given the value rather than key - - -

Parameters:

-
    -
  • element - LuaGuiElement - the element that contains the option -
  • -
  • value - string - the option to select from the dropdown -
  • -
- -

Returns:

-
    - - number - the key where the value was -
- - - - -
-
- - Dropdown.get_selected_value (element) -
-
- Returns the currently selected value rather than index - - -

Parameters:

-
    -
  • element - LuaGuiElement - the gui element that you want to get the value of -
  • -
- -

Returns:

-
    - - string - the value that is currently selected -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.elem-button.html b/docs/modules/expcore.gui.elem-button.html deleted file mode 100644 index 8bc3eb4c..00000000 --- a/docs/modules/expcore.gui.elem-button.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.elem-button

-

Gui class defines for elem buttons -[[

-

- - -

Functions

- - - - - - - - - - - - - -
ElemButton.new_elem_button ([name])Creates a new elem button element define
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
- -
-
- - -

Functions

- -
-
- - ElemButton.new_elem_button ([name]) -
-
- Creates a new elem button element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new elem button element define -
- - - - -
-
- - ElemButton._prototype:set_type (type) -
-
- Sets the type of the elem button, the type is required so this must be called at least once - - -

Parameters:

-
    -
  • type - string - the type that this elem button is see factorio api -
  • -
- -

Returns:

-
    - - the - element define to allow for chaining -
- - - - -
-
- - ElemButton._prototype:set_default (value) -
-
- Sets the default value for the elem button, this may be a function or a string - - -

Parameters:

-
    -
  • value - string or function - string a will be a static default and a function will be called when drawn to get the default -
  • -
- -

Returns:

-
    - - the - element define to allow for chaining -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.elements.buttons.html b/docs/modules/expcore.gui.elements.buttons.html deleted file mode 100644 index dc8adc9a..00000000 --- a/docs/modules/expcore.gui.elements.buttons.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - - - expcore.gui.elements.buttons module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.buttons module

-

Gui class define for buttons and sprite buttons -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
mod-gui
expcore.gui.core
expcore.gui.prototype
- - -

Functions

- - - - - - - - - - - - - - - - - - - - -
Button.new_button([name])Creates a new button element define
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
- - -
- - -

Dependencies

-
-
-
-
- # - mod-gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Button.new_button([name]) -
-
-
-
- -

Creates a new button element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new button element define -
  • -
- - - - - - - - - -
-
-
-
- # - Button._prototype:set_sprites(sprite[, hovered_sprite][, clicked_sprite]) -
-
-
-
- -

Adds sprites to a button making it a sprite button

-

- - - Parameters: - -
    - - - - - -
  • - - sprite - - : - - (SpritePath) - - the sprite path for the default sprite for the button - -
  • - - - - - -
  • - - hovered_sprite - - : - - (SpritePath) - - the sprite path for the sprite when the player hovers over the button - - (optional) -
  • - - - - - -
  • - - clicked_sprite - - : - - (SpritePath) - - the sprite path for the sprite when the player clicks the button - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - returns the button define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Button._prototype:set_click_filter(filter[, ...]) -
-
-
-
- -

Adds a click / mouse button filter to the button

-

- - - Parameters: - -
    - - - - - -
  • - - filter - - : - - (table) - - ?string|table either a of mouse buttons or the first mouse button to filter, with a table true means allowed - -
  • - - - - - -
  • - - ... - - : - - (table) - - when filter is not a you can add the mouse buttons one after each other - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - returns the button define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Button._prototype:set_key_filter(filter[, ...]) -
-
-
-
- -

Adds a control key filter to the button

-

- - - Parameters: - -
    - - - - - -
  • - - filter - - : - - (table) - - ?string|table either a of control keys or the first control keys to filter, with a table true means allowed - -
  • - - - - - -
  • - - ... - - : - - (table) - - when filter is not a you can add the control keys one after each other - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - returns the button define to allow chaining -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.checkbox.html b/docs/modules/expcore.gui.elements.checkbox.html deleted file mode 100644 index bdfbf5a6..00000000 --- a/docs/modules/expcore.gui.elements.checkbox.html +++ /dev/null @@ -1,1040 +0,0 @@ - - - - - - - - expcore.gui.elements.checkbox module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.checkbox module

-

Gui class define for checkbox and radiobuttons -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
expcore.store
utils.game
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Checkbox.new_checkbox([name])Creates a new checkbox element define
Checkbox.new_radiobutton([name])Creates a new radiobutton element define, has all functions checkbox has
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)
Checkbox._prototype_radiobutton:get_store(category, internal)Gets the stored value of the radiobutton or the option set if present
Checkbox._prototype_radiobutton:set_store(category, value, internal)Sets the stored value of the radiobutton or the option set if present
Checkbox.new_option_set(name, callback, categorize)Registers a new option set that can be linked to radiobuttons (only one can be true at a time)
Checkbox.draw_option_set(name, element)Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
Checkbox.reset_radiobuttons(element[, exclude][, recursive=false])Sets all radiobutton in a element to false (unless excluded) and can act recursively
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Checkbox.new_checkbox([name]) -
-
-
-
- -

Creates a new checkbox element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new checkbox element define -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.new_radiobutton([name]) -
-
-
-
- -

Creates a new radiobutton element define, has all functions checkbox has

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new button element define -
  • -
- - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - option_set - - : - - (string) - - the name of the option set to add this element to - -
  • - - - - - -
  • - - option_name - - : - - (string) - - the name of this option that will be used to identify it - -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox._prototype_radiobutton:get_store(category, internal) -
-
-
-
- -

Gets the stored value of the radiobutton or the option set if present

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - - - - -
  • - - internal - - : - - (boolean) - - used to prevent stackover flow - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value that is stored for this define -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox._prototype_radiobutton:set_store(category, value, internal) -
-
-
-
- -

Sets the stored value of the radiobutton or the option set if present

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - - - - -
  • - - value - - : - - (boolean) - - the value to set for this define, must be valid for its type ie for checkbox etc - -
  • - - - - - -
  • - - internal - - : - - (boolean) - - used to prevent stackover flow - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the value was set -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.new_option_set(name, callback, categorize) -
-
-
-
- -

Registers a new option set that can be linked to radiobuttons (only one can be true at a time)

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the option set, must be unique - -
  • - - - - - -
  • - - callback - - : - - (function) - - the update callback when the value of the option set changes - callback param - value string - the new selected option for this option set - callback param - category string - the category that updated if categorize was used - -
  • - - - - - -
  • - - categorize - - : - - (function) - - the function used to convert an element into a string - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the name of this option set to be passed to add_as_option -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.draw_option_set(name, element) -
-
-
-
- -

Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the option set to draw the radiobuttons of - -
  • - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the parent element that the radiobuttons will be drawn to - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Checkbox.reset_radiobuttons(element[, exclude][, recursive=false]) -
-
-
-
- -

Sets all radiobutton in a element to false (unless excluded) and can act recursively

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the root gui element to start setting radio buttons from - -
  • - - - - - -
  • - - exclude - - : - - (table) - - ?string|table the name of the radiobutton to exclude or a of radiobuttons where true will set the state true - - (optional) -
  • - - - - - -
  • - - recursive - - : - - (number or boolean) - - if true will recur as much as possible, if a will recur that number of times - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if successful -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.checkboxs.html b/docs/modules/expcore.gui.elements.checkboxs.html deleted file mode 100644 index de6841e3..00000000 --- a/docs/modules/expcore.gui.elements.checkboxs.html +++ /dev/null @@ -1,848 +0,0 @@ - - - - - - - - expcore.gui.elements.checkboxs module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.checkboxs module

-

Gui class define for checkboxs and radiobuttons -[[

-

- - - - - - - - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Checkbox.new_checkbox([name])Creates a new checkbox element define
Checkbox.new_radiobutton([name])Creates a new radiobutton element define, has all functions checkbox has
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)
Checkbox._prototype_radiobutton:get_store(category, internal)Gets the stored value of the radiobutton or the option set if present
Checkbox._prototype_radiobutton:set_store(category, value, internal)Sets the stored value of the radiobutton or the option set if present
Checkbox.new_option_set(name, callback, categorize)Registers a new option set that can be linked to radiobutotns (only one can be true at a time)
Checkbox.draw_option_set(name, element)Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)
Checkbox.reset_radiobuttons(element[, exclude][, recursive=false])Sets all radiobutotn in a element to false (unless excluded) and can act recursivly
- - -
- - -

Functions

-
-
-
-
- # - Checkbox.new_checkbox([name]) -
-
-
-
- -

Creates a new checkbox element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new checkbox element define -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.new_radiobutton([name]) -
-
-
-
- -

Creates a new radiobutton element define, has all functions checkbox has

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new button element define -
  • -
- - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - option_set - - : - - (string) - - the name of the option set to add this element to - -
  • - - - - - -
  • - - option_name - - : - - (string) - - the name of this option that will be used to idenitife it - -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox._prototype_radiobutton:get_store(category, internal) -
-
-
-
- -

Gets the stored value of the radiobutton or the option set if present

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - - - - -
  • - - internal - - : - - (boolean) - - used to prevent stackover flow - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value that is stored for this define -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox._prototype_radiobutton:set_store(category, value, internal) -
-
-
-
- -

Sets the stored value of the radiobutton or the option set if present

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - - - - -
  • - - value - - : - - (boolean) - - the value to set for this define, must be valid for its type ie for checkbox etc - -
  • - - - - - -
  • - - internal - - : - - (boolean) - - used to prevent stackover flow - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the value was set -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.new_option_set(name, callback, categorize) -
-
-
-
- -

Registers a new option set that can be linked to radiobutotns (only one can be true at a time)

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the option set, must be unique - -
  • - - - - - -
  • - - callback - - : - - (function) - - the update callback when the value of the option set chagnes - callback param - value string - the new selected option for this option set - callback param - category string - the category that updated if categorize was used - -
  • - - - - - -
  • - - categorize - - : - - (function) - - the function used to convert an element into a string - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the name of this option set to be passed to add_as_option -
  • -
- - - - - - - - - -
-
-
-
- # - Checkbox.draw_option_set(name, element) -
-
-
-
- -

Draws all radiobuttons that are part of an option set at once (Gui.draw will not work)

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the option set to draw the radiobuttons of - -
  • - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the parent element that the radiobuttons will be drawn to - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Checkbox.reset_radiobuttons(element[, exclude][, recursive=false]) -
-
-
-
- -

Sets all radiobutotn in a element to false (unless excluded) and can act recursivly

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the root gui element to start setting radio buttons from - -
  • - - - - - -
  • - - exclude - - : - - (table) - - ?string|table the name of the radiobutton to exclude or a of radiobuttons where true will set the state true - - (optional) -
  • - - - - - -
  • - - recursive - - : - - (number or boolean) - - if true will recur as much as possible, if a will recur that number of times - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if successful -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.dropdown.html b/docs/modules/expcore.gui.elements.dropdown.html deleted file mode 100644 index 15a4a3ed..00000000 --- a/docs/modules/expcore.gui.elements.dropdown.html +++ /dev/null @@ -1,874 +0,0 @@ - - - - - - - - expcore.gui.elements.dropdown module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.dropdown module

-

Gui class define for dropdowns and list box -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
utils.game
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dropdown.new_dropdown([name])Creates a new dropdown element define
Dropdown.new_list_box([name])Creates a new list box element define
Dropdown._prototype:new_static_options(options[, ...], the)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
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Dropdown.new_dropdown([name]) -
-
-
-
- -

Creates a new dropdown element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new dropdown element define -
  • -
- - - - - - - - - -
-
-
-
- # - Dropdown.new_list_box([name]) -
-
-
-
- -

Creates a new list box element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new list box element define -
  • -
- - - - - - - - - -
-
-
-
- # - Dropdown._prototype:new_static_options(options[, ...], the) -
-
-
-
- -

Adds new static options to the dropdown which will trigger the general callback

-

- - - Parameters: - -
    - - - - - -
  • - - options - - : - - (table) - - ?string|table either a of option strings or the first option string, with a table values are the options - -
  • - - - - - -
  • - - ... - - : - - (table) - - when options is not a you can add the options one after each other - - (optional) -
  • - - - - - -
  • - - the - - : - - (self) - - define to allow chaining - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - the function that will run to get the options for the dropdown - callback param - player LuaPlayer - the player that the element is being drawn to - callback param - element LuaGuiElement - the element that is being drawn - callback return - table - the values of this table will be appended to the static options of the dropdown - -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - 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)

-

- - - Parameters: - -
    - - - - - -
  • - - option - - : - - (string) - - the name of the option to trigger the callback on; if not already added then will be added as an option - -
  • - - - - - -
  • - - callback - - : - - (function) - - the function that will be called when that option is selected - callback param - player LuaPlayer - the player who owns the gui element - callback param - element LuaGuiElement - the element which is being effected - callback param - value string - the new option that has been selected - -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Dropdown.select_value(element, value) -
-
-
-
- -

Selects the option from a dropdown or list box given the value rather than key

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that contains the option - -
  • - - - - - -
  • - - value - - : - - (string) - - the option to select from the dropdown - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the key where the value was -
  • -
- - - - - - - - - -
-
-
-
- # - Dropdown.get_selected_value(element) -
-
-
-
- -

Returns the currently selected value rather than index

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the gui element that you want to get the value of - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the value that is currently selected -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.elem-button.html b/docs/modules/expcore.gui.elements.elem-button.html deleted file mode 100644 index 45ce8da8..00000000 --- a/docs/modules/expcore.gui.elements.elem-button.html +++ /dev/null @@ -1,570 +0,0 @@ - - - - - - - - expcore.gui.elements.elem-button module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.elem-button module

-

Gui class defines for elem buttons -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
utils.game
- - -

Functions

- - - - - - - - - - - - -
ElemButton.new_elem_button([name])Creates a new elem button element define
ElemButton._prototype:set_default(value)Sets the default value for the elem button, this may be a function or a string
- - -

Fields

- - - - - - - - -
ElemButton._prototype.set_typeSets the type of the elem button, the type is required so this must be called at least once
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - ElemButton.new_elem_button([name]) -
-
-
-
- -

Creates a new elem button element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new elem button element define -
  • -
- - - - - - - - - -
-
-
-
- # - ElemButton._prototype:set_default(value) -
-
-
-
- -

Sets the default value for the elem button, this may be a function or a string

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (string or function) - - string a will be a static default and a function will be called when drawn to get the default - -
  • - - -
- - - - - Returns: -
    -
  • - (the) - element define to allow for chaining -
  • -
- - - - - - - - - -
-
-

Fields

-
-
-
-
- # - ElemButton._prototype.set_type -
-
-
-
- -

Sets the type of the elem button, the type is required so this must be called at least once

-

- - - -
    - - - - - -
  • - - type - - : - - (string) - - the type that this elem button is see factorio api - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.progress-bar.html b/docs/modules/expcore.gui.elements.progress-bar.html deleted file mode 100644 index c1809083..00000000 --- a/docs/modules/expcore.gui.elements.progress-bar.html +++ /dev/null @@ -1,1343 +0,0 @@ - - - - - - - - expcore.gui.elements.progress-bar module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.progress-bar module

-

Gui element define for progress bars -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
utils.global
utils.game
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProgressBar.set_maximum(element, amount)Sets the maximum value that represents the end value of the progress bar
ProgressBar.increment(element[, amount=1])Increases the value of the progressbar, if a define is given all of its instances have incremented
ProgressBar.decrement(element[, amount=1])Decreases the value of the progressbar, if a define is given all of its instances have decremented
ProgressBar.new_progressbar([name])Creates a new progressbar element define
ProgressBar._prototype:set_default_maximum(amount)Sets the maximum value that represents the end value of the progress bar
ProgressBar._prototype:use_count_down([state=true])Will set the progress bar to start at 1 and trigger when it hits 0
ProgressBar._prototype:increment([amount=1][, category])Increases the value of the progressbar
ProgressBar._prototype:increment_filtered([amount=1], filter)Increases the value of the progressbar, if the filter condition is met, does not work with store
ProgressBar._prototype:decrement([amount=1][, category])Decreases the value of the progressbar
ProgressBar._prototype:decrement_filtered([amount=1], filter)Decreases the value of the progressbar, if the filter condition is met, does not work with store
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 - note use store if you want persistent data, this only stores the elements not the values which they have
ProgressBar._prototype:reset_element(element)Resets an element, or its store, to be back at the start, either 1 or 0
ProgressBar._prototype:event_counter([filter])Event handler factory that counts up by 1 every time the event triggers, can filter which elements have incremented
ProgressBar._prototype:event_countdown([filter])Event handler factory that counts down by 1 every time the event triggers, can filter which elements have decremented
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - ProgressBar.set_maximum(element, amount) -
-
-
-
- -

Sets the maximum value that represents the end value of the progress bar

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement or string) - - either a gui element or a registered define - -
  • - - - - - -
  • - - amount - - : - - (number) - - the amount to have set as the maximum - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar.increment(element[, amount=1]) -
-
-
-
- -

Increases the value of the progressbar, if a define is given all of its instances have incremented

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement or string) - - either a gui element or a registered define - -
  • - - - - - -
  • - - amount - - : - - (number) - - the amount to increase the progressbar by - - (default: 1) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar.decrement(element[, amount=1]) -
-
-
-
- -

Decreases the value of the progressbar, if a define is given all of its instances have decremented

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement or string) - - either a gui element or a registered define - -
  • - - - - - -
  • - - amount - - : - - (number) - - the amount to decrease the progressbar by - - (default: 1) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar.new_progressbar([name]) -
-
-
-
- -

Creates a new progressbar element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new progressbar element define -
  • -
- - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:set_default_maximum(amount) -
-
-
-
- -

Sets the maximum value that represents the end value of the progress bar

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the amount to have set as the maximum - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:use_count_down([state=true]) -
-
-
-
- -

Will set the progress bar to start at 1 and trigger when it hits 0

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when true the bar will start filled, to be used with decrease - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:increment([amount=1][, category]) -
-
-
-
- -

Increases the value of the progressbar

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the amount to increase the progressbar by - - (default: 1) -
  • - - - - - -
  • - - category - - : - - (string) - - the category that is used with a store - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:increment_filtered([amount=1], filter) -
-
-
-
- -

Increases the value of the progressbar, if the filter condition is met, does not work with store

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the amount to increase the progressbar by - - (default: 1) -
  • - - - - - -
  • - - filter - - : - - (function) - - the filter to be used - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:decrement([amount=1][, category]) -
-
-
-
- -

Decreases the value of the progressbar

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the amount to decrease the progressbar by - - (default: 1) -
  • - - - - - -
  • - - category - - : - - (string) - - the category that is used with a store - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:decrement_filtered([amount=1], filter) -
-
-
-
- -

Decreases the value of the progressbar, if the filter condition is met, does not work with store

-

- - - Parameters: - -
    - - - - - -
  • - - amount - - : - - (number) - - the amount to decrease the progressbar by - - (default: 1) -
  • - - - - - -
  • - - filter - - : - - (function) - - the filter to be used - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - 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 - note use store if you want persistent data, this only stores the elements not the values which they have

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that you want to add into the waiting to complete list - -
  • - - - - - -
  • - - maximum - - : - - (number) - - the maximum for this element if not given the default for this define is used - - (optional) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:reset_element(element) -
-
-
-
- -

Resets an element, or its store, to be back at the start, either 1 or 0

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that you want to reset the progress of - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:event_counter([filter]) -
-
-
-
- -

Event handler factory that counts up by 1 every time the event triggers, can filter which elements have incremented

-

- - - Parameters: - -
    - - - - - -
  • - - filter - - : - - (function) - - when given will use filtered increment - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (function) - the event handler -
  • -
- - - - - - - - - -
-
-
-
- # - ProgressBar._prototype:event_countdown([filter]) -
-
-
-
- -

Event handler factory that counts down by 1 every time the event triggers, can filter which elements have decremented

-

- - - Parameters: - -
    - - - - - -
  • - - filter - - : - - (function) - - when given will use filtered decrement - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (function) - the event handler -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.slider.html b/docs/modules/expcore.gui.elements.slider.html deleted file mode 100644 index 394a0754..00000000 --- a/docs/modules/expcore.gui.elements.slider.html +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - - - expcore.gui.elements.slider module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.slider module

-

Gui class define for sliders -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
expcore.gui.instances
utils.game
- - -

Functions

- - - - - - - - - - - - - - - - - - - - -
Slider.new_slider([name])Creates a new slider element define
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=true])Enables auto draw of the label, the label will share the same parent element as the slider
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.instances -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Slider.new_slider([name]) -
-
-
-
- -

Creates a new slider element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new slider element define -
  • -
- - - - - - - - - -
-
-
-
- # - Slider._prototype:set_range([min][, max]) -
-
-
-
- -

Sets the range of a slider, if not used will use default values for a slider

-

- - - Parameters: - -
    - - - - - -
  • - - min - - : - - (number) - - the minimum value that the slider can take - - (optional) -
  • - - - - - -
  • - - max - - : - - (number) - - the maximum value that the slider can take - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - 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

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the parent element that the label will be drawn to - -
  • - - -
- - - - - Returns: -
    -
  • - (LuaGuiElement) - the new label element so that styles can be applied -
  • -
- - - - - - - - - -
-
-
-
- # - Slider._prototype:enable_auto_draw_label([state=true]) -
-
-
-
- -

Enables auto draw of the label, the label will share the same parent element as the slider

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when false will disable the auto draw of the label - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the define to allow chaining -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.elements.text.html b/docs/modules/expcore.gui.elements.text.html deleted file mode 100644 index d9fca3e5..00000000 --- a/docs/modules/expcore.gui.elements.text.html +++ /dev/null @@ -1,691 +0,0 @@ - - - - - - - - expcore.gui.elements.text module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.elements.text module

-

Gui class define for text fields and text boxes -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
expcore.gui.core
expcore.gui.prototype
utils.game
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - -
Text.new_text_field([name])Creates a new text field element define
Text.new_text_box([name])Creates a new text box element define
Text._prototype_box:set_selectable([state=true])Sets the text box to be selectable
Text._prototype_box:set_word_wrap([state=true])Sets the text box to have word wrap
Text._prototype_box:set_read_only([state=true])Sets the text box to be read only
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui.core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.prototype -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Text.new_text_field([name]) -
-
-
-
- -

Creates a new text field element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new text field element define -
  • -
- - - - - - - - - -
-
-
-
- # - Text.new_text_box([name]) -
-
-
-
- -

Creates a new text box element define

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the optional debug name that can be added - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the new text box element define -
  • -
- - - - - - - - - -
-
-
-
- # - Text._prototype_box:set_selectable([state=true]) -
-
-
-
- -

Sets the text box to be selectable

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when false will set the state to false - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - table the define to allow for chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Text._prototype_box:set_word_wrap([state=true]) -
-
-
-
- -

Sets the text box to have word wrap

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when false will set the state to false - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - table the define to allow for chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Text._prototype_box:set_read_only([state=true]) -
-
-
-
- -

Sets the text box to be read only

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when false will set the state to false - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - table the define to allow for chaining -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.html b/docs/modules/expcore.gui.html deleted file mode 100644 index 78739a7f..00000000 --- a/docs/modules/expcore.gui.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - expcore.gui module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui module

-

This file combines all the other gui files

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.instances.html b/docs/modules/expcore.gui.instances.html deleted file mode 100644 index baca9bef..00000000 --- a/docs/modules/expcore.gui.instances.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - expcore.gui.instances module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.instances module

-

This file is a breakout from core which forcues on instance management of defines -[[

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.left.html b/docs/modules/expcore.gui.left.html deleted file mode 100644 index b49d8a7b..00000000 --- a/docs/modules/expcore.gui.left.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.left

-

Gui structure define for left frames -[[

-

- - -

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 visiblty of a left frame, or sets its visiblty state
LeftFrames.new_frame (permision_name)Creates a new left frame define
LeftFrames._prototype:set_open_by_default ([state=true])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 visiblty of the left frame
LeftFrames._prototype:update (player)Updates the contents of the left frame, first tries update callback, oter wise will clear and redraw
LeftFrames._prototype:update_all ([update_offline=false])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=false])Redraws the frame for all players, see redraw
LeftFrames._prototype:event_handler ([action=update])Creates an event handler that will trigger one of its functions, use with Event.add
- -
-
- - -

Functions

- -
-
- - LeftFrames.get_flow (player) -
-
- Gets the left frame flow for a player - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the flow of -
  • -
- -

Returns:

-
    - - LuaGuiElement - the left frame flow for the player -
- - - - -
-
- - LeftFrames.get_frame (name, player) -
-
- Gets one frame from the left flow by its name - - -

Parameters:

-
    -
  • name - string - the name of the gui frame to get -
  • -
  • player - LuaPlayer - the player to get the frame of -
  • -
- -

Returns:

-
    - - LuaGuiElement - the frame in the left frame flow with that name -
- - - - -
-
- - LeftFrames.get_open (player) -
-
- Gets all open frames for a player, if non are open it will remove the close all button - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the flow of -
  • -
- -

Returns:

-
    - - table - contains all the open (and registered) frames for the player -
- - - - -
-
- - LeftFrames.toggle_frame (name, player[, state]) -
-
- Toggles the visiblty of a left frame, or sets its visiblty state - - -

Parameters:

-
    -
  • name - string - the name of the gui frame to toggle -
  • -
  • player - LuaPlayer - the player to get the frame of -
  • -
  • state - boolean - when given will be the state that the visiblty is set to - (optional) -
  • -
- -

Returns:

-
    - - boolean - the new state of the visiblity -
- - - - -
-
- - LeftFrames.new_frame (permision_name) -
-
- Creates a new left frame define - - -

Parameters:

-
    -
  • permision_name - string - the name that can be used with the permision system -
  • -
- -

Returns:

-
    - - table - the new left frame define -
- - - - -
-
- - LeftFrames._prototype:set_open_by_default ([state=true]) -
-
- Sets if the frame is visible when a player joins, can also be a function to return a boolean - - -

Parameters:

-
    -
  • state - boolean or function - the default state of the visiblty, 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 - (default true) -
  • -
- - - - - -
-
- - LeftFrames._prototype:set_direction (direction) -
-
- Sets the direction of the frame, either vertical or horizontal - - -

Parameters:

-
    -
  • direction - string - the direction to have the elements be added to thef frame -
  • -
- - - - - -
-
- - LeftFrames._prototype:get_frame (player) -
-
- Gets the frame for this define from the left frame flow - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the frame of -
  • -
- -

Returns:

-
    - - LuaGuiElement - the frame in the left frame flow for this define -
- - - - -
-
- - LeftFrames._prototype:is_open (player) -
-
- Returns if the player currently has this define visible - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the frame of -
  • -
- -

Returns:

-
    - - boolean - true if it is open/visible -
- - - - -
-
- - LeftFrames._prototype:toggle (player) -
-
- Toggles the visiblty of the left frame - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to toggle the frame of -
  • -
- -

Returns:

-
    - - boolean - the new state of the visiblity -
- - - - -
-
- - LeftFrames._prototype:update (player) -
-
- Updates the contents of the left frame, first tries update callback, oter wise will clear and redraw - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to update the frame of -
  • -
- - - - - -
-
- - LeftFrames._prototype:update_all ([update_offline=false]) -
-
- Updates the frame for all players, see update - - -

Parameters:

-
    -
  • update_offline - boolean - when true will update the frame for offline players - (default false) -
  • -
- - - - - -
-
- - LeftFrames._prototype:redraw (player) -
-
- Redraws the frame by calling on_draw, will always clear the frame - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to update the frame of -
  • -
- - - - - -
-
- - LeftFrames._prototype:redraw_all ([update_offline=false]) -
-
- Redraws the frame for all players, see redraw - - -

Parameters:

-
    -
  • update_offline - boolean - when true will update the frame for offline players - (default false) -
  • -
- - - - - -
-
- - LeftFrames._prototype:event_handler ([action=update]) -
-
- Creates an event handler that will trigger one of its functions, use with Event.add - - -

Parameters:

-
    -
  • action - string - the action to take on this event - (default update) -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.popups.html b/docs/modules/expcore.gui.popups.html deleted file mode 100644 index 25d85846..00000000 --- a/docs/modules/expcore.gui.popups.html +++ /dev/null @@ -1,352 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.popups

-

Gui structure define for popup gui -[[

-

- - -

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.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
-

Fields

- - - - - - - - - -
PopupFrames.close_progressProgress bar which when depleaded will close the popup frame
PopupFrames.close_buttonA button which can be used to close the gui before the timer runs out
- -
-
- - -

Functions

- -
-
- - PopupFrames.get_flow (player) -
-
- Gets the left flow that contains the popup frames - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to get the flow for -
  • -
- -

Returns:

-
    - - LuaGuiElement - 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 - - -

Parameters:

-
    -
  • define_name - string - the name of the define that you want to open for the player -
  • -
  • player - LuaPlayer - the player to open the popup for -
  • -
  • open_time - number - the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default - (optional) -
  • -
  • ... - any - the other params that you want to pass to your on_draw event -
  • -
- -

Returns:

-
    - - LuaGuiElement - the frame that was drawn, the inner gui flow which contains the content -
- - - - -
-
- - PopupFrames.new_popup ([name]) -
-
- Creates a new popup frame define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the 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 - - -

Parameters:

-
    -
  • amount - number - the number of ticks, by default, the popup will be open for -
  • -
- -

Returns:

-
    - - table - the define to allow for chaining -
- - - - -
-
- - 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 - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to open the popup for -
  • -
  • open_time - number - the minimum number of ticks you want the popup open for, 0 means no limit, nil will take default - (optional) -
  • -
  • ... - any - the other params that you want to pass to your on_draw event -
  • -
- -

Returns:

-
    - - LuaGuiElement - the frame that was drawn, the inner gui flow which contains the content -
- - - - -
-
-

Fields

- -
-
- - PopupFrames.close_progress -
-
- Progress bar which when depleaded will close the popup frame - - - - - - - -
-
- - PopupFrames.close_button -
-
- A button which can be used to close the gui before the timer runs out - - - - - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.progress-bar.html b/docs/modules/expcore.gui.progress-bar.html deleted file mode 100644 index 06f0c8f3..00000000 --- a/docs/modules/expcore.gui.progress-bar.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.progress-bar

-

Gui element define for progess bars -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProgressBar.set_maximum (element, amount)Sets the maximum value that represents the end value of the progress bar
ProgressBar.increment (element[, amount=1])Increases the value of the progressbar, if a define is given all of its instances are incremented
ProgressBar.decrement (element[, amount=1])Decreases the value of the progressbar, if a define is given all of its instances are decresed
ProgressBar.new_progressbar ([name])Creates a new progressbar element define
ProgressBar._prototype:set_default_maximum (amount)Sets the maximum value that represents the end value of the progress bar
ProgressBar._prototype:use_count_down ([state=true])Will set the progress bar to start at 1 and trigger when it hits 0
ProgressBar._prototype:increment ([amount=1[, category]])Increases the value of the progressbar
ProgressBar._prototype:increment_filtered ([amount=1], filter)Increases the value of the progressbar, if the filter condition is met, does not work with store
ProgressBar._prototype:decrement ([amount=1[, category]])Decreases the value of the progressbar
ProgressBar._prototype:decrement_filtered ([amount=1], filter)Decreases the value of the progressbar, if the filter condition is met, does not work with store
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 - note use store if you want persistent data, this only stores the elements not the values which they have
ProgressBar._prototype:reset_element (element)Resets an element, or its store, to be back at the start, either 1 or 0
ProgressBar._prototype:event_counter ([filter])Event handler factory that counts up by 1 every time the event triggeres, can filter which elements are incremented
ProgressBar._prototype:event_countdown ([filter])Event handler factory that counts down by 1 every time the event triggeres, can filter which elements are decremented
- -
-
- - -

Functions

- -
-
- - ProgressBar.set_maximum (element, amount) -
-
- Sets the maximum value that represents the end value of the progress bar - - -

Parameters:

-
    -
  • element - LuaGuiElement or string - either a gui element or a registered define -
  • -
  • amount - number - the amount to have set as the maximum -
  • -
- - - - - -
-
- - ProgressBar.increment (element[, amount=1]) -
-
- Increases the value of the progressbar, if a define is given all of its instances are incremented - - -

Parameters:

-
    -
  • element - LuaGuiElement or string - either a gui element or a registered define -
  • -
  • amount - number - the amount to increase the progressbar by - (default 1) -
  • -
- - - - - -
-
- - ProgressBar.decrement (element[, amount=1]) -
-
- Decreases the value of the progressbar, if a define is given all of its instances are decresed - - -

Parameters:

-
    -
  • element - LuaGuiElement or string - either a gui element or a registered define -
  • -
  • amount - number - the amount to decrease the progressbar by - (default 1) -
  • -
- - - - - -
-
- - ProgressBar.new_progressbar ([name]) -
-
- Creates a new progressbar element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new progressbar elemente define -
- - - - -
-
- - ProgressBar._prototype:set_default_maximum (amount) -
-
- Sets the maximum value that represents the end value of the progress bar - - -

Parameters:

-
    -
  • amount - number - the amount to have set as the maximum -
  • -
- -

Returns:

-
    - - table - the define to allow chaining -
- - - - -
-
- - ProgressBar._prototype:use_count_down ([state=true]) -
-
- Will set the progress bar to start at 1 and trigger when it hits 0 - - -

Parameters:

-
    -
  • state - boolean - when true the bar will start filled, to be used with decrease - (default true) -
  • -
- -

Returns:

-
    - - table - the define to allow chaining -
- - - - -
-
- - ProgressBar._prototype:increment ([amount=1[, category]]) -
-
- Increases the value of the progressbar - - -

Parameters:

-
    -
  • amount - number - the amount to increase the progressbar by - (default 1) -
  • -
  • category - string - the category that is used with a store - (optional) -
  • -
- - - - - -
-
- - ProgressBar._prototype:increment_filtered ([amount=1], filter) -
-
- Increases the value of the progressbar, if the filter condition is met, does not work with store - - -

Parameters:

-
    -
  • amount - number - the amount to increase the progressbar by - (default 1) -
  • -
  • filter - function - the filter to be used -
  • -
- - - - - -
-
- - ProgressBar._prototype:decrement ([amount=1[, category]]) -
-
- Decreases the value of the progressbar - - -

Parameters:

-
    -
  • amount - number - the amount to decrease the progressbar by - (default 1) -
  • -
  • category - string - the category that is used with a store - (optional) -
  • -
- - - - - -
-
- - ProgressBar._prototype:decrement_filtered ([amount=1], filter) -
-
- Decreases the value of the progressbar, if the filter condition is met, does not work with store - - -

Parameters:

-
    -
  • amount - number - the amount to decrease the progressbar by - (default 1) -
  • -
  • filter - function - the filter to be used -
  • -
- - - - - -
-
- - 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 - note use store if you want persistent data, this only stores the elements not the values which they have - - -

Parameters:

-
    -
  • element - LuaGuiElement - the element that you want to add into the waiting to complete list -
  • -
  • maximum - number - the maximum for this element if not given the default for this define is used - (optional) -
  • -
- - - - - -
-
- - ProgressBar._prototype:reset_element (element) -
-
- Resets an element, or its store, to be back at the start, either 1 or 0 - - -

Parameters:

-
    -
  • element - LuaGuiElement - the element that you want to reset the progress of -
  • -
- - - - - -
-
- - ProgressBar._prototype:event_counter ([filter]) -
-
- Event handler factory that counts up by 1 every time the event triggeres, can filter which elements are incremented - - -

Parameters:

-
    -
  • filter - function - when given will use filtered incerement - (optional) -
  • -
- -

Returns:

-
    - - function - the event handler -
- - - - -
-
- - ProgressBar._prototype:event_countdown ([filter]) -
-
- Event handler factory that counts down by 1 every time the event triggeres, can filter which elements are decremented - - -

Parameters:

-
    -
  • filter - function - when given will use filtered decerement - (optional) -
  • -
- -

Returns:

-
    - - function - the event handler -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.prototype.html b/docs/modules/expcore.gui.prototype.html deleted file mode 100644 index dabb924e..00000000 --- a/docs/modules/expcore.gui.prototype.html +++ /dev/null @@ -1,1588 +0,0 @@ - - - - - - - - expcore.gui.prototype module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.prototype module

-

Used to create new gui prototypes see elements and concepts -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
expcore.store
expcore.gui.instances
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Constructor.event(event_name)Creates a new function to add functions to an event handler
Constructor.extend(new_prototype)Extents a prototype with the base functions of all gui prototypes, no metatables
Constructor.store(sync, callback)Creates a new function which adds a store to a gui define
Constructor.setter(value_type, key[, second_key])Creates a setter function that checks the type when a value is set
Prototype:uid()Gets the uid for the element define
Prototype:set_style(style[, function])Sets the style for the element define
Prototype:set_embedded_flow(boolean)Sets the element to be drawn inside a nameless flow, can be given a name using a function
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 - what is drawn is based on the data in draw_data which is set using other functions
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
- - -

Fields

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Prototype.debug_nameSets a debug alias for the define
Prototype.set_captionSets the caption for the element define
Prototype.set_tooltipSets the tooltip for the element define
Prototype.set_pre_authenticatorSets an authenticator that blocks the draw function if check fails
Prototype.set_post_authenticatorSets an authenticator that disables the element if check fails
Prototype.on_drawRegisters a callback to the on_draw event
Prototype.on_style_updateRegisters a callback to the on_style_update event
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.gui.instances -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Constructor.event(event_name) -
-
-
-
- -

Creates a new function to add functions to an event handler

-

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - (string) - - the name of the event that callbacks will be added to - -
  • - - -
- - - - - Returns: -
    -
  • - (function) - the function used to register handlers -
  • -
- - - - - - - - - -
-
-
-
- # - Constructor.extend(new_prototype) -
-
-
-
- -

Extents a prototype with the base functions of all gui prototypes, no metatables

-

- - - Parameters: - -
    - - - - - -
  • - - new_prototype - - : - - (table) - - the prototype that you want to add the functions to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - the same prototype but with the new functions added -
  • -
- - - - - - - - - -
-
-
-
- # - Constructor.store(sync, callback) -
-
-
-
- -

Creates a new function which adds a store to a gui define

-

- - - Parameters: - -
    - - - - - -
  • - - sync - - : - - (boolean) - - if the function should create a synced store - -
  • - - - - - -
  • - - callback - - : - - (function) - - the function called when needing to update the value of an element - -
  • - - -
- - - - - Returns: -
    -
  • - (function) - the function that will add a store for this define -
  • -
- - - - - - - - - -
-
-
-
- # - Constructor.setter(value_type, key[, second_key]) -
-
-
-
- -

Creates a setter function that checks the type when a value is set

-

- - - Parameters: - -
    - - - - - -
  • - - value_type - - : - - (string) - - the type that the value should be when it is set - -
  • - - - - - -
  • - - key - - : - - (string) - - the key of the define that will be set - -
  • - - - - - -
  • - - second_key - - : - - (string) - - allows for setting of a key in a sub table - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (function) - the function that will check the type and set the value -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:uid() -
-
-
-
- -

Gets the uid for the element define

-

- - - - - - Returns: -
    -
  • - (string) - the uid of this element define -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:set_style(style[, function]) -
-
-
-
- -

Sets the style for the element define

-

- - - Parameters: - -
    - - - - - -
  • - - style - - : - - (string) - - the style that will be used for this element when drawn - -
  • - - - - - -
  • - - function - - : - - (callback) - - function is called when element is drawn to alter its style - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the element define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:set_embedded_flow(boolean) -
-
-
-
- -

Sets the element to be drawn inside a nameless flow, can be given a name using a function

-

- - - Parameters: - -
    - - - - - -
  • - - boolean - - : - - (state) - - |function when true a padless flow is created to contain the element - -
  • - - -
- - - - - Returns: -
    -
  • - (self) - the element define to allow chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:raise_event(event_name, ...) -
-
-
-
- -

Raises a custom event for this define, any number of params can be given

-

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - (string) - - the name of the event that you want to raise - -
  • - - - - - -
  • - - ... - - : - - (any) - - any params that you want to pass to the event - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of handlers that were registered -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:draw_to(element) -
-
-
-
- -

The main function for defines, when called will draw an instance of this define to the given element - what is drawn is based on the data in draw_data which is set using other functions

-

- - - Parameters: - -
    - - - - - -
  • - - element - - : - - (LuaGuiElement) - - the element that the define will draw a instance of its self onto - -
  • - - -
- - - - - Returns: - - - - - - - - - - -
-
-
-
- # - Prototype:get_store(category) -
-
-
-
- -

Gets the value in this elements store, category needed if categorize function used

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the value that is stored for this define -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:set_store(category, value) -
-
-
-
- -

Sets the value in this elements store, category needed if categorize function used

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - [opt] the category to get such as player name or force name - -
  • - - - - - -
  • - - value - - : - - (any) - - the value to set for this define, must be valid for its type ie for checkbox etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the value was set -
  • -
- - - - - - - - - -
-
-
-
- # - Prototype:clear_store([category]) -
-
-
-
- -

Sets the value in this elements store to nil, category needed if categorize function used

-

- - - Parameters: - -
    - - - - - -
  • - - category - - : - - (string) - - the category to get such as player name or force name - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the value was set -
  • -
- - - - - - - - - -
-
-

Fields

-
-
-
-
- # - Prototype.debug_name -
-
-
-
- -

Sets a debug alias for the define

-

- - - -
    - - - - - -
  • - - name - - : - - (string) - - the debug name for the element define that can be used to get this element define - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.set_caption -
-
-
-
- -

Sets the caption for the element define

-

- - - -
    - - - - - -
  • - - caption - - : - - (string) - - the caption that will be drawn with the element - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.set_tooltip -
-
-
-
- -

Sets the tooltip for the element define

-

- - - -
    - - - - - -
  • - - tooltip - - : - - (string) - - the tooltip that will be displayed for this element when drawn - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.set_pre_authenticator -
-
-
-
- -

Sets an authenticator that blocks the draw function if check fails

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - the function that will be ran to test if the element should be drawn or not - callback param - LuaPlayer player - the player that the element is being drawn to - callback param - string define_name - the name of the define that is being drawn - callback return - boolean - false will stop the element from being drawn - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.set_post_authenticator -
-
-
-
- -

Sets an authenticator that disables the element if check fails

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - the function that will be ran to test if the element should be enabled or not - callback param - LuaPlayer player - the player that the element is being drawn to - callback param - string define_name - the name of the define that is being drawn - callback return - boolean - false will disable the element - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.on_draw -
-
-
-
- -

Registers a callback to the on_draw event

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - - callback param - LuaPlayer player - the player that the element was drawn to - callback param - LuaGuiElement element - the element that was drawn - callback param - any ... - any other params passed by the draw_to function - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Prototype.on_style_update -
-
-
-
- -

Registers a callback to the on_style_update event

-

- - - -
    - - - - - -
  • - - callback - - : - - (function) - - - callback param - LuaStyle style - the style that was changed and/or needs changing - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.slider.html b/docs/modules/expcore.gui.slider.html deleted file mode 100644 index be824dd5..00000000 --- a/docs/modules/expcore.gui.slider.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.slider

-

Gui class define for silders -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - -
Slider.new_slider ([name])Creates a new slider element define
Slider._prototype:use_notches ([state])Adds notches to the slider
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=true])Enables auto draw of the label, the label will share the same parent element as the slider
- -
-
- - -

Functions

- -
-
- - Slider.new_slider ([name]) -
-
- Creates a new slider element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new slider element define -
- - - - -
-
- - Slider._prototype:use_notches ([state]) -
-
- Adds notches to the slider - - -

Parameters:

-
    -
  • state - boolean - when true will draw notches onto the slider - (optional) -
  • -
- - - - - -
-
- - Slider._prototype:set_range ([min[, max]]) -
-
- Sets the range of a slider, if not used will use default values for a slider - - -

Parameters:

-
    -
  • min - number - the minimum value that the slider can take - (optional) -
  • -
  • max - number - the maximum value that the slider can take - (optional) -
  • -
- -

Returns:

-
    - - self - the define to allow chaining -
- - - - -
-
- - 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 - - -

Parameters:

-
    -
  • element - LuaGuiElement - the parent element that the lable will be drawn to -
  • -
- -

Returns:

-
    - - LuaGuiElement - the new label element so that styles can be applied -
- - - - -
-
- - Slider._prototype:enable_auto_draw_label ([state=true]) -
-
- Enables auto draw of the label, the label will share the same parent element as the slider - - -

Parameters:

-
    -
  • state - boolean - when false will disable the auto draw of the label - (default true) -
  • -
- -

Returns:

-
    - - self - the define to allow chaining -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.test.html b/docs/modules/expcore.gui.test.html deleted file mode 100644 index eefdb376..00000000 --- a/docs/modules/expcore.gui.test.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - - - expcore.gui.test module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.gui.test module

-

This file creates a test gui that is used to test every input method - note that this does not cover every permutation only features in independence - for example store in most cases is just by player name, but other store methods are tested with checkbox

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.common
resources.color_presets
utils.event
expcore.store
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.gui.text.html b/docs/modules/expcore.gui.text.html deleted file mode 100644 index 27709f0f..00000000 --- a/docs/modules/expcore.gui.text.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.text

-

Gui class define for text fields and text boxs -[[

-

- - -

Functions

- - - - - - - - - - - - - - - - - - - - - -
Text.new_text_field ([name])Creates a new text field element define
Text.new_text_box ([name])Creates a new text box element define
Text._prototype_box:set_selectable ([state=true])Sets the text box to be selectable
Text._prototype_box:set_word_wrap ([state=true])Sets the text box to have word wrap
Text._prototype_box:set_read_only ([state=true])Sets the text box to be read only
- -
-
- - -

Functions

- -
-
- - Text.new_text_field ([name]) -
-
- Creates a new text field element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new text field element define -
- - - - -
-
- - Text.new_text_box ([name]) -
-
- Creates a new text box element define - - -

Parameters:

-
    -
  • name - string - the optional debug name that can be added - (optional) -
  • -
- -

Returns:

-
    - - table - the new text box element define -
- - - - -
-
- - Text._prototype_box:set_selectable ([state=true]) -
-
- Sets the text box to be selectable - - -

Parameters:

-
    -
  • state - boolean - when false will set the state to false - (default true) -
  • -
- -

Returns:

-
    - - self - table the define to allow for chaining -
- - - - -
-
- - Text._prototype_box:set_word_wrap ([state=true]) -
-
- Sets the text box to have word wrap - - -

Parameters:

-
    -
  • state - boolean - when false will set the state to false - (default true) -
  • -
- -

Returns:

-
    - - self - table the define to allow for chaining -
- - - - -
-
- - Text._prototype_box:set_read_only ([state=true]) -
-
- Sets the text box to be read only - - -

Parameters:

-
    -
  • state - boolean - when false will set the state to false - (default true) -
  • -
- -

Returns:

-
    - - self - table the define to allow for chaining -
- - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.gui.toolbar.html b/docs/modules/expcore.gui.toolbar.html deleted file mode 100644 index 663424de..00000000 --- a/docs/modules/expcore.gui.toolbar.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module expcore.gui.toolbar

-

Gui structure for the toolbar (top left) -[[

-

- - -

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
- -
-
- - -

Functions

- -
-
- - Toolbar.new_button ([name]) -
-
- Adds a new button to the toolbar - - -

Parameters:

-
    -
  • name - string - when given allows an alias to the button for the permission system - (optional) -
  • -
- -

Returns:

-
    - - table - the button define -
- - - - -
-
- - Toolbar.add_button (button) -
-
- Adds an existing buttton to the toolbar - - -

Parameters:

-
    -
  • button - table - the button define for the button to be added -
  • -
- - - - - -
-
- - Toolbar.update (player) -
-
- Updates the player's toolbar with an new buttons or expected change in auth return - - -

Parameters:

-
    -
  • player - LuaPlayer - the player to update the toolbar for -
  • -
- - - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-05-29 22:30:49 -
-
- - diff --git a/docs/modules/expcore.permission_groups.html b/docs/modules/expcore.permission_groups.html deleted file mode 100644 index 72805bd0..00000000 --- a/docs/modules/expcore.permission_groups.html +++ /dev/null @@ -1,1394 +0,0 @@ - - - - - - - - expcore.permission_groups module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.permission_groups module

-

Permission group making for factorio so you never have to make one by hand again -[[-- Core Module - Permission Groups

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
expcore.sudo
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Permissions_Groups.new_group(name)Defines a new permission group that can have it actions set in the config
Permissions_Groups.get_group_by_name(name)Returns the group with the given name, case sensitive
Permissions_Groups.get_group_from_player(player)Returns the group that a player is in
Permissions_Groups.reload_permissions()Reloads/creates all permission groups and sets them to they configured state
Permissions_Groups.lockdown_permissions(exempt)Removes all permissions from every permission group except for "Default" and any passed as exempt
Permissions_Groups.set_player_group(player, group)Sets a player's group to the one given, a player can only have one group at a time
Permissions_Groups._prototype:set_action(action, state)Sets the allow state of an action for this group, used internally but is safe to use else where
Permissions_Groups._prototype:allow(actions)Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime
Permissions_Groups._prototype:disallow(actions)Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime
Permissions_Groups._prototype:allow_all()Sets the default state for any actions not given to be allowed, useful with :disallow
Permissions_Groups._prototype:disallow_all()Sets the default state for any action not given to be disallowed, useful with :allow
Permissions_Groups._prototype:is_allowed(action)Returns if an input action is allowed for this group
Permissions_Groups._prototype:get_raw()Returns the LuaPermissionGroup that was created with this group object, used internally
Permissions_Groups._prototype:create()Creates or updates the permission group with the configured actions, used internally
Permissions_Groups._prototype:add_player(player)Adds a player to this group
Permissions_Groups._prototype:remove_player(player)Removes a player from this group
Permissions_Groups._prototype:get_players([online])Returns all player that are in this group with the option to filter to online/offline only
Permissions_Groups._prototype:print(message)Prints a message to every player in this group
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.sudo -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Permissions_Groups.new_group(name) -
-
-
-
- -

Defines a new permission group that can have it actions set in the config

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the new group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - the new group made with function to allow and disallow actions -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups.get_group_by_name(name) -
-
-
-
- -

Returns the group with the given name, case sensitive

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the group to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that name or nil if non found -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups.get_group_from_player(player) -
-
-
-
- -

Returns the group that a player is in

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the group of can be name index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype or nil) - the group with that player or nil if non found -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups.reload_permissions() -
-
-
-
- -

Reloads/creates all permission groups and sets them to they configured state

-

- - - - - - - - - - - - - - -
-
-
-
- # - Permissions_Groups.lockdown_permissions(exempt) -
-
-
-
- -

Removes all permissions from every permission group except for "Default" and any passed as exempt

-

- - - Parameters: - -
    - - - - - -
  • - - exempt - - : - - (string or Array) - - groups that you want to be except, "Default" is always exempt - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of groups that had they permissions removed -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups.set_player_group(player, group) -
-
-
-
- -

Sets a player's group to the one given, a player can only have one group at a time

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to effect can be name index etc - -
  • - - - - - -
  • - - group - - : - - (string) - - the name of the group to give to the player - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:set_action(action, state) -
-
-
-
- -

Sets the allow state of an action for this group, used internally but is safe to use else where

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string or defines.input_action) - - the action that you want to set the state of - -
  • - - - - - -
  • - - state - - : - - (boolean) - - the state that you want to set it to, true = allow, false = disallow - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:allow(actions) -
-
-
-
- -

Sets an action or actions to be allowed for this group even with disallow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to allow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:disallow(actions) -
-
-
-
- -

Sets an action or actions to be disallowed for this group even with allow_all triggered, Do not use in runtime

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (string or Array) - - the action or actions that you want to disallow for this group - -
  • - - -
- - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:allow_all() -
-
-
-
- -

Sets the default state for any actions not given to be allowed, useful with :disallow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:disallow_all() -
-
-
-
- -

Sets the default state for any action not given to be disallowed, useful with :allow

-

- - - - - - Returns: -
    -
  • - (Permissions_Groups._prototype) - returns self so function can be chained -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:is_allowed(action) -
-
-
-
- -

Returns if an input action is allowed for this group

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (boolean) - true if the group is allowed the action, false other wise -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:get_raw() -
-
-
-
- -

Returns the LuaPermissionGroup that was created with this group object, used internally

-

- - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:create() -
-
-
-
- -

Creates or updates the permission group with the configured actions, used internally

-

- - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:add_player(player) -
-
-
-
- -

Adds a player to this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to add to this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully, false other wise -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:remove_player(player) -
-
-
-
- -

Removes a player from this group

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - LuaPlayer the player you want to remove from this group can be name or index etc - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was removed successfully, false other wise -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:get_players([online]) -
-
-
-
- -

Returns all player that are in this group with the option to filter to online/offline only

-

- - - Parameters: - -
    - - - - - -
  • - - online - - : - - (boolean) - - if nil returns all players, if true online players only, if false returns online players only - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of players that are in this group; filtered if online param is given -
  • -
- - - - - - - - - -
-
-
-
- # - Permissions_Groups._prototype:print(message) -
-
-
-
- -

Prints a message to every player in this group

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that you want to send to the players - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of players that received the message -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.roles.html b/docs/modules/expcore.roles.html deleted file mode 100644 index 82ac20aa..00000000 --- a/docs/modules/expcore.roles.html +++ /dev/null @@ -1,2981 +0,0 @@ - - - - - - - - expcore.roles module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.roles module

-

Factorio role system to manage custom permissions

-

-[[

- - - -
    -
  • Author: Cooldude2606
  • -
- - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
utils.game
utils.global
utils.event
expcore.permission_groups
expcore.sudo
resources.color_presets
expcore.common
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Roles.debug()Returns a string which contains all roles in index order displaying all data for them
Roles.print_to_roles(roles, message)Prints a message to all players in the given roles, may send duplicate message however factorio blocks spam
Roles.print_to_roles_higher(role, message)Prints a message to all players who have the given role or one which is higher (excluding default)
Roles.print_to_roles_lower(role, message)Prints a message to all players who have the given role or one which is lower (excluding default)
Roles.get_role_by_name(name)Get a role for the given name
Roles.get_role_by_order(index)Get a role with the given order index
Roles.get_role_from_any(any)Gets a role from a name,index or role object (where it is just returned) - nb: this function is used for the input for most outward facing functions
Roles.get_player_roles(player)Gets all the roles of the given player, this will always contain the default role
Roles.get_player_highest_role(player)Gets the highest role which the player has, can be used to compeer one player to another
Roles.assign_player(player, roles[, by_player_name=][, silent=false])Gives a player the given role(s) with an option to pass a by player name used in the log
Roles.unassign_player(player, roles[, by_player_name=][, silent=false])Removes a player from the given role(s) with an option to pass a by player name used in the log
Roles.override_player_roles(roles)Overrides all player roles with the given table of roles, useful to mass set roles on game start
Roles.player_has_role(player, search_role)A test for weather a player has the given role
Roles.player_has_flag(player, flag_name)A test for weather a player has the given flag true for at least one of they roles
Roles.player_allowed(player, action)A test for weather a player has at least one role which is allowed the given action
Roles.define_role_order(order)Used to set the role order, higher in the list is better, must be called at least once in config - nb: function also re links parents due to expected position in the config file
Roles.define_flag_trigger(name, callback)Defines a new trigger for when a tag is added or removed from a player
Roles.set_default(name)Sets the default role which every player will have, this needs to be called at least once
Roles.set_root(name)Sets the root role which will always have all permissions, any server actions act from this role
Roles.new_role(name[, short_hand=name])Defines a new role and returns the prototype to allow configuration
Roles._prototype:set_allow_all([state=true])Sets the default allow state of the role, true will allow all actions
Roles._prototype:allow(actions)Sets the allow actions for this role, actions in this list will be allowed for this role
Roles._prototype:disallow(actions)Sets the disallow actions for this role, will prevent actions from being allowed regardless of inheritance
Roles._prototype:is_allowed(action)Test for if a role is allowed the given action, mostly internal see Roles.player_allowed
Roles._prototype:set_flag(name[, value=true])Sets the state of a flag for a role, flags can be used to apply effects to players
Roles._prototype:clear_flags()Clears all flags from this role, individual flags can be removed with set_flag(name,false)
Roles._prototype:has_flag(name)A test for if the role has a flag set
Roles._prototype:set_custom_tag(tag)Sets a custom player tag for the role, can be accessed by other code
Roles._prototype:set_custom_color(color)Sets a custom colour for the role, can be accessed by other code
Roles._prototype:set_permission_group(name[, use_factorio_api=false])Sets the permission group for this role, players will be moved to the group of they highest role
Roles._prototype:set_parent(role)Sets the parent for a role, any action not in allow or disallow will be looked for in its parents - nb: this is a recursive action, and changing the allows and disallows will effect all children roles
Roles._prototype:set_auto_promote_condition(callback)Sets an auto promote condition that is checked every 5 seconds, if true is returned then the player will receive the role - nb: this is one way, failing false after already gaining the role will not revoke the role
Roles._prototype:set_block_auto_promote([state=true])Sets the role to not allow players to have auto promote effect them, useful to keep people locked to a punishment
Roles._prototype:add_player(player, skip_check, skip_event)Adds a player to this role, players can have more than one role at a time, used internally see Roles.assign
Roles._prototype:remove_player(player, skip_check, skip_event)Removes a player from this role, players can have more than one role at a time, used internally see Roles.unassign
Roles._prototype:get_players([online=nil])Returns an array of all the players who have this role, can be filtered by online status
Roles._prototype:print(message)Will print a message to all players with this role
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.permission_groups -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.sudo -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Roles.debug() -
-
-
-
- -

Returns a string which contains all roles in index order displaying all data for them

-

- - - - - - Returns: -
    -
  • - (string) - the debug output string -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.print_to_roles(roles, message) -
-
-
-
- -

Prints a message to all players in the given roles, may send duplicate message however factorio blocks spam

-

- - - Parameters: - -
    - - - - - -
  • - - roles - - : - - (table) - - table a of roles which to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.print_to_roles_higher(role, message) -
-
-
-
- -

Prints a message to all players who have the given role or one which is higher (excluding default)

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.print_to_roles_lower(role, message) -
-
-
-
- -

Prints a message to all players who have the given role or one which is lower (excluding default)

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role to send the message to - -
  • - - - - - -
  • - - message - - : - - (string) - - the message to send to the players - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.get_role_by_name(name) -
-
-
-
- -

Get a role for the given name

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the role to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role with that name or nil -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.get_role_by_order(index) -
-
-
-
- -

Get a role with the given order index

-

- - - Parameters: - -
    - - - - - -
  • - - index - - : - - (number) - - the place in the order list of the role to get - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role with that index in the order list or nil -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.get_role_from_any(any) -
-
-
-
- -

Gets a role from a name,index or role object (where it is just returned) - nb: this function is used for the input for most outward facing functions

-

- - - Parameters: - -
    - - - - - -
  • - - any - - : - - (number, string or table) - - the value used to find the role - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the role that was found or nil see above -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.get_player_roles(player) -
-
-
-
- -

Gets all the roles of the given player, this will always contain the default role

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the roles of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table where the values are the roles which the player has -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.get_player_highest_role(player) -
-
-
-
- -

Gets the highest role which the player has, can be used to compeer one player to another

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the highest role of - -
  • - - -
- - - - - Returns: -
    -
  • - (the) - role with the highest order index which this player has -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.assign_player(player, roles[, by_player_name=][, silent=false]) -
-
-
-
- -

Gives a player the given role(s) with an option to pass a by player name used in the log

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be assigned the roles - -
  • - - - - - -
  • - - roles - - : - - (table) - - table a of roles that the player will be given, can be one role and can be role names - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that will be shown in the log - - (default: ) -
  • - - - - - -
  • - - silent - - : - - (boolean) - - when true there will be no game message printed - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.unassign_player(player, roles[, by_player_name=][, silent=false]) -
-
-
-
- -

Removes a player from the given role(s) with an option to pass a by player name used in the log

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will have the roles removed - -
  • - - - - - -
  • - - roles - - : - - (table) - - table a of roles to be removed from the player, can be one role and can be role names - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that will be shown in the logs - - (default: ) -
  • - - - - - -
  • - - silent - - : - - (boolean) - - when true there will be no game message printed - - (default: false) -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.override_player_roles(roles) -
-
-
-
- -

Overrides all player roles with the given table of roles, useful to mass set roles on game start

-

- - - Parameters: - -
    - - - - - -
  • - - roles - - : - - (table) - - table a which is indexed by case sensitive player names and has the value of a table of role names - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.player_has_role(player, search_role) -
-
-
-
- -

A test for weather a player has the given role

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - search_role - - : - - (string, number or table) - - a pointer to the role that is being searched for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has the role, false otherwise, nil for errors -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.player_has_flag(player, flag_name) -
-
-
-
- -

A test for weather a player has the given flag true for at least one of they roles

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - flag_name - - : - - (string) - - the name of the flag that is being looked for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has at least one role which has the flag set to true, false otherwise, nil for errors -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.player_allowed(player, action) -
-
-
-
- -

A test for weather a player has at least one role which is allowed the given action

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to test the roles of - -
  • - - - - - -
  • - - action - - : - - (string) - - the name of the action that is being tested for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player has at least one role which is allowed this action, false otherwise, nil for errors -
  • -
- - - - - - - - - -
-
-
-
- # - Roles.define_role_order(order) -
-
-
-
- -

Used to set the role order, higher in the list is better, must be called at least once in config - nb: function also re links parents due to expected position in the config file

-

- - - Parameters: - -
    - - - - - -
  • - - order - - : - - (table) - - table a which is keyed only by numbers (start 1) and values are roles in order with highest first - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.define_flag_trigger(name, callback) -
-
-
-
- -

Defines a new trigger for when a tag is added or removed from a player

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag which the roles will have - -
  • - - - - - -
  • - - callback - - : - - (function) - - the function that is called when roles are assigned - flag param - player - the player that has had they roles changed - flag param - state - the state of the flag, aka if the flag is present - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.set_default(name) -
-
-
-
- -

Sets the default role which every player will have, this needs to be called at least once

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the default role - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.set_root(name) -
-
-
-
- -

Sets the root role which will always have all permissions, any server actions act from this role

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the root role - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Roles.new_role(name[, short_hand=name]) -
-
-
-
- -

Defines a new role and returns the prototype to allow configuration

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the new role, must be unique - -
  • - - - - - -
  • - - short_hand - - : - - (string) - - the shortened version of the name - - (default: name) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - the start of the config chain for this role -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_allow_all([state=true]) -
-
-
-
- -

Sets the default allow state of the role, true will allow all actions

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - true will allow all actions - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:allow(actions) -
-
-
-
- -

Sets the allow actions for this role, actions in this list will be allowed for this role

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (table) - - indexed with numbers and is an array of action names, order has no effect - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:disallow(actions) -
-
-
-
- -

Sets the disallow actions for this role, will prevent actions from being allowed regardless of inheritance

-

- - - Parameters: - -
    - - - - - -
  • - - actions - - : - - (table) - - indexed with numbers and is an array of action names, order has no effect - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:is_allowed(action) -
-
-
-
- -

Test for if a role is allowed the given action, mostly internal see Roles.player_allowed

-

- - - Parameters: - -
    - - - - - -
  • - - action - - : - - (string) - - the name of the action to test if it is allowed - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if action is allowed, false otherwise -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_flag(name[, value=true]) -
-
-
-
- -

Sets the state of a flag for a role, flags can be used to apply effects to players

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag to set the value of - -
  • - - - - - -
  • - - value - - : - - (boolean) - - the state to set the flag to - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:clear_flags() -
-
-
-
- -

Clears all flags from this role, individual flags can be removed with set_flag(name,false)

-

- - - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:has_flag(name) -
-
-
-
- -

A test for if the role has a flag set

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the flag to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the flag is set, false otherwise -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_custom_tag(tag) -
-
-
-
- -

Sets a custom player tag for the role, can be accessed by other code

-

- - - Parameters: - -
    - - - - - -
  • - - tag - - : - - (string) - - the value that the tag will be - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_custom_color(color) -
-
-
-
- -

Sets a custom colour for the role, can be accessed by other code

-

- - - Parameters: - -
    - - - - - -
  • - - color - - : - - (table) - - ?string|table can either be and rgb colour or the name of a colour defined in the presets - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_permission_group(name[, use_factorio_api=false]) -
-
-
-
- -

Sets the permission group for this role, players will be moved to the group of they highest role

-

- - - Parameters: - -
    - - - - - -
  • - - name - - : - - (string) - - the name of the permission group to have players moved to - -
  • - - - - - -
  • - - use_factorio_api - - : - - (boolean) - - when true the custom permission group module is ignored - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_parent(role) -
-
-
-
- -

Sets the parent for a role, any action not in allow or disallow will be looked for in its parents - nb: this is a recursive action, and changing the allows and disallows will effect all children roles

-

- - - Parameters: - -
    - - - - - -
  • - - role - - : - - (string) - - the name of the role that will be the parent; has imminent effect if role is already defined - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_auto_promote_condition(callback) -
-
-
-
- -

Sets an auto promote condition that is checked every 5 seconds, if true is returned then the player will receive the role - nb: this is one way, failing false after already gaining the role will not revoke the role

-

- - - Parameters: - -
    - - - - - -
  • - - callback - - : - - (function) - - receives only one param which is player to promote, return true to promote the player - -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:set_block_auto_promote([state=true]) -
-
-
-
- -

Sets the role to not allow players to have auto promote effect them, useful to keep people locked to a punishment

-

- - - Parameters: - -
    - - - - - -
  • - - state - - : - - (boolean) - - when true the players with this role will not be auto promoted - - (default: true) -
  • - - -
- - - - - Returns: -
    -
  • - (Roles._prototype) - allows chaining -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:add_player(player, skip_check, skip_event) -
-
-
-
- -

Adds a player to this role, players can have more than one role at a time, used internally see Roles.assign

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will be given this role - -
  • - - - - - -
  • - - skip_check - - : - - (boolean) - - when true player will be taken as the player name (use when player has not yet joined) - -
  • - - - - - -
  • - - skip_event - - : - - (boolean) - - when true the event emit will be skipped, this is used internally with Roles.assign - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was added successfully -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:remove_player(player, skip_check, skip_event) -
-
-
-
- -

Removes a player from this role, players can have more than one role at a time, used internally see Roles.unassign

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player that will lose this role - -
  • - - - - - -
  • - - skip_check - - : - - (boolean) - - when true player will be taken as the player name (use when player has not yet joined) - -
  • - - - - - -
  • - - skip_event - - : - - (boolean) - - when true the event emit will be skipped, this is used internally with Roles.unassign - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if the player was removed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:get_players([online=nil]) -
-
-
-
- -

Returns an array of all the players who have this role, can be filtered by online status

-

- - - Parameters: - -
    - - - - - -
  • - - online - - : - - (boolean) - - when given will filter by this online state, nil will return all players - - (default: nil) -
  • - - -
- - - - - Returns: -
    -
  • - (table) - all the players who have this role, indexed order is meaningless -
  • -
- - - - - - - - - -
-
-
-
- # - Roles._prototype:print(message) -
-
-
-
- -

Will print a message to all players with this role

-

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - (string) - - the message that will be printed to the players - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of players who received the message -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.store.html b/docs/modules/expcore.store.html deleted file mode 100644 index 8275edad..00000000 --- a/docs/modules/expcore.store.html +++ /dev/null @@ -1,972 +0,0 @@ - - - - - - - - expcore.store module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.store module

-

Adds an easy way to store and watch for updates to a value -[[

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.global
utils.event
expcore.common
utils.token
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Store.is_registered(location)Check for if a location is registered
Store.uid_location()Returns a unique name that can be used for a store
Store.register([location][, synced][, callback])Registers a new location with an update callback which is triggered when the value updates
Store.get(location[, child][, allow_unregistered=false])Gets the value stored at a location, this location must be registered
Store.set(location[, child], value[, from_sync])Sets the value at a location, this location must be registered
Store.clear(location[, child][, from_sync])Sets the value at a location to nil, this location must be registered
Store.get_children(location)Gets all non nil children at a location, children can be added and removed during runtime - this is similar to Store.get but will always return a table even if it is empty
- - -
- - -

Dependencies

-
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.token -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Store.is_registered(location) -
-
-
-
- -

Check for if a location is registered

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - the location to test for - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if registered -
  • -
- - - - - - - - - -
-
-
-
- # - Store.uid_location() -
-
-
-
- -

Returns a unique name that can be used for a store

-

- - - - - - Returns: -
    -
  • - (string) - a unique name -
  • -
- - - - - - - - - -
-
-
-
- # - Store.register([location][, synced][, callback]) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - string a unique that points to the data, string used rather than token to allow migration - - (optional) -
  • - - - - - -
  • - - synced - - : - - (boolean) - - when true will output changes to a file so it can be synced - - (optional) -
  • - - - - - -
  • - - callback - - : - - (function) - - when given the callback will be automatically registered to the update of the value - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the location that is being used -
  • -
- - - - - - - - - -
-
-
-
- # - Store.get(location[, child][, allow_unregistered=false]) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - the location to get the data from - -
  • - - - - - -
  • - - child - - : - - (string) - - the child location if required - - (optional) -
  • - - - - - -
  • - - allow_unregistered - - : - - (boolean) - - when true no error is returned if the location is not registered - - (default: false) -
  • - - -
- - - - - Returns: -
    -
  • - (any) - the data which was stored at the location -
  • -
- - - - - - - - - -
-
-
-
- # - Store.set(location[, child], value[, from_sync]) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - the location to set the data to - -
  • - - - - - -
  • - - child - - : - - (string) - - the child location if required - - (optional) -
  • - - - - - -
  • - - value - - : - - (any) - - the new value to set at the location, value may be reverted if there is a watch callback, cant be nil - -
  • - - - - - -
  • - - from_sync - - : - - (boolean) - - set this true to avoid an output to the sync file - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if it was successful -
  • -
- - - - - - - - - -
-
-
-
- # - Store.clear(location[, child][, from_sync]) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - the location to set the data to - -
  • - - - - - -
  • - - child - - : - - (string) - - the child location if required - - (optional) -
  • - - - - - -
  • - - from_sync - - : - - (boolean) - - set this true to avoid an output to the sync file - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true if it was successful -
  • -
- - - - - - - - - -
-
-
-
- # - Store.get_children(location) -
-
-
-
- -

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

-

- - - Parameters: - -
    - - - - - -
  • - - location - - : - - (string) - - the location to get the children of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table containing all the children names -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/expcore.sudo.html b/docs/modules/expcore.sudo.html deleted file mode 100644 index a1ac274b..00000000 --- a/docs/modules/expcore.sudo.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - expcore.sudo module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

expcore.sudo module

-

An extention of task and token to allow a single require to register and run functions bypassing all permissions -[[

-

- - - - - - - - - - - - - -
- - - - - -
-
-
- - - - diff --git a/docs/modules/gui.player-list.html b/docs/modules/gui.player-list.html deleted file mode 100644 index 496ec30a..00000000 --- a/docs/modules/gui.player-list.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module gui.player-list

-

Gui left frame define for a player list

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/gui.rocket-info.html b/docs/modules/gui.rocket-info.html deleted file mode 100644 index 70702c2a..00000000 --- a/docs/modules/gui.rocket-info.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module gui.rocket-info

-

Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets

-

- - -

Fields

- - - - - -
header_area.captionRight aligned button to toggle the section
- -
-
- - -

Fields

- -
-
- - header_area.caption -
-
- Right aligned button to toggle the section - - - - - - - -
-
- - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/gui.science-info.html b/docs/modules/gui.science-info.html deleted file mode 100644 index 105102cd..00000000 --- a/docs/modules/gui.science-info.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module gui.science-info

-

Adds a science info gui that shows production usage and net for the different science packs as well as an eta

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/gui.task-list.html b/docs/modules/gui.task-list.html deleted file mode 100644 index 8af36bc8..00000000 --- a/docs/modules/gui.task-list.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Reference - - - - -
- -
- -
-
-
- - -
- - - - - - -
- -

Module gui.task-list

-

Adds a task list to the game which players can add remove and edit items on

-

- - - -
-
- - - - -
-
-
-generated by LDoc 1.4.3 -Last updated 2019-06-21 19:36:35 -
-
- - diff --git a/docs/modules/modules.addons.advanced-start.html b/docs/modules/modules.addons.advanced-start.html deleted file mode 100644 index a17f317a..00000000 --- a/docs/modules/modules.addons.advanced-start.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - - modules.addons.advanced-start module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.addons.advanced-start module

-

Adds a better method of player starting items based on production levels.

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.event
utils.game
config.advanced_start
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.advanced_start -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.addons.chat-popups.html b/docs/modules/modules.addons.chat-popups.html deleted file mode 100644 index 9caa5cfd..00000000 --- a/docs/modules/modules.addons.chat-popups.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - modules.addons.chat-popups module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.addons.chat-popups module

-

Creates flying text entities when a player sends a message in chat - also displays a ping above users who are named in the message

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
config.popup_messages
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.popup_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.addons.damage-popups.html b/docs/modules/modules.addons.damage-popups.html deleted file mode 100644 index 4a119a6f..00000000 --- a/docs/modules/modules.addons.damage-popups.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - modules.addons.damage-popups module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.addons.damage-popups module

-

Displays the amount of dmg that is done by players to entities - also shows player health when a player is attacked

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.game
utils.event
config.popup_messages
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.popup_messages -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.addons.station-auto-name.html b/docs/modules/modules.addons.station-auto-name.html deleted file mode 100644 index cb18451f..00000000 --- a/docs/modules/modules.addons.station-auto-name.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - - - modules.addons.station-auto-name module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.addons.station-auto-name module

-

LuaPlayerBuiltEntityEventFilters -Events.set_event_filter(defines.events.on_built_entity, {{filter = "name", name = "fast-inserter"}})

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
utils.event
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.control.production.html b/docs/modules/modules.control.production.html deleted file mode 100644 index 30718ab0..00000000 --- a/docs/modules/modules.control.production.html +++ /dev/null @@ -1,1281 +0,0 @@ - - - - - - - - modules.control.production module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.control.production module

-

Control Module - Production - - Common functions used to track production of items

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Production = require 'modules.control.production'
-
-    -- This will return the less precise index from the one given
-    -- this means that one_second will return one_minute or ten_hours will return fifty_hours
-    -- the other precision work like wise
-    Production.precision_up(defines.flow_precision_index.one_second)
-
-    -- The get production function is used to get production, consumion and net
-    -- it may be used for any item and with any precision level, use total for total
-    Production.get_production(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
-
-    -- The fluctuations works by compearing recent production with the average over time
-    -- again any precision may be used, apart from one_thousand_hours as there would be no valid average
-    Production.get_fluctuations(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute)
-
-    -- ETA is calculated based on what function you use but all share a similar method
-    -- for production eta it will take current production average given by the precision
-    -- and work out how many ticks it will require to make the required amount (1000 by default)
-    Production.get_production_eta(game.forces.player,'iron-plate',defines.flow_precision_index.one_minute,250000)
-
-    -- Both get_color and format_number are helper functions to help format production stats
-    -- get_color will return green,orange,red,or grey based on the active_value
-    -- the passive_value is used when active_value is 0 and can only return orange,red,or grey
-    Production.get_color(clamp,active_value,passive_value)
- - - - - - - -

Dependencies

- - - - - - - - - - - - -
resources.color_presetsProvides colors for Production.get_color
utilProvides format_number function to add surfixs
- - -

Precision

- - - - - - - - - - - - - - - - -
precision_up (precision)Gets the next lesser precision index value, eg 1 second -> 1 minute
precision_down (precision)Gets the next greater precision index value, eg 1 minute -> 1 second
precision_ticks (precision)Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks
- - -

Statistics

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_production_total (force, item_name)Returns the production data for the whole game time
get_production (force, item_name, precision)Returns the production data for the given precision game time
get_fluctuations (force, item_name, precision)Returns the current fluctuation from the average
get_production_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce a certain amount
get_consumsion_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to consume a certain amount
get_net_eta (force, item_name, precision[, required=1000])Returns the amount of ticks required to produce but not consume a certain amount
- - -

Formating

- - - - - - - - - - - - -
get_color (clamp, active_value, passive_value)Returns a color value bassed on the value that was given
format_number (value)Returns three parts used to format a number
- - -
- - -

Dependencies

-
-
-
-
- # - resources.color_presets -
-
-
-
- -

Provides colors for Production.get_color

-

- - - - - - - - - - - - - - -
-
-
-
- # - util -
-
-
-
- -

Provides format_number function to add surfixs

-

- - - - - - - - - - - - - - -
-
-

Precision

-
-
-
-
- # - precision_up (precision) -
-
-
-
- -

Gets the next lesser precision index value, eg 1 second -> 1 minute

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_down (precision) -
-
-
-
- -

Gets the next greater precision index value, eg 1 minute -> 1 second

-

- - - Parameters: - - - - - - - Returns: - - - - - - - - - - -
-
-
-
- # - precision_ticks (precision) -
-
-
-
- -

Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks

-

- - - Parameters: - - - - - - - Returns: -
    -
  • - (number) - the number of ticks in this time -
  • -
- - - - - - - - - -
-
-

Statistics

-
-
-
-
- # - get_production_total (force, item_name) -
-
-
-
- -

Returns the production data for the whole game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains total made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production (force, item_name, precision) -
-
-
-
- -

Returns the production data for the given precision game time

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_fluctuations (force, item_name, precision) -
-
-
-
- -

Returns the current fluctuation from the average

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains made, used and net -
  • -
- - - - - - - - - -
-
-
-
- # - get_production_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_consumsion_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be consumed - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to consume this ammount of items -
  • -
- - - - - - - - - -
-
-
-
- # - get_net_eta (force, item_name, precision[, required=1000]) -
-
-
-
- -

Returns the amount of ticks required to produce but not consume a certain amount

-

- - - Parameters: - -
    - - - - - -
  • - - force - - : - - (LuaForce) - - the force to get the data for - -
  • - - - - - -
  • - - item_name - - : - - (string) - - the name of the item that you want the data about - -
  • - - - - - -
  • - - precision - - : - - (defines.flow_precision_index) - - the precision that you want the data given to - -
  • - - - - - -
  • - - required - - : - - (number) - - the number of items that are required to be made but not used - - (default: 1000) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of ticks required to produce, but not use, this ammount of items -
  • -
- - - - - - - - - -
-
-

Formating

-
-
-
-
- # - get_color (clamp, active_value, passive_value) -
-
-
-
- -

Returns a color value bassed on the value that was given

-

- - - Parameters: - -
    - - - - - -
  • - - clamp - - : - - (number) - - value which seperates the different colours - -
  • - - - - - -
  • - - active_value - - : - - (number) - - first value tested, tested against clamp - -
  • - - - - - -
  • - - passive_value - - : - - (number) - - second value tested, tested against 0 - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - contains r,g,b keys -
  • -
- - - - - - - - - -
-
-
-
- # - format_number (value) -
-
-
-
- -

Returns three parts used to format a number

-

- - - Parameters: - -
    - - - - - -
  • - - value - - : - - (number) - - the value to format - -
  • - - -
- - - - - Returns: -
    -
  • - (string) - the sign for the number -
  • -
  • - (string) - the surfix for any unit used -
  • -
  • - (string) - the number formated -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.control.reports.html b/docs/modules/modules.control.reports.html deleted file mode 100644 index cbfd54ef..00000000 --- a/docs/modules/modules.control.reports.html +++ /dev/null @@ -1,1026 +0,0 @@ - - - - - - - - modules.control.reports module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.control.reports module

-

Control Module - Reports - - Adds a way to report players and store report messages.

-

- - - - - - -

Usage

-

-    -- import the module from the control modules
-    local Reports = require 'modules.control.reports'
-
-    -- This will place a report on "MrBiter" (must be a valid player) the report will have been made
-    -- by "Cooldude2606" (must be the player name) with the reason 'Liking biters too much' this can be
-    -- seen by using Reports.get_report.
-    Reports.report_player('MrBiter','Cooldude2606','Liking biters too much') -- true
-
-    -- The other get methods can be used to get all the reports on a player or to test if a player is reported.
-    Reports.get_report('MrBiter','Cooldude2606') -- 'Liking biters too much'
-
-    -- This will remove the warning on 'MrBiter' (must be a valid player) which was made by 'Cooldude2606'.
-    Reports.remove_report('MrBiter','Cooldude2606') -- true
-
-    -- This will remove all the report that have been made against 'MrBiter'. Note that the remove event will
-    -- be triggered once per report issused.
-    Reports.remove_all('MrBiter') -- true
-
- - - - - - - -

Events

- - - - - - - - - - - - -
on_player_reportedWhen a player is reported
on_report_removedWhen a report is removed from a player
- - -

Dependencies

- - - - - - - - - - - - -
utils.gameAllows getting player from any value
utils.globalAllows storing of data in global table
- - -

Get functions

- - - - - - - - - - - - - - - - - - - - -
get_reports (player)Gets a list of all reports that a player has against them
get_report (player, by_player_name)Gets a single report against a player given the name of the player who made the report
is_reported (player[, by_player_name])Checks if a player is reported, option to get if reported by a certain player
count_reports (player[, custom_count])Counts the number of reports that a player has aganist them
- - -

Set functions

- - - - - - - - - - - - - - - - -
report_player (player, by_player_name[, reason='Non given.'])Adds a report to a player, each player can only report another player once
remove_report (player, reported_by_name)Removes a report from a player
remove_all (player)Removes all reports from a player
- - -
- - -

Events

-
-
-
-
- # - on_player_reported -
-
-
-
- -

When a player is reported

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who got reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason given for the report - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_report_removed -
-
-
-
- -

When a report is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the player index of the player who has the report removed - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player who made the removed report - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who removed the report - -
  • - - -
- - - - - - - - - - - - - -
-
-

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- -

Allows getting player from any value

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- -

Allows storing of data in global table

-

- - - - - - - - - - - - - - -
-
-

Get functions

-
-
-
-
- # - get_reports (player) -
-
-
-
- -

Gets a list of all reports that a player has against them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a list of all reports, key is by player name, value is reason -
  • -
- - - - - - - - - -
-
-
-
- # - get_report (player, by_player_name) -
-
-
-
- -

Gets a single report against a player given the name of the player who made the report

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the report for - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who made the report - -
  • - - -
- - - - - Returns: -
    -
  • - (string or nil) - string is the reason that the player was reported, if the player is not reported -
  • -
- - - - - - - - - -
-
-
-
- # - is_reported (player[, by_player_name]) -
-
-
-
- -

Checks if a player is reported, option to get if reported by a certain player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to check if reported - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - when given will check if reported by this player - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - if the player has been reported -
  • -
- - - - - - - - - -
-
-
-
- # - count_reports (player[, custom_count]) -
-
-
-
- -

Counts the number of reports that a player has aganist them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the reports for - -
  • - - - - - -
  • - - custom_count - - : - - (function) - - when given this function will be used to count the reports - - (optional) -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of reports that the user has -
  • -
- - - - - - - - - -
-
-

Set functions

-
-
-
-
- # - report_player (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a report to a player, each player can only report another player once

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add the report to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player that is making the report - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being reported - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was added successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_report (player, reported_by_name) -
-
-
-
- -

Removes a report from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the report from - -
  • - - - - - -
  • - - reported_by_name - - : - - (string) - - the name of the player that made the report - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the report was removed successfully -
  • -
- - - - - - - - - -
-
-
-
- # - remove_all (player) -
-
-
-
- -

Removes all reports from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove the reports from - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - whether the reports were removed successfully -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.control.warnings.html b/docs/modules/modules.control.warnings.html deleted file mode 100644 index 022c2d8a..00000000 --- a/docs/modules/modules.control.warnings.html +++ /dev/null @@ -1,1416 +0,0 @@ - - - - - - - - modules.control.warnings module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.control.warnings module

-

Control Module - Warnings - - Adds a way to give and remove warnings to players.

-

- - - - - - -

Usage

-

-    -- This will add a warning to the player
-    Warnings.add_warning('MrBiter','Cooldude2606','Killed too many biters')
-
-    -- This will remove a warning from a player, second name is just who is doing the action
-    Warnings.remove_warning('MrBiter','Cooldude2606')
-
-    -- Script warning as similar to normal warning but are designed to have no effect for a short amount of time
-    -- this is so it can be used for greifer protection without being too agressive
-    Warnings.add_script_warning('MrBiter','Killed too many biters')
-
-    -- Both normal and script warnings can also be cleared, this will remove all warnings
-    Warnings.clear_warnings('MrBiter','Cooldude2606')
- - - - - - - -

Events

- - - - - - - - - - - - - - - - - - - - -
on_warning_addedWhen a warning is added to a player
on_warning_removedWhen a warning is removed from a player
on_script_warning_addedWhen a warning is added to a player, by the script
on_script_warning_removedWhen a warning is remnoved from a player, by the script
- - -

Dependencies

- - - - - - - - - - - - - - - - - - - - -
utils.eventAllows registering of custom events
utils.gameAllows getting player from any value
utils.globalAllows storing in the global table
config.warningsConfig file for this module
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
get_warnings (player)Gets an array of warnings that the player has, always returns a list even if emtpy
count_warnings (player)Gets the number of warnings that a player has on them
add_warning (player, by_player_name[, reason='Non given.'])Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file
remove_warning (player, by_player_name)Removes a warning from a player, always removes the earlyist warning, fifo
clear_warnings (player, by_player_name)Removes all warnings from a player, will trigger remove event for each warning
get_script_warnings (player)Gets an array of all the script warnings that a player has
count_script_warnings (player)Gets the number of script warnings that a player has on them
add_script_warning (player[, reason='Non given.'])Adds a script warning to a player, this may add a full warning if max script warnings is met
remove_script_warning (player)Removes a script warning from a player
clear_script_warnings (player)Removes all script warnings from a player, emits event for each warning removed
- - -
- - -

Events

-
-
-
-
- # - on_warning_added -
-
-
-
- -

When a warning is added to a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_warning_removed -
-
-
-
- -

When a warning is removed from a player

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_by_name - - : - - (string) - - the name of the player who gave the warning - -
  • - - - - - -
  • - - removed_by_name - - : - - (string) - - the name of the player who is removing the warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_added -
-
-
-
- -

When a warning is added to a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who recived the warning - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player was given a warning - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - on_script_warning_removed -
-
-
-
- -

When a warning is remnoved from a player, by the script

-

- - - Event Parameters: - -
    - - - - - -
  • - - player_index - - : - - (number) - - the index of the player who is having the warning removed - -
  • - - - - - -
  • - - warning_count - - : - - (number) - - the new number of warnings that the player has - -
  • - - -
- - - - - - - - - - - - - -
-
-

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- -

Allows registering of custom events

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- -

Allows getting player from any value

-

- - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- -

Allows storing in the global table

-

- - - - - - - - - - - - - - -
-
-
-
- # - config.warnings -
-
-
-
- -

Config file for this module

-

- - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - get_warnings (player) -
-
-
-
- -

Gets an array of warnings that the player has, always returns a list even if emtpy

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the warning for - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - an array of all the warnings on this player, contains tick, by_player_name and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_warnings (player) -
-
-
-
- -

Gets the number of warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the warnings for - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_warning (player, by_player_name[, reason='Non given.']) -
-
-
-
- -

Adds a warning to a player, when a warning is added a set action is done based on the number of warnings and the config file

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a warning to - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_warning (player, by_player_name) -
-
-
-
- -

Removes a warning from a player, always removes the earlyist warning, fifo

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a warning from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_warnings (player, by_player_name) -
-
-
-
- -

Removes all warnings from a player, will trigger remove event for each warning

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the warnings from - -
  • - - - - - -
  • - - by_player_name - - : - - (string) - - the name of the player who is doing the action - -
  • - - -
- - - - - Returns: -
    -
  • - (boolean) - true when warnings were cleared succesfully -
  • -
- - - - - - - - - -
-
-
-
- # - get_script_warnings (player) -
-
-
-
- -

Gets an array of all the script warnings that a player has

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to get the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (table) - a table of all the script warnings a player has, contains tick and reason -
  • -
- - - - - - - - - -
-
-
-
- # - count_script_warnings (player) -
-
-
-
- -

Gets the number of script warnings that a player has on them

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to count the script warnings of - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - add_script_warning (player[, reason='Non given.']) -
-
-
-
- -

Adds a script warning to a player, this may add a full warning if max script warnings is met

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to add a script warning to - -
  • - - - - - -
  • - - reason - - : - - (string) - - the reason that the player is being warned - - (default: 'Non given.') -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - remove_script_warning (player) -
-
-
-
- -

Removes a script warning from a player

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to remove a script warning from - -
  • - - -
- - - - - Returns: -
    -
  • - (number) - the number of script warnings that the player has -
  • -
- - - - - - - - - -
-
-
-
- # - clear_script_warnings (player) -
-
-
-
- -

Removes all script warnings from a player, emits event for each warning removed

-

- - - Parameters: - -
    - - - - - -
  • - - player - - : - - (LuaPlayer) - - the player to clear the script warnings from - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.gui.player-list.html b/docs/modules/modules.gui.player-list.html deleted file mode 100644 index 6c2f2a74..00000000 --- a/docs/modules/modules.gui.player-list.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - modules.gui.player-list module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.gui.player-list module

-

Gui left frame define for a player list

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
expcore.store
utils.game
utils.event
expcore.common
config.action_buttons
resources.color_presets
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.store -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.action_buttons -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.gui.rocket-info.html b/docs/modules/modules.gui.rocket-info.html deleted file mode 100644 index a61c019d..00000000 --- a/docs/modules/modules.gui.rocket-info.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - - - - - modules.gui.rocket-info module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.gui.rocket-info module

-

Adds a rocket infomation gui which shows general stats, milestones and build progress of rockets

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
expcore.roles
utils.event
config.rockets
expcore.common
resources.color_presets
modules.control.rockets
- - -

Fields

- - - - - - - - -
header_area.captionRight aligned button to toggle the section
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.rockets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.rockets -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Fields

-
-
-
-
- # - header_area.caption -
-
-
-
- -

Right aligned button to toggle the section

-

- - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.gui.science-info.html b/docs/modules/modules.gui.science-info.html deleted file mode 100644 index 10dd9a57..00000000 --- a/docs/modules/modules.gui.science-info.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - modules.gui.science-info module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.gui.science-info module

-

Adds a science info gui that shows production usage and net for the different science packs as well as an eta

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - -
expcore.gui
utils.event
expcore.common
config.science
modules.control.production
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.science -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.production -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/modules.gui.task-list.html b/docs/modules/modules.gui.task-list.html deleted file mode 100644 index b2d44c25..00000000 --- a/docs/modules/modules.gui.task-list.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - modules.gui.task-list module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

modules.gui.task-list module

-

Adds a task list to the game which players can add remove and edit items on

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - - - - - - - -
expcore.gui
utils.event
expcore.roles
config.tasks
expcore.common
modules.control.tasks
- - -
- - -

Dependencies

-
-
-
-
- # - expcore.gui -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.roles -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - config.tasks -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - expcore.common -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - modules.control.tasks -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/overrides.debug.html b/docs/modules/overrides.debug.html deleted file mode 100644 index c8921753..00000000 --- a/docs/modules/overrides.debug.html +++ /dev/null @@ -1,694 +0,0 @@ - - - - - - - - overrides.debug module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

overrides.debug module

-

-

- - - - - - - - - - - - - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Debug.print(message, trace_levels)Shows the given message if debug is enabled.
Debug.get_meta_value(object, key)Returns the value of the key inside the object - or 'InvalidLuaObject' if the LuaObject is invalid.
Debug.object_type(object)Returns the Lua data type or the factorio LuaObject type - or 'NoHelpLuaObject' if the LuaObject does not have a help function - or 'InvalidLuaObject' if the LuaObject is invalid.
Debug.print_position(position, message)Shows the given message if debug is on.
Debug.cheat(callback)Executes the given callback if cheating is enabled.
Debug.is_closure(func)Returns true if the function is a closure, false otherwise.
- - -
- - -

Functions

-
-
-
-
- # - Debug.print(message, trace_levels) -
-
-
-
- -

Shows the given message if debug is enabled.

-

Uses serpent to print non scalars.

- - - Parameters: - -
    - - - - - -
  • - - message - - : - - - - -
  • - - - - - -
  • - - trace_levels - - : - - - levels of stack trace to give, defaults to 1 level if nil - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Debug.get_meta_value(object, key) -
-
-
-
- -

Returns the value of the key inside the object - or 'InvalidLuaObject' if the LuaObject is invalid.

-

- or 'InvalidLuaObjectKey' if the LuaObject does not have an entry at that key

- - - Parameters: - -
-
-
- - - - diff --git a/docs/modules/overrides.table.html b/docs/modules/overrides.table.html deleted file mode 100644 index 4b355c9a..00000000 --- a/docs/modules/overrides.table.html +++ /dev/null @@ -1,2048 +0,0 @@ - - - - - - - - overrides.table module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

overrides.table module

-

Searches a table to remove a specific element without an index

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
overrides.inspect
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
remove_index(tbl, index)Removes an item from an array in O(1) time.
merge_table(t1, t2)Adds the contents of table t2 to table t1
array_insert(tbl[, start_index], values)Much faster method for inserting items into an array
table_insert(tbl[, start_index], tbl2)Much faster method for inserting keys into a table
get_key(t, e)Checks if a table contains an element
get_index(t, e)Checks if the arrayed portion of a table contains an element
contains(t, e)Checks if a table contains an element
array_contains(t, e)Checks if the arrayed portion of a table contains an element
extract_keys(tbl, ...)Extracts certain keys from a table
set(t, index, element)Adds an element into a specific index position while shuffling the rest down
get_random_dictionary_entry(t, key)Chooses a random entry from a table - because this uses math.random, it cannot be used outside of events
get_random_weighted(weighted_table, item_index, weight_index)Chooses a random entry from a weighted table - because this uses math.random, it cannot be used outside of events
clear_table(t, array)Clears all existing entries in a table
shuffle_table(t, rng)Creates a fisher-yates shuffle of a sequential number-indexed table - because this uses math.random, it cannot be used outside of events if no rng is supplied - from: http://www.sdknews.com/cross-platform/corona/tutorial-how-to-shuffle-table-items
get_values(tbl[, sorted][, as_string])Returns a copy of all of the values in the table.
get_keys(tbl[, sorted][, as_string])Returns a copy of all of the keys in the table.
alphanumsort(tbl)Returns the list is a sorted way that would be expected by people (this is by key)
keysort(tbl)Returns the list is a sorted way that would be expected by people (this is by key) (faster alternative than above)
- - -

Fields

- - - - - - - - - - - - - - - - - - - - - - - - -
inspectSimilar to serpent.block, returns a string with a pretty representation of a table.
sizeTakes a table and returns the number of entries in the table.
deep_copyCreates a deepcopy of a table.
mergeMerges multiple tables.
equalsDetermines if two tables are structurally equal.
- - -
- - -

Dependencies

-
-
-
-
- # - overrides.inspect -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - remove_index(tbl, index) -
-
-
-
- -

Removes an item from an array in O(1) time.

-

- The catch is that fast_remove doesn't guarantee to maintain the order of items in the array.

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - - arrayed table - - - - - - - -
  • - - index - - : - - - Must be >= 0. The case where index > #tbl is handled. - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - merge_table(t1, t2) -
    -
    -
    -
    - -

    Adds the contents of table t2 to table t1

    -

    - - - Parameters: - -
      - - - - - -
    • - - t1 - - : - - -
    to insert into - - - - - - - -
  • - - t2 - - : - - -
  • to insert from - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - array_insert(tbl[, start_index], values) -
    -
    -
    -
    - -

    Much faster method for inserting items into an array

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the table that will have the values added to it - -
    • - - - - - -
    • - - start_index - - : - - (number) - - the index at which values will be added, nil means end of the array - - (optional) -
    • - - - - - -
    • - - values - - : - - (table) - - the new values that will be added to the table - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - the table that was passed as the first argument -
    • -
    - - - - - - - - Usage: -
    -- Adding 1000 values into the middle of the array
    -local tbl = {}
    -local values = {}
    -for i = 1, 1000 do tbl[i] = i values[i] = i end
    -table.array_insert(tbl, 500, values) -- around 0.4ms
    - - -
    -
    -
    -
    - # - table_insert(tbl[, start_index], tbl2) -
    -
    -
    -
    - -

    Much faster method for inserting keys into a table

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the table that will have keys added to it - -
    • - - - - - -
    • - - start_index - - : - - (number) - - the index at which values will be added, nil means end of the array, numbered indexs only - - (optional) -
    • - - - - - -
    • - - tbl2 - - : - - (table) - - the table that may contain both string and numbered keys - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - the table passed as the first argument -
    • -
    - - - - - - - - Usage: -
    -- Merging two tables
    -local tbl = {}
    -local tbl2 = {}
    -for i = 1, 100 do tbl[i] = i tbl['_'..i] = i tbl2[i] = i tbl2['__'..i] = i end
    -table.table_insert(tbl, 50, tbl2)
    - - -
    -
    -
    -
    - # - get_key(t, e) -
    -
    -
    -
    - -

    Checks if a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - the index of the element or nil -
    • -
    - - - - - - - - - - -
    -
    -
    - # - get_index(t, e) -
    -
    -
    -
    - -

    Checks if the arrayed portion of a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - the index of the element or nil -
    • -
    - - - - - - - - - - -
    -
    -
    - # - contains(t, e) -
    -
    -
    -
    - -

    Checks if a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - indicating success -
    • -
    - - - - - - - - - - -
    -
    -
    - # - array_contains(t, e) -
    -
    -
    -
    - -

    Checks if the arrayed portion of a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - indicating success -
    • -
    - - - - - - - - - - -
    -
    -
    - # - extract_keys(tbl, ...) -
    -
    -
    -
    - -

    Extracts certain keys from a table

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - table the which contains the keys - -
    • - - - - - -
    • - - ... - - : - - (string) - - the names of the keys you want extracted - -
    • - - -
    - - - - - Returns: -
      -
    • - the keys in the order given -
    • -
    - - - - - - - - Usage: -
    local key_three, key_one = extract({key_one='foo', key_two='bar', key_three=true}, 'key_three', 'key_one')
    - - -
    -
    -
    -
    - # - set(t, index, element) -
    -
    -
    -
    - -

    Adds an element into a specific index position while shuffling the rest down

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to add into - - - - - - - -
  • - - index - - : - - - the position in the table to add to - -
  • - - - - - -
  • - - element - - : - - - to add to the table - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - get_random_dictionary_entry(t, key) -
    -
    -
    -
    - -

    Chooses a random entry from a table - because this uses math.random, it cannot be used outside of events

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - key - - : - - - to indicate whether to return the key or value - -
  • - - - - - - - - Returns: -
      -
    • - a random element of table t -
    • -
    - - - - - - - - - - -
    -
    -
    - # - get_random_weighted(weighted_table, item_index, weight_index) -
    -
    -
    -
    - -

    Chooses a random entry from a weighted table - because this uses math.random, it cannot be used outside of events

    -

    - - - Parameters: - -
      - - - - - -
    • - - weighted_table - - : - - -
    of tables with items and their weights - - - - - - - -
  • - - item_index - - : - - - of the index of items, defaults to 1 - -
  • - - - - - -
  • - - weight_index - - : - - - of the index of the weights, defaults to 2 - -
  • - - - - - - - - Returns: -
      -
    • - table element -
    • -
    - - - - - - - - - - -
    -
    -
    - # - clear_table(t, array) -
    -
    -
    -
    - -

    Clears all existing entries in a table

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to clear - - - - - - - -
  • - - array - - : - - - to indicate whether the table is an array or not - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - shuffle_table(t, rng) -
    -
    -
    -
    - -

    Creates a fisher-yates shuffle of a sequential number-indexed table - because this uses math.random, it cannot be used outside of events if no rng is supplied - from: http://www.sdknews.com/cross-platform/corona/tutorial-how-to-shuffle-table-items

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to shuffle - - - - - - - -
  • - - rng - - : - - - to provide random numbers - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - get_values(tbl[, sorted][, as_string]) -
    -
    -
    -
    - -

    Returns a copy of all of the values in the table.

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the to copy the keys from, or an empty table if tbl is nil - -
    • - - - - - -
    • - - sorted - - : - - (boolean) - - whether to sort the keys (slower) or keep the random order from pairs() - - (optional) -
    • - - - - - -
    • - - as_string - - : - - (boolean) - - whether to try and parse the values as strings, or leave them as their existing type - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (array) - an array with a copy of all the values in the table -
    • -
    - - - - - - - - - -
    -
    -
    -
    - # - get_keys(tbl[, sorted][, as_string]) -
    -
    -
    -
    - -

    Returns a copy of all of the keys in the table.

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the to copy the keys from, or an empty table if tbl is nil - -
    • - - - - - -
    • - - sorted - - : - - (boolean) - - whether to sort the keys (slower) or keep the random order from pairs() - - (optional) -
    • - - - - - -
    • - - as_string - - : - - (boolean) - - whether to try and parse the keys as strings, or leave them as their existing type - - (optional) -
    • - - -
    - - - - - Returns: -
      -
    • - (array) - an array with a copy of all the keys in the table -
    • -
    - - - - - - - - - -
    -
    -
    -
    - # - alphanumsort(tbl) -
    -
    -
    -
    - -

    Returns the list is a sorted way that would be expected by people (this is by key)

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the table to be sorted - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - the sorted table -
    • -
    - - - - - - - - - -
    -
    -
    -
    - # - keysort(tbl) -
    -
    -
    -
    - -

    Returns the list is a sorted way that would be expected by people (this is by key) (faster alternative than above)

    -

    - - - Parameters: - -
      - - - - - -
    • - - tbl - - : - - (table) - - the table to be sorted - -
    • - - -
    - - - - - Returns: -
      -
    • - (table) - the sorted table -
    • -
    - - - - - - - - - -
    - -

    Fields

    -
    -
    -
    -
    - # - inspect -
    -
    -
    -
    - -

    Similar to serpent.block, returns a string with a pretty representation of a table.

    -

    - Notice: This method is not appropriate for saving/restoring tables. It is meant to be used by the programmer mainly while debugging a program. - depth sets the maximum depth that will be printed out. When the max depth is reached, inspect will stop parsing tables and just return {...} - process is a function which allow altering the passed object before transforming it into a string. - A typical way to use it would be to remove certain values so that they don't appear at all. - return the prettied table

    - - - -
      - - - - - -
    • - - table - - : - - -
    the table to serialize - - - - - - - -
  • - - options - - : - - -
  • options are depth, newline, indent, process - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - size -
    -
    -
    -
    - -

    Takes a table and returns the number of entries in the table.

    -

    (Slower than #table, faster than iterating via pairs)

    - - - - - - - - - - - - - - -
    -
    -
    -
    - # - deep_copy -
    -
    -
    -
    - -

    Creates a deepcopy of a table.

    -

    Metatables and LuaObjects inside the table are shallow copies. - Shallow copies meaning it copies the reference to the object instead of the object itself.

    - - - -
      - - - - - -
    • - - object - - : - - -
    the object to copy - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - merge -
    -
    -
    -
    - -

    Merges multiple tables.

    -

    Tables later in the list will overwrite entries from tables earlier in the list. - Ex. merge({{1, 2, 3}, {[2] = 0}, {[3] = 0}}) will return {1, 0, 0}

    - - - -
      - - - - - -
    • - - tables - - : - - -
    takes a table of tables to merge - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - equals -
    -
    -
    -
    - -

    Determines if two tables are structurally equal.

    -

    - Notice: tables that are LuaObjects or contain LuaObjects won't be compared correctly, use == operator for LuaObjects

    - - - -
      - - - - - -
    • - - tbl1 - - : - - -
    - - - - - - - -
  • - - tbl2 - - : - - -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/modules/tesrt.html b/docs/modules/tesrt.html deleted file mode 100644 index 52c8b244..00000000 --- a/docs/modules/tesrt.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - tesrt module - - - - - - - -
    -
    - - - - - - - -
    - - - - - - - - -

    tesrt module

    -

    Core Module - ExpStyle

    -

    - - - - - - - - - - - -
    - -

    Dependencies

    - - - - - - - - - - -
    expcore.gui
    gui.concept.flow
    - - -

    Elements

    - - - - - - - - -
    alignmentA flow which can be used to align text and other elements
    - - -
    - - -

    Dependencies

    -
    -
    -
    -
    - # - expcore.gui -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    - # - gui.concept.flow -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -

    Elements

    -
    -
    -
    -
    - # - alignment -
    -
    -
    -
    - -

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

    -

    - - - - - - - - - - See also: - - - - - Usage: -
    -- Concept Structure
    --- Root
    ---> [alignment] - the alignment area
    -Gui.new_concept('alignment')
    -:set_horizontal_align('center')
    - - -
    -
    - - - -
-
-
- - - - diff --git a/docs/modules/utils.alien_evolution_progress.html b/docs/modules/utils.alien_evolution_progress.html deleted file mode 100644 index fdb538e2..00000000 --- a/docs/modules/utils.alien_evolution_progress.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - - - utils.alien_evolution_progress module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.alien_evolution_progress module

-

info - Original (javascript) version: https://hastebin.com/udakacavap.js - Can be tested against: https://wiki.factorio.com/Enemies#Spawn_chances_by_evolution_factor

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - - - - -
utils.global
utils.debug
utils.table
- - -

Functions

- - - - - - - - -
AlienEvolutionProgress.create_spawner_request(total_aliens)Creates the spawner_request structure required for AlienEvolutionProgress.get_aliens for all -available spawner's.
- - -
- - -

Dependencies

-
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.debug -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.table -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - AlienEvolutionProgress.create_spawner_request(total_aliens) -
-
-
-
- -

Creates the spawner_request structure required for AlienEvolutionProgress.get_aliens for all -available spawner's.

-

If dividing the total spawner's by the total aliens causes a fraction, the -fraction will decide a chance to spawn. 1 alien for 2 spawner's will have 50% on both.

- - - Parameters: - -
    - - - - - -
  • - - total_aliens - - : - - - table - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/utils.core.html b/docs/modules/utils.core.html deleted file mode 100644 index c94a85ca..00000000 --- a/docs/modules/utils.core.html +++ /dev/null @@ -1,1172 +0,0 @@ - - - - - - - - utils.core module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.core module

-

This file contains core utilities used by the redmew scenario.

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.game
resources.color_presets
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Module.distance(pos1, pos2)Measures distance between pos1 and pos2
Module.print_except(msg, player, color)Takes msg and prints it to all players except provided player
Module.print_admins(msg, source)Prints a message to all online admins
Module.get_actor()Returns a valid string with the name of the actor of a command.
Module.format_time(ticks)Takes a time in ticks and returns a string with the time in format "x hour(s) x minute(s)"
Module.cant_run(name)Prints a message letting the player know they cannot run a command
Module.log_command(actor, command, parameters)Logs the use of a command and its user
Module.verify_mult_types(arg, arg_types)Asserts the argument is one of type arg_types
Module.random_RGB()Returns a random RGB color as a table
Module.set_and_return(tbl, key, value)Sets a table element to value while also returning value.
- - -

Fields

- - - - - - - - - - - - - - - - -
Module.move_positionMoves a position according to the parameters given - Notice: only accepts cardinal directions as direction
Module.opposite_directionTakes a direction and gives you the opposite
Module.is_module_availableTakes the string of a module and returns whether is it available or not
- - -
- - -

Dependencies

-
-
-
-
- # - utils.game -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - resources.color_presets -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Module.distance(pos1, pos2) -
-
-
-
- -

Measures distance between pos1 and pos2

-

- - - Parameters: - -
    - - - - - -
  • - - pos1 - - - - - -
  • - - - - - -
  • - - pos2 - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Module.print_except(msg, player, color) -
-
-
-
- -

Takes msg and prints it to all players except provided player

-

- - - Parameters: - -
-
- - - - diff --git a/docs/modules/utils.event.html b/docs/modules/utils.event.html deleted file mode 100644 index 99141aad..00000000 --- a/docs/modules/utils.event.html +++ /dev/null @@ -1,1332 +0,0 @@ - - - - - - - - utils.event module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.event module

-

This Module allows for registering multiple handlers to the same event, overcoming the limitation of script.register.

-

-

** Event.add(event_name, handler) ** -

Handlers added with Event.add must be added at the control stage or in Event.on_init or Event.on_load. - Remember that for each player, on_init or on_load is run, never both. So if you can't add the handler in the - control stage add the handler in both on_init and on_load. - Handlers added with Event.add cannot be removed. - For handlers that need to be removed or added at runtime use Event.add_removable.

- - - - - - -

Usage

-

- local Event = require 'utils.event' --- @dep utils.event
- Event.add(
-     defines.events.on_built_entity,
-     function(event)
-         game.print(serpent.block(event)) -- prints the content of the event table to console.
-     end
- )
-
- ** Event.add_removable(event_name, token) **
-
- For conditional event handlers. Event.add_removable can be safely called at runtime without desync risk.
- Only use this if you need to add the handler at runtime or need to remove the handler, otherwise use Event.add
-
- Event.add_removable can be safely used at the control stage or in Event.on_init. If used in on_init you don't
- need to also add in on_load (unlike Event.add).
- Event.add_removable cannot be called in on_load, doing so will crash the game on loading.
- Token is used because it's a desync risk to store closures inside the global table.
-

- local Token = require 'utils.token' --- @dep utils.token
- local Event = require 'utils.event' --- @dep utils.event
-
- Token.register must not be called inside an event handler.
- local handler =
-     Token.register(
-     function(event)
-         game.print(serpent.block(event)) -- prints the content of the event table to console.
-     end
- )
-
- The below code would typically be inside another event or a custom command.
- Event.add_removable(defines.events.on_built_entity, handler)
-
- When you no longer need the handler.
- Event.remove_removable(defines.events.on_built_entity, handler)
-
- It's not an error to register the same token multiple times to the same event, however when
- removing only the first occurrence is removed.
-
- ** Event.add_removable_function(event_name, func) **
-
- Only use this function if you can't use Event.add_removable. i.e you are registering the handler at the console.
- The same restrictions that apply to Event.add_removable also apply to Event.add_removable_function.
- func cannot be a closure in this case, as there is no safe way to store closures in the global table.
- A closure is a function that uses a local variable not defined in the function.
-

- local Event = require 'utils.event' --- @dep utils.event
-
- If you want to remove the handler you will need to keep a reference to it.
- global.handler = function(event)
-     game.print(serpent.block(event)) -- prints the content of the event table to console.
- end
-
- The below code would typically be used at the command console.
- Event.add_removable_function(defines.events.on_built_entity, global.handler)
-
- When you no longer need the handler.
- Event.remove_removable_function(defines.events.on_built_entity, global.handler)
-
- ** Other Events **
-
- Use Event.on_init(handler) for script.on_init(handler)
- Use Event.on_load(handler) for script.on_load(handler)
-
- Use Event.on_nth_tick(tick, handler) for script.on_nth_tick(tick, handler)
- Favour this event over Event.add(defines.events.on_tick, handler)
- There are also Event.add_removable_nth_tick(tick, token) and Event.add_removable_nth_tick_function(tick, func)
- That work the same as above.
-
- ** Custom Scenario Events **
-
- local Event = require 'utils.event' --- @dep utils.event
-
- local event_id = script.generate_event_name()
-
- Event.add(
-     event_id,
-     function(event)
-         game.print(serpent.block(event)) -- prints the content of the event table to console.
-     end
- )
-
- The table contains extra information that you want to pass to the handler.
- script.raise_event(event_id, {extra = 'data'})
- - - - - - - -

Dependencies

- - - - - - - - - - - - - - - - -
utils.event_core
utils.global
utils.token
overrides.debug
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event.add(event_name, handler)Register a handler for the event_name event.
Event.on_init(handler)Register a handler for the script.on_init event.
Event.on_load(handler)Register a handler for the script.on_load event.
Event.on_nth_tick(tick, handler)Register a handler for the nth_tick event.
Event.add_removable(event_name, token)Register a token handler that can be safely added and removed at runtime.
Event.remove_removable(event_name, token)Removes a token handler for the given event_name.
Event.add_removable_function(event_name, func)Register a handler that can be safely added and removed at runtime.
Event.remove_removable_function(event_name, func)Removes a handler for the given event_name.
Event.add_removable_nth_tick(tick, token)Register a token handler for the nth tick that can be safely added and removed at runtime.
Event.remove_removable_nth_tick(tick, token)Removes a token handler for the nth tick.
Event.add_removable_nth_tick_function(tick, func)Register a handler for the nth tick that can be safely added and removed at runtime.
Event.remove_removable_nth_tick_function(tick, func)Removes a handler for the nth tick.
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event_core -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.token -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - overrides.debug -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Event.add(event_name, handler) -
-
-
-
- -

Register a handler for the event_name event.

-

- This function must be called in the control stage or in Event.on_init or Event.on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - - - -
  • - - - - - -
  • - - handler - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.on_init(handler) -
-
-
-
- -

Register a handler for the script.on_init event.

-

- This function must be called in the control stage or in Event.on_init or Event.on_load - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - handler - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.on_load(handler) -
-
-
-
- -

Register a handler for the script.on_load event.

-

- This function must be called in the control stage or in Event.on_init or Event.on_load - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - handler - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.on_nth_tick(tick, handler) -
-
-
-
- -

Register a handler for the nth_tick event.

-

- This function must be called in the control stage or in Event.on_init or Event.on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - tick - - : - - - The handler will be called every nth tick - -
  • - - - - - -
  • - - handler - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.add_removable(event_name, token) -
-
-
-
- -

Register a token handler that can be safely added and removed at runtime.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - - - -
  • - - - - - -
  • - - token - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.remove_removable(event_name, token) -
-
-
-
- -

Removes a token handler for the given event_name.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - - - -
  • - - - - - -
  • - - token - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.add_removable_function(event_name, func) -
-
-
-
- -

Register a handler that can be safely added and removed at runtime.

-

- The handler must not be a closure, as that is a desync risk. - Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - - - -
  • - - - - - -
  • - - func - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.remove_removable_function(event_name, func) -
-
-
-
- -

Removes a handler for the given event_name.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - event_name - - : - - - - -
  • - - - - - -
  • - - func - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.add_removable_nth_tick(tick, token) -
-
-
-
- -

Register a token handler for the nth tick that can be safely added and removed at runtime.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - tick - - : - - - - -
  • - - - - - -
  • - - token - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.remove_removable_nth_tick(tick, token) -
-
-
-
- -

Removes a token handler for the nth tick.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - tick - - : - - - - -
  • - - - - - -
  • - - token - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.add_removable_nth_tick_function(tick, func) -
-
-
-
- -

Register a handler for the nth tick that can be safely added and removed at runtime.

-

- The handler must not be a closure, as that is a desync risk. - Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - tick - - : - - - - -
  • - - - - - -
  • - - func - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Event.remove_removable_nth_tick_function(tick, func) -
-
-
-
- -

Removes a handler for the nth tick.

-

- Do NOT call this method during on_load. - See documentation at top of file for details on using events.

- - - Parameters: - -
    - - - - - -
  • - - tick - - : - - - - -
  • - - - - - -
  • - - func - - : - - - - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/utils.event_core.html b/docs/modules/utils.event_core.html deleted file mode 100644 index 1bc275c7..00000000 --- a/docs/modules/utils.event_core.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - - - utils.event_core module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.event_core module

-

Do not use this function, use Event.add instead as it has safety checks.

-

- - - - - - - - - - - - - -

Functions

- - - - - - - - - - - - - - - - -
Public.on_init(handler)Do not use this function, use Event.on_init instead as it has safety checks.
Public.on_load(handler)Do not use this function, use Event.on_load instead as it has safety checks.
Public.on_nth_tick(tick, handler)Do not use this function, use Event.on_nth_tick instead as it has safety checks.
- - -
- - -

Functions

-
-
-
-
- # - Public.on_init(handler) -
-
-
-
- -

Do not use this function, use Event.on_init instead as it has safety checks.

-

- - - Parameters: - -
    - - - - - -
  • - - handler - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Public.on_load(handler) -
-
-
-
- -

Do not use this function, use Event.on_load instead as it has safety checks.

-

- - - Parameters: - -
    - - - - - -
  • - - handler - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
-
-
- # - Public.on_nth_tick(tick, handler) -
-
-
-
- -

Do not use this function, use Event.on_nth_tick instead as it has safety checks.

-

- - - Parameters: - -
    - - - - - -
  • - - tick - - - - - -
  • - - - - - -
  • - - handler - - - - - -
  • - - -
- - - - - - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/utils.math.html b/docs/modules/utils.math.html deleted file mode 100644 index 24562934..00000000 --- a/docs/modules/utils.math.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - utils.math module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.math module

-

Takes two points and calculates the slope of a line

-

- - - - - - - - - - - - - -

Functions

- - - - - - - - -
calculate_y_intercept(x, y, slope)Calculates the y-intercept of a line
- - -
- - -

Functions

-
-
-
-
- # - calculate_y_intercept(x, y, slope) -
-
-
-
- -

Calculates the y-intercept of a line

-

- - - Parameters: - -
    - - - - - -
  • - - x - - : - - - number - coordinates of point on line - -
  • - - - - - -
  • - - y - - : - - - number - coordinates of point on line - -
  • - - - - - -
  • - - slope - - : - - - number - the slope of a line - -
  • - - -
- - - - - Returns: -
    -
  • - number - the y-intercept of a line -
  • -
- - - - - - - - - -
-
- - - -
-
-
- - - - diff --git a/docs/modules/utils.recipe_locker.html b/docs/modules/utils.recipe_locker.html deleted file mode 100644 index 11b985c3..00000000 --- a/docs/modules/utils.recipe_locker.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - utils.recipe_locker module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.recipe_locker module

-

A module to prevent recipes from being unlocked by research.

-

Accessed via the public functions.

- - - - - - - - - - - - - -

Dependencies

- - - - - - - - - - -
utils.event
utils.global
- - -

Functions

- - - - - - - - - - - - -
Public.lock_recipes(tbl)Locks recipes, preventing them from being enabled by research.
Public.unlock_recipes(tbl)Unlocks recipes, allowing them to be enabled by research.
- - -
- - -

Dependencies

-
-
-
-
- # - utils.event -
-
-
-
- - - - - - - - - - - - - - - -
-
-
-
- # - utils.global -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - Public.lock_recipes(tbl) -
-
-
-
- -

Locks recipes, preventing them from being enabled by research.

-

- Does not check if they should be enabled/disabled by existing research.

- - - Parameters: - -
-
-
- - - - diff --git a/docs/modules/utils.table.html b/docs/modules/utils.table.html deleted file mode 100644 index f5c0e283..00000000 --- a/docs/modules/utils.table.html +++ /dev/null @@ -1,1426 +0,0 @@ - - - - - - - - utils.table module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.table module

-

Searches a table to remove a specific element without an index

-

- - - - - - - - - - - - - -

Dependencies

- - - - - - - -
utils.inspect
- - -

Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fast_remove(tbl, index)Removes an item from an array in O(1) time.
add_all(t1, t2)Adds the contents of table t2 to table t1
index_of(t, e)Checks if a table contains an element
index_of_in_array(t, e)Checks if the arrayed portion of a table contains an element
contains(t, e)Checks if a table contains an element
array_contains(t, e)Checks if the arrayed portion of a table contains an element
set(t, index, element)Adds an element into a specific index position while shuffling the rest down
get_random_dictionary_entry(t, key)Chooses a random entry from a table - because this uses math.random, it cannot be used outside of events
get_random_weighted(weighted_table, item_index, weight_index)Chooses a random entry from a weighted table - because this uses math.random, it cannot be used outside of events
shuffle_table(t, rng)Creates a fisher-yates shuffle of a sequential number-indexed table - because this uses math.random, it cannot be used outside of events if no rng is supplied - from: http://www.sdknews.com/cross-platform/corona/tutorial-how-to-shuffle-table-items
clear_table(t, array)Clears all existing entries in a table
- - -

Fields

- - - - - - - - - - - - - - - - - - - - - - - - -
inspectSimilar to serpent.block, returns a string with a pretty representation of a table.
sizeTakes a table and returns the number of entries in the table.
deep_copyCreates a deepcopy of a table.
mergeMerges multiple tables.
equalsDetermines if two tables are structurally equal.
- - -
- - -

Dependencies

-
-
-
-
- # - utils.inspect -
-
-
-
- - - - - - - - - - - - - - - -
-
-

Functions

-
-
-
-
- # - fast_remove(tbl, index) -
-
-
-
- -

Removes an item from an array in O(1) time.

-

- The catch is that fast_remove doesn't guarantee to maintain the order of items in the array.

- - - Parameters: - -
    - - - - - -
  • - - tbl - - : - - - arrayed table - - - - - - - -
  • - - index - - : - - - Must be >= 0. The case where index > #tbl is handled. - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - add_all(t1, t2) -
    -
    -
    -
    - -

    Adds the contents of table t2 to table t1

    -

    - - - Parameters: - -
      - - - - - -
    • - - t1 - - : - - -
    to insert into - - - - - - - -
  • - - t2 - - : - - -
  • to insert from - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - index_of(t, e) -
    -
    -
    -
    - -

    Checks if a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - the index of the element or nil -
    • -
    - - - - - - - - - - -
    -
    -
    - # - index_of_in_array(t, e) -
    -
    -
    -
    - -

    Checks if the arrayed portion of a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - the index of the element or nil -
    • -
    - - - - - - - - - - -
    -
    -
    - # - contains(t, e) -
    -
    -
    -
    - -

    Checks if a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - indicating success -
    • -
    - - - - - - - - - - -
    -
    -
    - # - array_contains(t, e) -
    -
    -
    -
    - -

    Checks if the arrayed portion of a table contains an element

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - e - - : - - - table element - -
  • - - - - - - - - Returns: -
      -
    • - indicating success -
    • -
    - - - - - - - - - - -
    -
    -
    - # - set(t, index, element) -
    -
    -
    -
    - -

    Adds an element into a specific index position while shuffling the rest down

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to add into - - - - - - - -
  • - - index - - : - - - the position in the table to add to - -
  • - - - - - -
  • - - element - - : - - - to add to the table - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - get_random_dictionary_entry(t, key) -
    -
    -
    -
    - -

    Chooses a random entry from a table - because this uses math.random, it cannot be used outside of events

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    - - - - - - - -
  • - - key - - : - - - to indicate whether to return the key or value - -
  • - - - - - - - - Returns: -
      -
    • - a random element of table t -
    • -
    - - - - - - - - - - -
    -
    -
    - # - get_random_weighted(weighted_table, item_index, weight_index) -
    -
    -
    -
    - -

    Chooses a random entry from a weighted table - because this uses math.random, it cannot be used outside of events

    -

    - - - Parameters: - -
      - - - - - -
    • - - weighted_table - - : - - -
    of tables with items and their weights - - - - - - - -
  • - - item_index - - : - - - of the index of items, defaults to 1 - -
  • - - - - - -
  • - - weight_index - - : - - - of the index of the weights, defaults to 2 - -
  • - - - - - - - - Returns: -
      -
    • - table element -
    • -
    - - - - - - - - - - -
    -
    -
    - # - shuffle_table(t, rng) -
    -
    -
    -
    - -

    Creates a fisher-yates shuffle of a sequential number-indexed table - because this uses math.random, it cannot be used outside of events if no rng is supplied - from: http://www.sdknews.com/cross-platform/corona/tutorial-how-to-shuffle-table-items

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to shuffle - - - - - - - -
  • - - rng - - : - - - to provide random numbers - -
  • - - - - - - - - - - - - - - - - - -
    -
    -
    - # - clear_table(t, array) -
    -
    -
    -
    - -

    Clears all existing entries in a table

    -

    - - - Parameters: - -
      - - - - - -
    • - - t - - : - - -
    to clear - - - - - - - -
  • - - array - - : - - - to indicate whether the table is an array or not - -
  • - - - - - - - - - - - - - - - - - - -

    Fields

    -
    -
    -
    -
    - # - inspect -
    -
    -
    -
    - -

    Similar to serpent.block, returns a string with a pretty representation of a table.

    -

    - Notice: This method is not appropriate for saving/restoring tables. It is meant to be used by the programmer mainly while debugging a program. - depth sets the maximum depth that will be printed out. When the max depth is reached, inspect will stop parsing tables and just return {...} - process is a function which allow altering the passed object before transforming it into a string. - A typical way to use it would be to remove certain values so that they don't appear at all. - return the prettied table

    - - - -
      - - - - - -
    • - - table - - : - - -
    the table to serialize - - - - - - - -
  • - - options - - : - - -
  • options are depth, newline, indent, process - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - size -
    -
    -
    -
    - -

    Takes a table and returns the number of entries in the table.

    -

    (Slower than #table, faster than iterating via pairs)

    - - - - - - - - - - - - - - -
    -
    -
    -
    - # - deep_copy -
    -
    -
    -
    - -

    Creates a deepcopy of a table.

    -

    Metatables and LuaObjects inside the table are shallow copies. - Shallow copies meaning it copies the reference to the object instead of the object itself.

    - - - -
      - - - - - -
    • - - object - - : - - -
    the object to copy - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - merge -
    -
    -
    -
    - -

    Merges multiple tables.

    -

    Tables later in the list will overwrite entries from tables earlier in the list. - Ex. merge({{1, 2, 3}, {[2] = 0}, {[3] = 0}}) will return {1, 0, 0}

    - - - -
      - - - - - -
    • - - tables - - : - - -
    takes a table of tables to merge - - - - - - - - - - - - - - - - - - - -
    -
    -
    - # - equals -
    -
    -
    -
    - -

    Determines if two tables are structurally equal.

    -

    - Notice: tables that are LuaObjects or contain LuaObjects won't be compared correctly, use == operator for LuaObjects

    - - - -
      - - - - - -
    • - - tbl1 - - : - - -
    - - - - - - - -
  • - - tbl2 - - : - - -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/modules/utils.task.html b/docs/modules/utils.task.html deleted file mode 100644 index 104ce3a5..00000000 --- a/docs/modules/utils.task.html +++ /dev/null @@ -1,691 +0,0 @@ - - - - - - - - utils.task module - - - - - - - -
    -
    - - - - - - - -
    - - - - - - - - -

    utils.task module

    -

    Threading simulation module - Task.sleep()

    -

    - github: https://github.com/Refactorio/RedMew - ======================================================= --

    - - - -
      -
    • Author: Valansch and Grilledham
    • -
    - - - - - - - - -
    - -

    Dependencies

    - - - - - - - - - - - - - - - - -
    utils.queue
    utils.priority_queue
    utils.event
    utils.token
    - - -

    Functions

    - - - - - - - - - - - - - - - - -
    Task.set_timeout_in_ticks(ticks, func_token, params)Allows you to set a timer (in ticks) after which the tokened function will be run with params given as an argument - Cannot be called before init
    Task.set_timeout(sec, func_token, params)Allows you to set a timer (in seconds) after which the tokened function will be run with params given as an argument - Cannot be called before init
    Task.queue_task(func_token, params, weight)Queueing allows you to split up heavy tasks which don't need to be completed in the same tick.
    - - -
    - - -

    Dependencies

    -
    -
    -
    -
    - # - utils.queue -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    - # - utils.priority_queue -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    - # - utils.event -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -
    -
    - # - utils.token -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    -
    -

    Functions

    -
    -
    -
    -
    - # - Task.set_timeout_in_ticks(ticks, func_token, params) -
    -
    -
    -
    - -

    Allows you to set a timer (in ticks) after which the tokened function will be run with params given as an argument - Cannot be called before init

    -

    - - - Parameters: - -
      - - - - - -
    • - - ticks - - : - - - - -
    • - - - - - -
    • - - func_token - - : - - - a token for a function store via the token system - -
    • - - - - - -
    • - - params - - : - - - the argument to send to the tokened function - -
    • - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    - # - Task.set_timeout(sec, func_token, params) -
    -
    -
    -
    - -

    Allows you to set a timer (in seconds) after which the tokened function will be run with params given as an argument - Cannot be called before init

    -

    - - - Parameters: - -
      - - - - - -
    • - - sec - - : - - - - -
    • - - - - - -
    • - - func_token - - : - - - a token for a function store via the token system - -
    • - - - - - -
    • - - params - - : - - - the argument to send to the tokened function - -
    • - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    - # - Task.queue_task(func_token, params, weight) -
    -
    -
    -
    - -

    Queueing allows you to split up heavy tasks which don't need to be completed in the same tick.

    -

    - Queued tasks are generally run 1 per tick. If the queue backs up, more tasks will be processed per tick. - Ex. if the task is expected to repeat multiple times (ie. the function returns true and loops several ticks)

    - - - Parameters: - -
      - - - - - -
    • - - func_token - - : - - - a token for a function stored via the token system - If this function returns `true` it will run again the next tick, delaying other queued tasks (see weight) - -
    • - - - - - -
    • - - params - - : - - - the argument to send to the tokened function - -
    • - - - - - -
    • - - weight - - : - - - (defaults to 1) weight is the number of ticks a task is expected to take. - -
    • - - -
    - - - - - - - - - - - - - -
    -
    - - - -
-
-
- - - - diff --git a/docs/modules/utils.timestamp.html b/docs/modules/utils.timestamp.html deleted file mode 100644 index ffcfd375..00000000 --- a/docs/modules/utils.timestamp.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - utils.timestamp module - - - - - - - -
-
- - - - - - - -
- - - - - - - - -

utils.timestamp module

-

source https://github.com/daurnimator/luatz/blob/master/luatz/timetable.lua - edited down to just what is needed.

-

- - - - - - - - - - - - - -

Functions

- - - - - - - - - - - - - - - - -
Public.to_timetable(seconds)Converts unix epoch timestamp into table {year: number, month: number, day: number, hour: number, min: number, sec: number}
Public.from_timetable(timetable)Converts timetable into unix epoch timestamp
Public.to_string(seconds)Converts unix epoch timestamp into human readable string.
- - -
- - -

Functions

-
-
-
-
- # - Public.to_timetable(seconds) -
-
-
-
- -

Converts unix epoch timestamp into table {year: number, month: number, day: number, hour: number, min: number, sec: number}

-

- - - Parameters: - -
    - - - - - -
  • - - seconds - - : - - - unix epoch timestamp - -
  • - - -
- - - - - Returns: -
    -
  • - {year: number, month: number, day: number, hour: number, min: number, sec: number} -
  • -
- - - - - - - - - -
-
-
-
- # - Public.from_timetable(timetable) -
-
-
-
- -

Converts timetable into unix epoch timestamp

-

- - - Parameters: - -
    - - - - - -
  • - - timetable - - : - - - {year: number, month: number, day: number, hour: number, min: number, sec: number} - - - - - - - - - - Returns: -
      -
    • - number -
    • -
    - - - - - - - - - - -
    -
    -
    - # - Public.to_string(seconds) -
    -
    -
    -
    - -

    Converts unix epoch timestamp into human readable string.

    -

    - - - Parameters: - -
      - - - - - -
    • - - seconds - - : - - - unix epoch timestamp - -
    • - - -
    - - - - - Returns: -
      -
    • - string -
    • -
    - - - - - - - - - -
    - - - - - - - - - - - diff --git a/docs/topics/LICENSE.html b/docs/topics/LICENSE.html deleted file mode 100644 index 7b74e986..00000000 --- a/docs/topics/LICENSE.html +++ /dev/null @@ -1,829 +0,0 @@ - - - - - - - - LICENSE topic - - - - - - - -
    -
    - - - - - - - -
    - - - - - - - - -

    LICENSE topic

    -

    -

    - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 -

    Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. -

    Preamble -

    The GNU General Public License is a free, copyleft license for -software and other kinds of works. -

    The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. -

    When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. -

    To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. -

    For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. -

    Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. -

    For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. -

    Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. -

    Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. -

    The precise terms and conditions for copying, distribution and -modification follow. -

    TERMS AND CONDITIONS -

    0. Definitions. -

    "This License" refers to version 3 of the GNU General Public License. -

    "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. -

    "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. -

    To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. -

    A "covered work" means either the unmodified Program or a work based -on the Program. -

    To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. -

    To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. -

    An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. -

    1. Source Code. -

    The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. -

    A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. -

    The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. -

    The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. -

    The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. -

    The Corresponding Source for a work in source code form is that -same work. -

    2. Basic Permissions. -

    All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. -

    You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. -

    Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. -

    3. Protecting Users' Legal Rights From Anti-Circumvention Law. -

    No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. -

    When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. -

    4. Conveying Verbatim Copies. -

    You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. -

    You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. -

    5. Conveying Modified Source Versions. -

    You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: -

    a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. -

    b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". -

    c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. -

    d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. -

    A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. -

    6. Conveying Non-Source Forms. -

    You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: -

    a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. -

    b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. -

    c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. -

    d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. -

    e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. -

    A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. -

    A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. -

    "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. -

    If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). -

    The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. -

    Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. -

    7. Additional Terms. -

    "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. -

    When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. -

    Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: -

    a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or -

    b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or -

    c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or -

    d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or -

    e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or -

    f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. -

    All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. -

    If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. -

    Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. -

    8. Termination. -

    You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). -

    However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. -

    Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. -

    Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. -

    9. Acceptance Not Required for Having Copies. -

    You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. -

    10. Automatic Licensing of Downstream Recipients. -

    Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. -

    An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. -

    You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. -

    11. Patents. -

    A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". -

    A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. -

    Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. -

    In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. -

    If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. -

    If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. -

    A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. -

    Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. -

    12. No Surrender of Others' Freedom. -

    If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. -

    13. Use with the GNU Affero General Public License. -

    Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. -

    14. Revised Versions of this License. -

    The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. -

    Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. -

    If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. -

    Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. -

    15. Disclaimer of Warranty. -

    THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -

    16. Limitation of Liability. -

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. -

    17. Interpretation of Sections 15 and 16. -

    If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. -

    END OF TERMS AND CONDITIONS -

    How to Apply These Terms to Your New Programs -

    If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. -

    To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. -

    Scenario for Facotorio multiplayer. - Copyright (C) 2018 badgamernl -

    This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. -

    This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -

    You should have received a copy of the GNU General Public License - along with this program. If not, see . -

    Also add information on how to contact you by electronic and paper mail. -

    If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: -

    explosivegaming.nl Copyright (C) 2018 badgamernl - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. -

    The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". -

    You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. -

    The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. - - - - - - - - - - - - - -
    - - - -

    - - - -
    -
    - - - - - diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html deleted file mode 100644 index 0fd38750..00000000 --- a/docs/topics/README.md.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - README.md topic - - - - - - - -
    -
    - - - - - - - -
    - - - - - - - - -

    README.md topic

    -

    -

    - -

    - logo -
    - - Release - - - Downloads - - - Star - - - Fork - - - CodeFactor - - - Discord - -

    -

    ExpGaming Scenario Repository

    -

    ## Explosive Gaming -

    Explosive Gaming (often ExpGaming) is a server hosting community with a strong focus on [Factorio][factorio] and games with similar themes. We are best known for our weekly reset Factorio server with a vanilla+ scenario. Although our servers tend to attract the more experienced players, our servers are open to everyone. You can find us through our [website], [discord], or the public server list with the name ExpGaming. -

    ## Use and Installation -

    1) Download our [git repository][stable-dl] for the stable release. For the latest features you can download our [dev branch][experimental-dl]. See [releases](#releases) for other major releases. -

    2) Extract the downloaded zip file into your Factorio scenario directory: - * Windows: `%appdata%\Factorio\scenarios` - * Linux: `~/.factorio/scenarios` -

    3) Within the scenario you can find `./config/_file_loader.lua` which contains a list of all the modules which will be loaded by the scenario. Comment out (or remove) features you do not want. Be aware modules may load other modules as dependencies even when removed from the list. -

    4) More advanced users can adjust other configs files within `./config` but please be aware some files will require a basic understanding of lua. -

    5) Once you have made your config changes: open Factorio, select either single or multiplayer, select (host) new game, and finally select our scenario which will be called `scenario-master` or `scenario-dev` under user scenarios. -

    6) You will now be asked to generate your map and the scenario will load all selected modules. If any module does not load as expected please check `factorio-current.log` in your Factorio directory for errors and report them to our [issues page][issues]. -

    ## Contributing -

    All are welcome to make bug reports, feature requests, and pull requests for our scenario. We do not require you to have any lua or coding knowledge to make bug reports and feature requests. If you have any questions ask us in our [discord]. -

    For developers wanting to add features please follow these guidelines: -

    * All code is documented using ldoc, the end result can be found [here][docs]. -* Changes should be made on your own fork and merged into `dev` through a pull request. -* Pull requests are automatically linted and documentation checked. -* Pull requests are manually reviewed to maintain code and language quality. -* New features should have the branch names: `feature/feature-name` -* Bug fixes should have the branch names: `fix/bug-name` -

    ## Releases -

    | Release* | Release Name | Factorio Version** | -|---|---|---| -| [6.2][s6.2] | Mega Feature Bundle | [1.1.32][f1.1.32] | -| [6.1][s6.1] | External Data Overhaul | [1.0.0][f1.0.0] | -| [6.0][s6.0] | Gui / 0.18 Overhaul | [0.18.17][f0.18.17] | -| [5.10][s5.10] | Data Store Rewrite | [0.17.71][f0.17.71] | -| [5.9][s5.9] | Control Modules and Documentation | [0.17.63][f0.17.63] | -| [5.8][s5.8] | Home and Chat Bot | [0.17.47][f0.17.49] | -| [5.7][s5.7] | Warp System | [0.17.47][f0.17.47] | -| [5.6][s5.6] | Information Guis | [0.17.44][f0.17.44] | -| [5.5][s5.5] | Gui System | [0.17.43][f0.17.43] | -| [5.4][s5.4] | Admin Controls | [0.17.32][f0.17.32] | -| [5.3][s5.3] | Custom Roles | [0.17.28][f0.17.28] | -| [5.2][s5.2] | Quality of life | [0.17.22][f0.17.22] | -| [5.1][s5.1] | Permission Groups | [0.17.13][f0.17.13] | -| [5.0][s5.0] | 0.17 Overhaul| [0.17][f0.17.9] | -| [4.0][s4.0] | Softmod Manager | [0.16.51][f0.16.51] | -| [3.0][s3.0] | 0.16 Overhaul | [0.16][f0.16] | -| [2.0][s2.0] | Localization and clean up | [0.15][f0.15] | -| [1.0][s1.0] | Modulation | [0.15][f0.15] | -| [0.1][s0.1] | First Tracked Version | [0.14][f0.14] | -

    \* Scenario patch releases have been omitted and can be found [here][releases]. -

    \*\* Factorio versions show the version they were made for, often the minimum requirement to run the scenario. -

    [s6.2]: https://github.com/explosivegaming/scenario/releases/tag/6.2.0 -[s6.1]: https://github.com/explosivegaming/scenario/releases/tag/6.1.0 -[s6.0]: https://github.com/explosivegaming/scenario/releases/tag/6.0.0 -[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.7]: https://github.com/explosivegaming/scenario/releases/tag/5.7.0 -[s5.6]: https://github.com/explosivegaming/scenario/releases/tag/5.6.0 -[s5.5]: https://github.com/explosivegaming/scenario/releases/tag/5.5.0 -[s5.4]: https://github.com/explosivegaming/scenario/releases/tag/5.4.0 -[s5.3]: https://github.com/explosivegaming/scenario/releases/tag/5.3.0 -[s5.2]: https://github.com/explosivegaming/scenario/releases/tag/5.2.0 -[s5.1]: https://github.com/explosivegaming/scenario/releases/tag/5.1.0 -[s5.0]: https://github.com/explosivegaming/scenario/releases/tag/5.0.0 -[s4.0]: https://github.com/explosivegaming/scenario/releases/tag/v4.0 -[s3.0]: https://github.com/explosivegaming/scenario/releases/tag/v3.0 -[s2.0]: https://github.com/explosivegaming/scenario/releases/tag/v2.0 -[s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0 -[s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1 -

    [f1.1.32]: https://wiki.factorio.com/Version_history/1.1.0#1.1.32 -[f1.0.0]: https://wiki.factorio.com/Version_history/1.0.0#1.0.0 -[f0.18.17]: https://wiki.factorio.com/Version_history/0.18.0#0.18.17 -[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.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.43]: https://wiki.factorio.com/Version_history/0.17.0#0.17.43 -[f0.17.32]: https://wiki.factorio.com/Version_history/0.17.0#0.17.32 -[f0.17.28]: https://wiki.factorio.com/Version_history/0.17.0#0.17.28 -[f0.17.22]: https://wiki.factorio.com/Version_history/0.17.0#0.17.22 -[f0.17.13]: https://wiki.factorio.com/Version_history/0.17.0#0.17.13 -[f0.17.9]: https://wiki.factorio.com/Version_history/0.17.0#0.17.9 -[f0.16.51]: https://wiki.factorio.com/Version_history/0.16.0#0.16.51 -[f0.16]: https://wiki.factorio.com/Version_history/0.16.0 -[f0.15]: https://wiki.factorio.com/Version_history/0.15.0 -[f0.14]: https://wiki.factorio.com/Version_history/0.14.0 -

    ## License -

    The Explosive Gaming codebase is licensed under the [GNU General Public License v3.0](LICENSE) -

    [stable-dl]: https://github.com/explosivegaming/scenario/archive/master.zip -[experimental-dl]: https://github.com/explosivegaming/scenario/archive/dev.zip -[releases]: https://github.com/explosivegaming/scenario/releases -[factorio]: https://factorio.com -[docs]: https://explosivegaming.github.io/scenario -[issues]: https://github.com/explosivegaming/scenario/issues/new/choose -[website]: https://explosivegaming.nl -[discord]: https://discord.explosivegaming.nl - - - - - - - - - - - - - -
    - - - -

    - - - -
    -
    - - - - -