Merge pull request #106 from Cooldude2606/release/5.7.0

Release 5.7.0
This commit is contained in:
Cooldude2606
2019-06-07 21:11:50 +01:00
committed by GitHub
18 changed files with 28 additions and 23 deletions

View File

@@ -60,8 +60,7 @@ Permission_Groups.new_group('Standard')
'change_programmable_speaker_alert_parameters', -- standard 'change_programmable_speaker_alert_parameters', -- standard
'drop_item', 'drop_item',
'reset_assembling_machine', 'reset_assembling_machine',
'set_auto_launch_rocket', 'set_auto_launch_rocket'
'cancel_research'
} }
Permission_Groups.new_group('Guest') Permission_Groups.new_group('Guest')
@@ -84,7 +83,6 @@ Permission_Groups.new_group('Guest')
'drop_item', 'drop_item',
'reset_assembling_machine', 'reset_assembling_machine',
'set_auto_launch_rocket', 'set_auto_launch_rocket',
'cancel_research',
'change_programmable_speaker_parameters', -- guest 'change_programmable_speaker_parameters', -- guest
'change_train_stop_station', 'change_train_stop_station',
'deconstruct', 'deconstruct',
@@ -93,7 +91,8 @@ Permission_Groups.new_group('Guest')
'reset_assembling_machine', 'reset_assembling_machine',
'rotate_entity', 'rotate_entity',
'use_artillery_remote', 'use_artillery_remote',
'launch_rocket' 'launch_rocket',
'cancel_research'
} }
Permission_Groups.new_group('Restricted') Permission_Groups.new_group('Restricted')

View File

@@ -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 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 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 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 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 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 bypass_warp_limits_permision = 'gui/warp-list/no-limit', -- Role permission used by the role system to allow bypassing the time and distance restrctions

View File

@@ -622,7 +622,7 @@ function Commands.run_command(command_event)
-- splits the arguments -- splits the arguments
local input_string = command_event.parameter or '' local input_string = command_event.parameter or ''
local quote_params = {} -- stores any " " params 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 -- finds all " " params are removes spaces for the next part
local no_spaces = w:gsub('%s','_') local no_spaces = w:gsub('%s','_')
local no_quotes = w:sub(2,-2) local no_quotes = w:sub(2,-2)

View File

@@ -240,8 +240,13 @@ Event.add(Store.on_value_update,function(event)
Store.callbacks[event.location](event.value,event.child) Store.callbacks[event.location](event.value,event.child)
end end
if not event.from_sync then if not event.from_sync and Store.synced[event.location] then
write_json('log/store.log',event) write_json('log/store.log',{
tick=event.tick,
location=event.location,
child=event.child,
value=event.value,
})
end end
end) end)

View File

@@ -77,7 +77,7 @@ confirm-tooltip=Save changes
cancel-tooltip=Discard changes cancel-tooltip=Discard changes
edit-tooltip=Currently being edited by: __1__ edit-tooltip=Currently being edited by: __1__
edit-tooltip-none=Currently being edited by: Nobody edit-tooltip-none=Currently being edited by: Nobody
discord-tooltip=Remove task discard-tooltip=Remove task
[warp-list] [warp-list]
main-caption=Warp List main-caption=Warp List

View File

@@ -561,7 +561,7 @@ Event.add(defines.events.on_rocket_launched,function(event)
rocket_times[force_name][rockets_launched] = event.tick rocket_times[force_name][rockets_launched] = event.tick
local remove_rocket = rockets_launched-largest_rolling_avg 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 rocket_times[force_name][remove_rocket] = nil
end end

View File

@@ -133,14 +133,14 @@ end)
local discard_task = local discard_task =
Gui.new_button() Gui.new_button()
:set_sprites('utility/trash') :set_sprites('utility/trash')
:set_tooltip{'task-list.discord-tooltip'} :set_tooltip{'task-list.discard-tooltip'}
:set_style('tool_button',function(style) :set_style('tool_button',function(style)
Gui.set_padding_style(style,-2,-2,-2,-2) Gui.set_padding_style(style,-2,-2,-2,-2)
style.height = 20 style.height = 20
style.width = 20 style.width = 20
end) end)
:on_click(function(player,element) :on_click(function(player,element)
local task_id = element.parent.caption local task_id = element.parent.name
remove_task(task_id) remove_task(task_id)
update_all() update_all()
end) end)
@@ -156,10 +156,10 @@ Gui.new_button()
style.width = 20 style.width = 20
end) end)
:on_click(function(player,element) :on_click(function(player,element)
local task_id = element.parent.caption local task_id = element.parent.name
local details = task_details[task_id] local details = task_details[task_id]
details.editing[player.name] = true details.editing[player.name] = true
generate_task(player,element.parent.parent,task_id) generate_task(player,element.parent.parent.parent,task_id)
end) end)
--[[ Generates each task, handles both view and edit mode --[[ 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 -- if the player can edit then it adds the edit and delete button
local flow = Gui.create_right_align(element,'edit-'..task_id) 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) edit_task(sub_flow)
discard_task(flow) discard_task(sub_flow)
end end
-- update the number indexes and the current editing players -- update the number indexes and the current editing players
element['count-'..task_id].caption = task_number..')' 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 players = table_keys(details.editing)
local allowed = player_allowed_edit(player,task_id) local allowed = player_allowed_edit(player,task_id)
@@ -243,8 +243,8 @@ function generate_task(player,element,task_id)
elseif not editing then elseif not editing then
-- create the label, view mode -- create the label, view mode
if element['edit-'..task_id] then if edit_area then
element['edit-'..task_id][edit_task.name].enabled = true edit_area[edit_task.name].enabled = true
end end
task_area.clear() task_area.clear()
@@ -261,8 +261,8 @@ function generate_task(player,element,task_id)
elseif editing and element_type ~= 'textfield' then elseif editing and element_type ~= 'textfield' then
-- create the text field, edit mode, update it omited as value is being edited -- create the text field, edit mode, update it omited as value is being edited
if element['edit-'..task_id] then if edit_area then
element['edit-'..task_id][edit_task.name].enabled = false edit_area[edit_task.name].enabled = false
end end
task_area.clear() task_area.clear()

View File

@@ -35,7 +35,7 @@ local function player_allowed_edit(player,warp_id)
return true return true
end end
else else
if config.any_user_can_add_new_task then if config.any_user_can_add_new_warp then
return true return true
end end
end end