diff --git a/config/permission_groups.lua b/config/permission_groups.lua index b895e6ed..9b2ac4f1 100644 --- a/config/permission_groups.lua +++ b/config/permission_groups.lua @@ -60,8 +60,7 @@ Permission_Groups.new_group('Standard') 'change_programmable_speaker_alert_parameters', -- standard 'drop_item', 'reset_assembling_machine', - 'set_auto_launch_rocket', - 'cancel_research' + 'set_auto_launch_rocket' } Permission_Groups.new_group('Guest') @@ -84,7 +83,6 @@ Permission_Groups.new_group('Guest') 'drop_item', 'reset_assembling_machine', 'set_auto_launch_rocket', - 'cancel_research', 'change_programmable_speaker_parameters', -- guest 'change_train_stop_station', 'deconstruct', @@ -93,7 +91,8 @@ Permission_Groups.new_group('Guest') 'reset_assembling_machine', 'rotate_entity', 'use_artillery_remote', - 'launch_rocket' + 'launch_rocket', + 'cancel_research' } Permission_Groups.new_group('Restricted') diff --git a/config/warps.lua b/config/warps.lua index 8ec573a3..bd7fb4c8 100644 --- a/config/warps.lua +++ b/config/warps.lua @@ -6,7 +6,8 @@ return { activation_range = 4, -- The distance the player must be to a warp in order to use the warp gui, gui can still be viewd but not used spawn_activation_range = 20, -- A second activation range which is used for the forces spawn point default_icon = 'discharge-defense-equipment', -- The deafult icon which is used by warps; must be an item name - user_can_edit_own_warps = true, -- When true the user can always edit warps which they created regaudless of other settings + user_can_edit_own_warps = false, -- When true the user can always edit warps which they created regaudless of other settings + any_user_can_add_new_warp = false, -- When true any user is able to create new warps, however editing may still be restricted only_admins_can_edit = false, -- When true only admins can edit warps edit_warps_role_permision = 'gui/warp-list/edit', -- Role permission used by the role system to allow editing warps bypass_warp_limits_permision = 'gui/warp-list/no-limit', -- Role permission used by the role system to allow bypassing the time and distance restrctions diff --git a/expcore/commands.lua b/expcore/commands.lua index ffa13acd..097c51d6 100644 --- a/expcore/commands.lua +++ b/expcore/commands.lua @@ -622,7 +622,7 @@ function Commands.run_command(command_event) -- splits the arguments local input_string = command_event.parameter or '' local quote_params = {} -- stores any " " params - input_string = input_string:gsub('"[^"]-"',function(w) + input_string = input_string:gsub(' "[^"]-"',function(w) -- finds all " " params are removes spaces for the next part local no_spaces = w:gsub('%s','_') local no_quotes = w:sub(2,-2) diff --git a/expcore/store.lua b/expcore/store.lua index 3785ecae..b2b25b78 100644 --- a/expcore/store.lua +++ b/expcore/store.lua @@ -240,8 +240,13 @@ Event.add(Store.on_value_update,function(event) Store.callbacks[event.location](event.value,event.child) end - if not event.from_sync then - write_json('log/store.log',event) + if not event.from_sync and Store.synced[event.location] then + write_json('log/store.log',{ + tick=event.tick, + location=event.location, + child=event.child, + value=event.value, + }) end end) diff --git a/locale/en/gui.cfg b/locale/en/gui.cfg index b0052648..a1ed832c 100644 --- a/locale/en/gui.cfg +++ b/locale/en/gui.cfg @@ -77,7 +77,7 @@ confirm-tooltip=Save changes cancel-tooltip=Discard changes edit-tooltip=Currently being edited by: __1__ edit-tooltip-none=Currently being edited by: Nobody -discord-tooltip=Remove task +discard-tooltip=Remove task [warp-list] main-caption=Warp List diff --git a/modules/gui/rocket-info.lua b/modules/gui/rocket-info.lua index 8109f320..bee8d005 100644 --- a/modules/gui/rocket-info.lua +++ b/modules/gui/rocket-info.lua @@ -561,7 +561,7 @@ Event.add(defines.events.on_rocket_launched,function(event) rocket_times[force_name][rockets_launched] = event.tick local remove_rocket = rockets_launched-largest_rolling_avg - if remove_rocket > 0 and not table.includes(config.milestones,remove_rocket) then + if remove_rocket > 0 and not table.contains(config.milestones,remove_rocket) then rocket_times[force_name][remove_rocket] = nil end diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index 8b455276..e613b03c 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -133,14 +133,14 @@ end) local discard_task = Gui.new_button() :set_sprites('utility/trash') -:set_tooltip{'task-list.discord-tooltip'} +:set_tooltip{'task-list.discard-tooltip'} :set_style('tool_button',function(style) Gui.set_padding_style(style,-2,-2,-2,-2) style.height = 20 style.width = 20 end) :on_click(function(player,element) - local task_id = element.parent.caption + local task_id = element.parent.name remove_task(task_id) update_all() end) @@ -156,10 +156,10 @@ Gui.new_button() style.width = 20 end) :on_click(function(player,element) - local task_id = element.parent.caption + local task_id = element.parent.name local details = task_details[task_id] details.editing[player.name] = true - generate_task(player,element.parent.parent,task_id) + generate_task(player,element.parent.parent.parent,task_id) end) --[[ Generates each task, handles both view and edit mode @@ -212,17 +212,17 @@ function generate_task(player,element,task_id) -- if the player can edit then it adds the edit and delete button local flow = Gui.create_right_align(element,'edit-'..task_id) - flow.caption = task_id + local sub_flow = flow.add{type='flow',name=task_id} - edit_task(flow) - discard_task(flow) + edit_task(sub_flow) + discard_task(sub_flow) end -- update the number indexes and the current editing players element['count-'..task_id].caption = task_number..')' - local edit_area = element['edit-'..task_id] + local edit_area = element['edit-'..task_id][task_id] local players = table_keys(details.editing) local allowed = player_allowed_edit(player,task_id) @@ -243,8 +243,8 @@ function generate_task(player,element,task_id) elseif not editing then -- create the label, view mode - if element['edit-'..task_id] then - element['edit-'..task_id][edit_task.name].enabled = true + if edit_area then + edit_area[edit_task.name].enabled = true end task_area.clear() @@ -261,8 +261,8 @@ function generate_task(player,element,task_id) elseif editing and element_type ~= 'textfield' then -- create the text field, edit mode, update it omited as value is being edited - if element['edit-'..task_id] then - element['edit-'..task_id][edit_task.name].enabled = false + if edit_area then + edit_area[edit_task.name].enabled = false end task_area.clear() diff --git a/modules/gui/warp-list.lua b/modules/gui/warp-list.lua index 08dfbc06..8e466e4f 100644 --- a/modules/gui/warp-list.lua +++ b/modules/gui/warp-list.lua @@ -35,7 +35,7 @@ local function player_allowed_edit(player,warp_id) return true end else - if config.any_user_can_add_new_task then + if config.any_user_can_add_new_warp then return true end end diff --git a/old/modules/WarpPoints/control.lua b/old/modules/DONE/WarpPoints/control.lua similarity index 100% rename from old/modules/WarpPoints/control.lua rename to old/modules/DONE/WarpPoints/control.lua diff --git a/old/modules/WarpPoints/locale/de.cfg b/old/modules/DONE/WarpPoints/locale/de.cfg similarity index 100% rename from old/modules/WarpPoints/locale/de.cfg rename to old/modules/DONE/WarpPoints/locale/de.cfg diff --git a/old/modules/WarpPoints/locale/en.cfg b/old/modules/DONE/WarpPoints/locale/en.cfg similarity index 100% rename from old/modules/WarpPoints/locale/en.cfg rename to old/modules/DONE/WarpPoints/locale/en.cfg diff --git a/old/modules/WarpPoints/locale/fr.cfg b/old/modules/DONE/WarpPoints/locale/fr.cfg similarity index 100% rename from old/modules/WarpPoints/locale/fr.cfg rename to old/modules/DONE/WarpPoints/locale/fr.cfg diff --git a/old/modules/WarpPoints/locale/nl.cfg b/old/modules/DONE/WarpPoints/locale/nl.cfg similarity index 100% rename from old/modules/WarpPoints/locale/nl.cfg rename to old/modules/DONE/WarpPoints/locale/nl.cfg diff --git a/old/modules/WarpPoints/locale/sv-SE.cfg b/old/modules/DONE/WarpPoints/locale/sv-SE.cfg similarity index 100% rename from old/modules/WarpPoints/locale/sv-SE.cfg rename to old/modules/DONE/WarpPoints/locale/sv-SE.cfg diff --git a/old/modules/WarpPoints/softmod.json b/old/modules/DONE/WarpPoints/softmod.json similarity index 100% rename from old/modules/WarpPoints/softmod.json rename to old/modules/DONE/WarpPoints/softmod.json diff --git a/old/modules/WarpPoints/src/commands.lua b/old/modules/DONE/WarpPoints/src/commands.lua similarity index 100% rename from old/modules/WarpPoints/src/commands.lua rename to old/modules/DONE/WarpPoints/src/commands.lua diff --git a/old/modules/WarpPoints/src/warp_entities.lua b/old/modules/DONE/WarpPoints/src/warp_entities.lua similarity index 100% rename from old/modules/WarpPoints/src/warp_entities.lua rename to old/modules/DONE/WarpPoints/src/warp_entities.lua diff --git a/old/modules/WarpPoints/src/warp_tiles.lua b/old/modules/DONE/WarpPoints/src/warp_tiles.lua similarity index 100% rename from old/modules/WarpPoints/src/warp_tiles.lua rename to old/modules/DONE/WarpPoints/src/warp_tiles.lua