Skip to content

Commit

Permalink
Merge pull request #106 from Cooldude2606/release/5.7.0
Browse files Browse the repository at this point in the history
Release 5.7.0
  • Loading branch information
Cooldude2606 authored Jun 7, 2019
2 parents 3214228 + 0e19fc9 commit 754dfd5
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 23 deletions.
7 changes: 3 additions & 4 deletions config/permission_groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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',
Expand All @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion config/warps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion expcore/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions expcore/store.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion locale/en/gui.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/rocket-info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 12 additions & 12 deletions modules/gui/task-list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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()
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion modules/gui/warp-list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 754dfd5

Please sign in to comment.