mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Fixed errors in task list
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user