Fixed task list for guests

This commit is contained in:
Cooldude2606
2019-06-01 01:41:45 +01:00
parent cbfd559e2e
commit 42265cd14c

View File

@@ -211,25 +211,27 @@ function generate_task(player,element,task_id)
Gui.set_padding(task_area) Gui.set_padding(task_area)
-- 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
if player_allowed_edit(player,task_id) then local flow = Gui.create_right_align(element,'edit-'..task_id)
local flow = Gui.create_right_align(element,'edit-'..task_id) flow.caption = task_id
flow.caption = task_id
edit_task(flow) edit_task(flow)
discard_task(flow) discard_task(flow)
end
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..')'
if element['edit-'..task_id] then
local players = table_keys(details.editing) local edit_area = element['edit-'..task_id]
if #players > 0 then local players = table_keys(details.editing)
element['edit-'..task_id][edit_task.name].tooltip = {'task-list.edit-tooltip',table.concat(players,', ')} local allowed = player_allowed_edit(player,task_id)
else
element['edit-'..task_id][edit_task.name].tooltip = {'task-list.edit-tooltip-none'} edit_area.visible = allowed
end
if #players > 0 then
edit_area[edit_task.name].tooltip = {'task-list.edit-tooltip',table.concat(players,', ')}
else
edit_area[edit_task.name].tooltip = {'task-list.edit-tooltip-none'}
end end
-- draws/updates the task area -- draws/updates the task area
@@ -356,13 +358,11 @@ local function generate_container(player,element)
non_made.style.single_line = false non_made.style.single_line = false
-- table that stores all the data -- table that stores all the data
local col_count = 2
if player_allowed_edit(player) then col_count = col_count+1 end
local flow_table = local flow_table =
flow.add{ flow.add{
name='table', name='table',
type='table', type='table',
column_count=col_count, column_count=3,
draw_horizontal_lines=true, draw_horizontal_lines=true,
vertical_centering=false vertical_centering=false
} }