mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user