From 579dad4453657b5bdf2193e487b5f90aa8627c4d Mon Sep 17 00:00:00 2001 From: RedRafe <93430988+RedRafe@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:18:25 +0100 Subject: [PATCH] Add permissions module for DO (#1391) * Enable 'no-blueprints' for all DO maps. --- .luacheckrc | 2 + config.lua | 8 ++ control.lua | 3 + features/permissions.lua | 120 ++++++++++++++++++ locale/en/redmew_command_text.cfg | 2 + .../presets/danger_bobangels_ores.lua | 1 + .../danger_ores/presets/danger_bobs_ores.lua | 1 + .../danger_ore_3way_beltboxes_ore_only.lua | 1 + .../danger_ores/presets/danger_ore_bz.lua | 1 + ...nger_ore_chessboard_beltboxes_ore_only.lua | 1 + ..._chessboard_uniform_beltboxes_ore_only.lua | 1 + .../danger_ore_circles_beltboxes_ore_only.lua | 1 + .../presets/danger_ore_deadlock_beltboxes.lua | 1 + ...danger_ore_deadlock_beltboxes_ore_only.lua | 1 + .../presets/danger_ore_exotic_industries.lua | 1 + .../danger_ore_exotic_industries_spiral.lua | 1 + ...ensive_grid_factory_beltboxes_ore_only.lua | 1 + ...r_ore_for_the_swarm_beltboxes_ore_only.lua | 1 + ...danger_ore_gradient_beltboxes_ore_only.lua | 1 + ...nger_ore_hub_spiral_beltboxes_ore_only.lua | 1 + .../danger_ore_industrial_revolution_3.lua | 1 + ...e_industrial_revolution_3_grid_factory.lua | 1 + .../presets/danger_ore_krastorio2.lua | 1 + ...danger_ore_landfill_beltboxes_ore_only.lua | 1 + ...danger_ore_lazy_one_beltboxes_ore_only.lua | 2 + .../presets/danger_ore_omnimatter.lua | 1 + .../presets/danger_ore_omnimatter_cages.lua | 1 + .../danger_ore_one_direction_beltboxes.lua | 1 + ...r_ore_one_direction_beltboxes_ore_only.lua | 1 + ..._one_direction_wide_beltboxes_ore_only.lua | 1 + .../danger_ore_patches_beltboxes_ore_only.lua | 1 + ..._patches_beltboxes_ore_only_restricted.lua | 1 + .../danger_ore_poor_mans_coal_fields.lua | 1 + .../danger_ores/presets/danger_ore_pyfe.lua | 1 + .../danger_ore_spiral_beltboxes_ore_only.lua | 1 + .../danger_ore_split_beltboxes_ore_only.lua | 1 + .../danger_ore_square_beltboxes_ore_only.lua | 1 + ...anger_ore_xmas_tree_beltboxes_ore_only.lua | 1 + 38 files changed, 169 insertions(+) create mode 100644 features/permissions.lua diff --git a/.luacheckrc b/.luacheckrc index 54a0148b..5413ec9b 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1355,6 +1355,7 @@ stds.factorio_defines = { 'gui_value_changed', 'import_blueprint', 'import_blueprint_string', + 'import_blueprints_filtered', 'import_permissions_string', 'inventory_split', 'inventory_transfer', @@ -1448,6 +1449,7 @@ stds.factorio_defines = { 'undo', 'upgrade', 'upgrade_opened_blueprint', + 'upgrade_opened_blueprint_by_record', 'use_artillery_remote', 'use_item', 'wire_dragging', diff --git a/config.lua b/config.lua index 798e1f52..713d04dd 100644 --- a/config.lua +++ b/config.lua @@ -441,6 +441,14 @@ global.config = { donator_perks = { enabled = true } + }, + permissions = { + enabled = true, + presets = { + no_blueprints = false, + no_handcraft = false, + }, + modes = {}, } } diff --git a/control.lua b/control.lua index 3f3a249f..1ed81636 100644 --- a/control.lua +++ b/control.lua @@ -117,6 +117,9 @@ end if config.spidertron_group_control.enabled then require 'features.spidertron_group_control' end +if config.permissions.enabled then + require 'features.permissions' +end -- GUIs -- The order determines the order they appear from left to right. diff --git a/features/permissions.lua b/features/permissions.lua new file mode 100644 index 00000000..df91902c --- /dev/null +++ b/features/permissions.lua @@ -0,0 +1,120 @@ +local Command = require 'utils.command' +local Event = require 'utils.event' +local Ranks = require 'resources.ranks' +local Global = require 'utils.global' + +local data = { + initialized_permissions = false, +} + +Global.register(data, function(tbl) + data = tbl +end) + +local config = global.config.permissions +local Public = {} + +-- defines.input_action listed at https://lua-api.factorio.com/latest/defines.html#defines.input_action +local DEFAULT_PRESETS_ACTIONS = { + no_blueprints = { + [defines.input_action.import_blueprint] = false, + [defines.input_action.import_blueprint_string] = false, + [defines.input_action.import_blueprints_filtered] = false, + [defines.input_action.import_permissions_string] = false, + [defines.input_action.open_blueprint_library_gui] = false, + [defines.input_action.open_blueprint_record] = false, + [defines.input_action.upgrade_opened_blueprint_by_record] = false, + }, + no_handcraft= { + [defines.input_action.craft] = false, + } +} + +for preset_name, preset_actions in pairs(DEFAULT_PRESETS_ACTIONS) do + config.modes[preset_name] = config.modes[preset_name] or preset_actions +end + +---Returns config.preset.any(true) +---@return boolean +function Public.any_preset() + for preset_name, is_enabled in pairs(config.presets or {}) do + if is_enabled and config.modes[preset_name] ~= nil then return true end + end + return false +end + +---Sets all permissions for the "Default" group to true +function Public.reset_all_permissions() + local Default = game.permissions.get_group("Default") + + for _, action_ID in pairs(defines.input_action) do + Default.set_allows_action(action_ID, true) + end +end + +---Sets permissions for the "Default" group +---@param params config.permissions +function Public.set_permissions(params) + if params then + for name, actions in pairs(params.modes or {}) do + config.modes[name] = actions + end + + for name, is_enabled in pairs(params.presets or {}) do + config.presets[name] = is_enabled + end + end + + local Default = game.permissions.get_group("Default") + + for name, actions in pairs(config.modes or {}) do + if config.presets[name] then + for action, is_allowed in pairs(actions or {}) do + Default.set_allows_action(action, is_allowed) + end + end + end +end + +---Init permissions for multiplayer servers +--- 'game.is_multiplayer()' is not available on 'on_init' +Event.add(defines.events.on_player_joined_game, function() + if config.enabled + and not data.initialized_permissions + and game.is_multiplayer() + and Public.any_preset() + then + Public.set_permissions() + data.initialized_permissions = true + end +end) + +---Use "/permissions-reset" to reset all players' permissions to default for the "Default" group (admin/server only) +Command.add( + 'permissions-reset', + { + description = {'command_description.permissions_reset'}, + arguments = {}, + required_rank = Ranks.admin, + allowed_by_server = true + }, + function() + Public.reset_all_permissions() + end +) + +---Use "/permissions-set-scenario" to reapply scenario's permissions, if any, for the "Default" group (admin/server only) +Command.add( + 'permissions-set-scenario', + { + description = {'command_description.permissions_set_scenario'}, + arguments = {}, + required_rank = Ranks.admin, + allowed_by_server = true + }, + function() + Public.set_permissions() + end +) + +return Public diff --git a/locale/en/redmew_command_text.cfg b/locale/en/redmew_command_text.cfg index a1992a63..829513d2 100644 --- a/locale/en/redmew_command_text.cfg +++ b/locale/en/redmew_command_text.cfg @@ -68,6 +68,8 @@ meltdown_set=Sets the status of meltdown. redmew_color=Set will save your current color for future maps. Reset will erase your saved color. Random will give you a random color. performance_scale_set=Sets the performance scale between 0.05 and 1. Will alter the game speed, manual mining speed, manual crafting speed and character running speed per force. performance_scale_get=Shows the current performance scale. +permissions_reset=Use "/permissions-reset" to reset all players' permissions to default +permissions_set_scenario=Use "/permissions-set-scenario" to reapply scenario's permissions, if any market=Places a market near you. Use /market removeall to remove all markets on a map lazy_bastard_bootstrap=Puts down the minimum requirements to get started toast=Sends a toast to all players diff --git a/map_gen/maps/danger_ores/presets/danger_bobangels_ores.lua b/map_gen/maps/danger_ores/presets/danger_bobangels_ores.lua index f50db464..0b8118f2 100644 --- a/map_gen/maps/danger_ores/presets/danger_bobangels_ores.lua +++ b/map_gen/maps/danger_ores/presets/danger_bobangels_ores.lua @@ -111,6 +111,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30, -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init( function() diff --git a/map_gen/maps/danger_ores/presets/danger_bobs_ores.lua b/map_gen/maps/danger_ores/presets/danger_bobs_ores.lua index b6226d58..3cfcd38a 100644 --- a/map_gen/maps/danger_ores/presets/danger_bobs_ores.lua +++ b/map_gen/maps/danger_ores/presets/danger_bobs_ores.lua @@ -114,6 +114,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_3way_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_3way_beltboxes_ore_only.lua index f3b2e9b0..47009465 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_3way_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_3way_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.forces.player.technologies['mining-productivity-1'].enabled = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_bz.lua b/map_gen/maps/danger_ores/presets/danger_ore_bz.lua index 253d02b8..d7b41174 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_bz.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_bz.lua @@ -95,6 +95,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_chessboard_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_chessboard_beltboxes_ore_only.lua index 0127572d..c833cc4c 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_chessboard_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_chessboard_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_chessboard_uniform_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_chessboard_uniform_beltboxes_ore_only.lua index 847f9803..5e6d5551 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_chessboard_uniform_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_chessboard_uniform_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_circles_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_circles_beltboxes_ore_only.lua index c53c6427..5e45b570 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_circles_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_circles_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes.lua b/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes.lua index 0af6165a..79f200bb 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() --game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes_ore_only.lua index ae405220..c1507cf2 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_deadlock_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries.lua b/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries.lua index bc0396be..45609f24 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries.lua @@ -92,6 +92,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries_spiral.lua b/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries_spiral.lua index ae5dcfd7..778e8d63 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries_spiral.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_exotic_industries_spiral.lua @@ -93,6 +93,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_expensive_grid_factory_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_expensive_grid_factory_beltboxes_ore_only.lua index 6457de51..4fa0d0a3 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_expensive_grid_factory_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_expensive_grid_factory_beltboxes_ore_only.lua @@ -92,6 +92,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_for_the_swarm_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_for_the_swarm_beltboxes_ore_only.lua index a0f17ee9..dc5eb4cc 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_for_the_swarm_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_for_the_swarm_beltboxes_ore_only.lua @@ -96,6 +96,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_gradient_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_gradient_beltboxes_ore_only.lua index 3e1fd51f..50dd5d3f 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_gradient_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_gradient_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_hub_spiral_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_hub_spiral_beltboxes_ore_only.lua index d4b30e24..42e698de 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_hub_spiral_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_hub_spiral_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3.lua b/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3.lua index 5b08f1ba..736628e8 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3.lua @@ -103,6 +103,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3_grid_factory.lua b/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3_grid_factory.lua index 67c22789..bd587d0a 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3_grid_factory.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3_grid_factory.lua @@ -103,6 +103,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_krastorio2.lua b/map_gen/maps/danger_ores/presets/danger_ore_krastorio2.lua index b1922d93..62af59f3 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_krastorio2.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_krastorio2.lua @@ -115,6 +115,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true local kr_remote = Token.register(function() -- enable creep on Redmew surface diff --git a/map_gen/maps/danger_ores/presets/danger_ore_landfill_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_landfill_beltboxes_ore_only.lua index 738e4aeb..91e89686 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_landfill_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_landfill_beltboxes_ore_only.lua @@ -86,6 +86,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_lazy_one_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_lazy_one_beltboxes_ore_only.lua index 22b721b7..015e8a0b 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_lazy_one_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_lazy_one_beltboxes_ore_only.lua @@ -108,6 +108,8 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true +Config.permissions.presets.no_handcraft = true Event.on_init(function() game.permissions.get_group("Default").set_allows_action(defines.input_action.craft, false) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_omnimatter.lua b/map_gen/maps/danger_ores/presets/danger_ore_omnimatter.lua index 2cfd9d24..6b4724db 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_omnimatter.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_omnimatter.lua @@ -85,6 +85,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_omnimatter_cages.lua b/map_gen/maps/danger_ores/presets/danger_ore_omnimatter_cages.lua index ae07fecc..afc77825 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_omnimatter_cages.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_omnimatter_cages.lua @@ -86,6 +86,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes.lua b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes.lua index 65c01860..81b35108 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes.lua @@ -88,6 +88,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.forces.player.technologies['mining-productivity-1'].enabled = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes_ore_only.lua index 41d8f449..33e382ff 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_beltboxes_ore_only.lua @@ -88,6 +88,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.forces.player.technologies['mining-productivity-1'].enabled = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_wide_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_wide_beltboxes_ore_only.lua index efad95bd..c38c8b06 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_one_direction_wide_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_one_direction_wide_beltboxes_ore_only.lua @@ -88,6 +88,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() game.forces.player.technologies['mining-productivity-1'].enabled = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only.lua index d9300231..3d256e11 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only.lua @@ -89,6 +89,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only_restricted.lua b/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only_restricted.lua index 7f44ee04..faf3199e 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only_restricted.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_patches_beltboxes_ore_only_restricted.lua @@ -89,6 +89,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_poor_mans_coal_fields.lua b/map_gen/maps/danger_ores/presets/danger_ore_poor_mans_coal_fields.lua index bea3aa70..e317ae74 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_poor_mans_coal_fields.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_poor_mans_coal_fields.lua @@ -92,6 +92,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_pyfe.lua b/map_gen/maps/danger_ores/presets/danger_ore_pyfe.lua index fde1beaa..0d9fde71 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_pyfe.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_pyfe.lua @@ -91,6 +91,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true if script.active_mods['early_construction'] then table.insert(Config.player_create.starting_items, { count = 1, name = 'early-construction-light-armor' }) diff --git a/map_gen/maps/danger_ores/presets/danger_ore_spiral_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_spiral_beltboxes_ore_only.lua index 4790140a..426b7bcb 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_spiral_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_spiral_beltboxes_ore_only.lua @@ -86,6 +86,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_split_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_split_beltboxes_ore_only.lua index b1ff7f36..a0b9066e 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_split_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_split_beltboxes_ore_only.lua @@ -87,6 +87,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_square_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_square_beltboxes_ore_only.lua index f90800c7..229870f9 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_square_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_square_beltboxes_ore_only.lua @@ -92,6 +92,7 @@ Config.dump_offline_inventories = { offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team } Config.paint.enabled = false +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false diff --git a/map_gen/maps/danger_ores/presets/danger_ore_xmas_tree_beltboxes_ore_only.lua b/map_gen/maps/danger_ores/presets/danger_ore_xmas_tree_beltboxes_ore_only.lua index eebe49cb..cafeb2d1 100644 --- a/map_gen/maps/danger_ores/presets/danger_ore_xmas_tree_beltboxes_ore_only.lua +++ b/map_gen/maps/danger_ores/presets/danger_ore_xmas_tree_beltboxes_ore_only.lua @@ -90,6 +90,7 @@ Config.paint.enabled = false Config.day_night.enabled = true Config.day_night.use_fixed_brightness = true Config.day_night.fixed_brightness = 0.70 +Config.permissions.presets.no_blueprints = true Event.on_init(function() -- game.draw_resource_selection = false