diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 8d1d7915..885ebd8e 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -1,18 +1,24 @@ --- name: Bug report -about: Create a report to help us improve +about: Report a bug which does not crash the game, any bug from the latest major scenario version --- -**Describe the bug** +**Factorio version** +Version number: X.Y.Z + +**Scenario version** +Version number: X.Y.Z + +**Bug description** A clear and concise description of what the bug is. -**To Reproduce** +**Reproduction method** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' -4. See error +4. See error in log **Expected behavior** A clear and concise description of what you expected to happen. @@ -20,9 +26,5 @@ A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. -**Other information (please complete the following information):** - - OS: [e.g. iOS, Windows, Linux] - - Factorio Version: [e.g. 0.16.30] - **Additional context** -Add any other context about the problem here. +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/Desync_report.md b/.github/ISSUE_TEMPLATE/Desync_report.md new file mode 100644 index 00000000..5c7e81f9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Desync_report.md @@ -0,0 +1,24 @@ +--- +name: Desync report +about: Report a desync, latest version of scenario only including patches + +--- + +**Factorio version** +Version number: X.Y.Z + +**Scenario version** +Version number: X.Y.Z + +**Desync description** +A clear and concise description of what you believe causes the desync. + +**Reproduction method** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error in log + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/Error_report.md b/.github/ISSUE_TEMPLATE/Error_report.md index 85f5a32f..d9ca9b28 100644 --- a/.github/ISSUE_TEMPLATE/Error_report.md +++ b/.github/ISSUE_TEMPLATE/Error_report.md @@ -1,33 +1,35 @@ --- -name: Error/Desync Report -about: Create a report on a bug which gives an error or desync +name: Error report +about: Report a bug which cases the game to crash, any bug from the latest major scenario version --- -**Error Message** -Error: insert error message +**Factorio version** +Version number: X.Y.Z -**Known Causes** -Know causes that will result in error: - - Cause 1 - - Cause 2 +**Scenario version** +Version number: X.Y.Z -**To Reproduce (please give for each cause outlined above)** +**Error message** +``` +error message and stacktrace back +``` + +**Error description** +A clear and concise description of what you believe causes the crash. + +**Reproduction method** Steps to reproduce the behavior: - - Cause 1 - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error - - Cause 2 - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error in log -**Other information (please complete the following information):** - - OS: [e.g. iOS, Windows, Linux] - - Factorio Version: [e.g. 0.16.30] +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index 066b2d92..6bdc2252 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -1,17 +1,18 @@ --- name: Feature request -about: Suggest an idea for this project +about: Suggest a new idea to be worked on --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +**Feature overview** +Name: name-here +TL;DR: a few words about what the feature is -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +**Details** +A detailed description of what the new feature is. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Possible methods** +Any ideas you have had about how to implement the feature or any problems that may arise. **Additional context** -Add any other context or screenshots about the feature request here. +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/README.md b/README.md index c7509c63..7f54976d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ All are welcome to make pull requests and issues for this scenario, if you are i | Scenario Version* | Version Name | Factorio Version** | |---|---|---| -| [v5.5](s5.5) | Gui System | [v0.17.35](f0.17.35) | +| [v5.6](s5.6) | Information Guis | [v0.17.44](f0.17.44) | +| [v5.5](s5.5) | Gui System | [v0.17.43](f0.17.43) | | [v5.4](s5.4) | Admin Controls | [v0.17.32](f0.17.32) | | [v5.3](s5.3) | Custom Roles | [v0.17.28](f0.17.28) | | [v5.2](s5.2) | Quality of life | [v0.17.22](f0.17.22) | @@ -71,6 +72,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i \** Factorio versions show the version they were made for, often the minimum requirement. +[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 @@ -83,7 +85,7 @@ All are welcome to make pull requests and issues for this scenario, if you are i [s1.0]: https://github.com/explosivegaming/scenario/releases/tag/v1.0 [s0.1]: https://github.com/explosivegaming/scenario/releases/tag/v0.1 -[f0.17.35]: https://wiki.factorio.com/Version_history/0.17.0#0.17.35 +[f0.17.44]: https://wiki.factorio.com/Version_history/0.17.0#0.17.44 [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 diff --git a/config/action_buttons.lua b/config/action_buttons.lua index cd48100d..71ec2ee2 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -1,3 +1,8 @@ +--- 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_child(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 permision name used by the role system local Gui = require 'expcore.gui' local Roles = require 'expcore.roles' local Store = require 'expcore.store' @@ -5,17 +10,20 @@ local Game = require 'utils.game' local Reports = require 'modules.addons.reports-control' local Warnings = require 'modules.addons.warnings-control' local Jail = require 'modules.addons.jail-control' +local Colors = require 'resources.color_presets' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') local action_player_store = 'gui.left.player-list.action-player' local action_name_store = 'gui.left.player-list.action-name' +-- common style used by all action buttons local function tool_button_style(style) Gui.set_padding_style(style,-1,-1,-1,-1) style.height = 28 style.width = 28 end +-- auth that will only allow when on player's of lower roles local function auth_lower_role(player,action_player_name) local player_highest = Roles.get_player_highest_role(player) local action_player_highest = Roles.get_player_highest_role(action_player_name) @@ -24,13 +32,15 @@ local function auth_lower_role(player,action_player_name) end end -local function get_action_player(player) +-- gets the action player and a coloured name for the action to be used on +local function get_action_player_name(player) local action_player_name = Store.get_child(action_player_store,player.name) local action_player = Game.get_player_from_any(action_player_name) local action_player_name_color = format_chat_player_name(action_player) return action_player,action_player_name_color end +-- telports one player to another local function teleport(from_player,to_player) local surface = to_player.surface local position = surface.find_non_colliding_position('character',to_player.position,32,1) @@ -40,55 +50,78 @@ local function teleport(from_player,to_player) return true end +-- teleports the user to the action player local goto_player = Gui.new_button() :set_sprites('utility/export') :set_tooltip{'player-list.goto-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player = get_action_player(player) - teleport(player,action_player) + local action_player_name = get_action_player_name(player) + local action_player = Game.get_player_from_any(action_player_name) + if not player.character or not action_player.character then + player.print({'expcore-commands.reject-player-alive'},Colors.orange_red) + else + teleport(player,action_player) + end end) +-- teleports the action player to the user local bring_player = Gui.new_button() :set_sprites('utility/import') :set_tooltip{'player-list.bring-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player = get_action_player(player) - teleport(action_player,player) + local action_player_name = get_action_player_name(player) + local action_player = Game.get_player_from_any(action_player_name) + if not player.character or not action_player.character then + player.print({'expcore-commands.reject-player-alive'},Colors.orange_red) + else + teleport(action_player,player) + end end) +-- kills the action player, if there are alive local kill_player = Gui.new_button() :set_sprites('utility/too_far') :set_tooltip{'player-list.kill-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - local action_player = get_action_player(player) + local action_player_name = get_action_player_name(player) + local action_player = Game.get_player_from_any(action_player_name) if action_player.character then action_player.character.die() + else + player.print({'expcom-kill.already-dead'},Colors.orange_red) end end) +-- reports the action player, requires a reason to be given local report_player = Gui.new_button() :set_sprites('utility/spawn_flag') :set_tooltip{'player-list.report-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set_child(action_name_store,player.name,'command/report') + local action_player_name = get_action_player_name(player) + if Reports.player_is_reported_by(action_player_name,player.name) then + player.print({'expcom-report.already-reported'},Colors.orange_red) + else + Store.set_child(action_name_store,player.name,'command/report') + end end) local function report_player_callback(player,reason) - local action_player,action_player_name_color = get_action_player(player) + local action_player_name,action_player_name_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-report.non-admin',action_player_name_color,reason} Roles.print_to_roles_higher('Trainee',{'expcom-report.admin',action_player_name_color,by_player_name_color,reason}) - Reports.report_player(action_player,reason,player.name) + Reports.report_player(action_player_name,reason,player.name) end +-- gives the action player a warning, requires a reason local warn_player = Gui.new_button() :set_sprites('utility/spawn_flag') @@ -99,42 +132,57 @@ Gui.new_button() end) local function warn_player_callback(player,reason) - local action_player,action_player_name_color = get_action_player(player) + local action_player_name,action_player_name_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-warnings.received',action_player_name_color,by_player_name_color,reason} - Warnings.add_warnings(action_player,player.name) + Warnings.add_warnings(action_player_name,player.name) end +-- jails the action player, requires a reason local jail_player = Gui.new_button() :set_sprites('utility/item_editor_icon') :set_tooltip{'player-list.jail-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set_child(action_name_store,player.name,'command/jail') + local action_player_name,action_player_name_color = get_action_player_name(player) + if Roles.player_has_role(action_player_name,'Jail') then + player.print({'expcom-jail.already-jailed',action_player_name_color},Colors.orange_red) + else + Store.set_child(action_name_store,player.name,'command/jail') + end end) local function jail_player_callback(player,reason) - local action_player,action_player_name_color = get_action_player(player) + local action_player_name,action_player_name_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-jail.give',action_player_name_color,by_player_name_color,reason} - Jail.jail_player(action_player,player.name) + Jail.jail_player(action_player_name,player.name) end +-- temp bans the action player, requires a reason local temp_ban_player = Gui.new_button() :set_sprites('utility/clock') :set_tooltip{'player-list.temp-ban-player'} :set_style('tool_button',tool_button_style) :on_click(function(player,element) - Store.set_child(action_name_store,player.name,'command/temp-ban') + local action_player_name,action_player_name_color = get_action_player_name(player) + if Roles.player_has_role(action_player_name,'Jail') then + player.print({'expcom-jail.already-banned',action_player_name_color},Colors.orange_red) + else + Store.set_child(action_name_store,player.name,'command/temp-ban') + end end) local function temp_ban_player_callback(player,reason) - local action_player = get_action_player(player) + local action_player,action_player_name_color = get_action_player_name(player) + local by_player_name_color = format_chat_player_name(player) + game.print{'expcom-jail.temp-ban',action_player_name_color,by_player_name_color,reason} Jail.temp_ban_player(action_player,player.name,reason) end +-- kicks the action player, requires a reason local kick_player = Gui.new_button() :set_sprites('utility/warning_icon') @@ -145,10 +193,11 @@ Gui.new_button() end) local function kick_player_callback(player,reason) - local action_player = get_action_player(player) + local action_player = get_action_player_name(player) game.kick_player(action_player,reason) end +-- bans the action player, requires a reason local ban_player = Gui.new_button() :set_sprites('utility/danger_icon') @@ -159,39 +208,39 @@ Gui.new_button() end) local function ban_player_callback(player,reason) - local action_player = get_action_player(player) + local action_player = get_action_player_name(player) game.ban_player(action_player,reason) end return { ['command/teleport'] = { - auth=function(player,action_player_name) - return player.name ~= action_player_name - end, + auth=function(player,action_player) + return player.name ~= action_player.name + end, -- cant teleport to your self goto_player, bring_player }, ['command/kill'] = { - auth=function(player,action_player_name) - if player.name == action_player_name then + auth=function(player,action_player) + if player.name == action_player.name then return true elseif Roles.player_allowed(player,'command/kill/always') then - return auth_lower_role(player,action_player_name) + return auth_lower_role(player,action_player) end - end, + end, -- player must be lower role, or your self kill_player }, ['command/report'] = { - auth=function(player,action_player_name) + auth=function(player,action_player) if not Roles.player_allowed(player,'command/give-warning') then - return not Roles.player_has_flag(action_player_name,'report-immune') + return not Roles.player_has_flag(action_player,'report-immune') end - end, + end, -- can report any player that isnt immune and you arnt able to give warnings reason_callback=report_player_callback, report_player }, ['command/give-warning'] = { - auth=auth_lower_role, + auth=auth_lower_role, -- warn a lower user, replaces report reason_callback=warn_player_callback, warn_player }, diff --git a/config/compilatron.lua b/config/compilatron.lua index a4980f92..47ffccb3 100644 --- a/config/compilatron.lua +++ b/config/compilatron.lua @@ -1,3 +1,4 @@ +-- config file for the compliatrons including where they spawn and what messages they show return { message_cycle=60*15, -- 15 seconds default, how often (in ticks) the messages will cycle locations={ -- defines the spawn locations for all compilatrons diff --git a/config/preset_player_colours.lua b/config/preset_player_colours.lua index 527ad065..d10fd64a 100644 --- a/config/preset_player_colours.lua +++ b/config/preset_player_colours.lua @@ -1,3 +1,4 @@ +-- 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) return { players={ BADgamerNL={r=255,g=20,b=147}, diff --git a/config/repair.lua b/config/repair.lua index dd58d8be..5980c8c2 100644 --- a/config/repair.lua +++ b/config/repair.lua @@ -1,13 +1,14 @@ +-- config file for the repair command return { - disallow = { + disallow = { -- items in this list will never be repaired ['loader']=true, ['fast-loader']=true, ['express-loader']=true, ['electric-energy-interface']=true, ['infinity-chest']=true }, - max_range=50, - allow_blueprint_repair=false, - allow_ghost_revive=true, - allow_heal_entities=true + max_range=50, -- the max range that can be used with the repair command + allow_blueprint_repair=false, -- when true will allow blueprints (things not destroied by biters) to be build instently using the repair command + allow_ghost_revive=true, -- when true will allow ghosts (things destoried by biters) to be build instently using the repair command + allow_heal_entities=true -- when true will heal entities to full health that are within range } \ No newline at end of file diff --git a/config/science.lua b/config/science.lua index 9fd7334a..3cd3ce5f 100644 --- a/config/science.lua +++ b/config/science.lua @@ -1,5 +1,8 @@ -return { - show_eta=true, +-- config file for the science info gui +return { -- list of all science packs to be shown in the gui + show_eta=true, -- when true the eta for research completion will be shown + required_for_green=5, -- the amount required for the text to show as green + required_for_red=-5, -- the amount required for the text to show as red 'automation-science-pack', 'logistic-science-pack', 'military-science-pack', diff --git a/config/scorched_earth.lua b/config/scorched_earth.lua index bf683d45..1a46e20d 100644 --- a/config/scorched_earth.lua +++ b/config/scorched_earth.lua @@ -108,6 +108,7 @@ return { ['rocket-silo']=true, ['pumpjack']=true, ['electric-mining-drill']=true, - ['roboport']=true + ['roboport']=true, + ['accumulator']=true } } \ No newline at end of file diff --git a/config/tasks.lua b/config/tasks.lua index 7b1502e5..4c6bd54a 100644 --- a/config/tasks.lua +++ b/config/tasks.lua @@ -1,3 +1,4 @@ +-- config file for the tasks gui return { only_admins_can_edit = false, -- true will hide the edit and delete buttons from non (game) admins edit_tasks_role_permision = 'gui/task-list/edit' -- value used with custom permision system diff --git a/doc/index.html b/doc/index.html index f5d24cda..45c80e3f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -30,25 +30,62 @@

Modules

-