Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "TaskList",
"version": "0.5.1",
"version": "0.5.2",
"title": "Task List",
"description": "Keep track of your tasks / todos in a simple and unobtrusive interface.",
"author": "raiguard",
Expand Down
3 changes: 3 additions & 0 deletions locale/en/TaskList.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ tlst-add-subtask= + Subtask
tlst-add-to-top=Add to the top
tlst-assignee=Assignee
tlst-description=Description
tlst-priority=Priority
tlst-area=Area
tlst-area-description=Used to indicate seperate areas of work. E.g. Main base, Starter Base, Train Base, Initial Build / Upgrades / Optional etc
tlst-edit-task=Edit task
tlst-expand-tooltip=Toggle details\n[font=default-semibold][color=128, 206, 240]Shift:[/color][/font] Move up\n[font=default-semibold][color=128, 206, 240]Control:[/color][/font] Move down
tlst-force=Force
Expand Down
9 changes: 7 additions & 2 deletions scripts/gui/edit-task/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ function actions.confirm(Gui, _, e)
end
end

local priority = refs.priority_dropdown.selected_index
local area = refs.area_textfield.text

local Task = Gui.state.task
if Task then
Task:update(refs.title_textfield.text, refs.description_textfield.text, assignee, status)
Task:update(refs.title_textfield.text, refs.description_textfield.text, assignee, status,priority,area)
else
--- @type LuaForce|LuaPlayer|Task
local owner = Gui.state.parent_task
Expand All @@ -80,7 +83,9 @@ function actions.confirm(Gui, _, e)
owner,
assignee,
status,
refs.add_to_top_checkbox.state
refs.add_to_top_checkbox.state,
priority,
area
)
end

Expand Down
43 changes: 41 additions & 2 deletions scripts/gui/edit-task/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ function index.new(player, player_table, options)
local ParentTask = options.parent_task

local players = { { "gui.tlst-unassigned" } }
local priorities = {}
local force = util.get_force(player)
local assignee_selection_index = 1
local priority_selection_index = 5
local player_selection_index = 0

local title_caption
Expand Down Expand Up @@ -116,6 +118,12 @@ function index.new(player, player_table, options)
end
end

for i = 1, 10, 1 do
table.insert(priorities, i)
end

priority_selection_index = Task.priority or 5

local default_task = player.mod_settings["tlst-new-tasks-in-progress"].value and "in_progress" or "not_started"
local status_items = {}
local selected_status_index = constants.task_status[default_task].index
Expand Down Expand Up @@ -144,7 +152,7 @@ function index.new(player, player_table, options)
actions = {
on_click = { gui = "edit_task", transform = "handle_titlebar_click" },
},
{ type = "label", style = "frame_title", caption = title_caption, ignored_by_interaction = true },
{ type = "label", style = "frame_title", caption = title_caption, ignored_by_interaction = true },
{ type = "empty-widget", style = "flib_dialog_titlebar_drag_handle", ignored_by_interaction = true },
},
{
Expand Down Expand Up @@ -214,7 +222,7 @@ function index.new(player, player_table, options)
{
type = "flow",
style_mods = { vertical_align = "center" },
{ type = "label", caption = { "gui.tlst-assignee" } },
{ type = "label", caption = { "gui.tlst-assignee" } },
{ type = "empty-widget", style = "flib_horizontal_pusher" },
{
type = "drop-down",
Expand All @@ -224,6 +232,37 @@ function index.new(player, player_table, options)
ref = { "assignee_dropdown" },
},
},
{
type = "flow",
style_mods = { vertical_align = "center" },
{ type = "label", caption = { "gui.tlst-priority" } },
{ type = "empty-widget", style = "flib_horizontal_pusher" },
{
type = "drop-down",
items = priorities,
selected_index = priority_selection_index,
ref = { "priority_dropdown" },
},
},
{
type = "flow",
style_mods = { vertical_align = "center" },
{
type = "label",
caption = { "", { "gui.tlst-area" }, " [img=info]" },
tooltip = { "gui.tlst-area-description" },
},
{ type = "empty-widget", style = "flib_horizontal_pusher" },
{
type = "text-box",
text = Task.area,
elem_mods = { word_wrap = true },
ref = { "area_textfield" },
actions = {
on_confirmed = { gui = "edit_task", action = "confirm" },
},
},
},
{
type = "flow",
style_mods = { vertical_align = "center" },
Expand Down
2 changes: 2 additions & 0 deletions scripts/gui/tasks/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ function TasksGui:update_task(Task)
tooltip = status_info.label,
},
},
{ elem_mods = { caption = Task.priority } },
{ elem_mods = { caption = Task.area } },
},
{
{ elem_mods = { caption = Task.description, visible = #Task.description > 0 } },
Expand Down
15 changes: 13 additions & 2 deletions scripts/gui/tasks/templates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function templates.checkboxes_flow(name, visible)
direction = "vertical",
ref = { name .. "_flow" },
{ type = "flow", name = "incompleted", direction = "vertical", visible = false },
{ type = "flow", name = "completed", direction = "vertical", visible = false },
{ type = "flow", name = "completed", direction = "vertical", visible = false },
visible = visible,
}
end
Expand Down Expand Up @@ -74,6 +74,7 @@ function templates.task_item(Task, index, completed)
caption = Task.assignee and Task.assignee.name or nil,
visible = Task.assignee and true or false,
},

{
type = "sprite",
style = "flib_indicator",
Expand All @@ -83,6 +84,16 @@ function templates.task_item(Task, index, completed)
on_click = { gui = "tasks", action = "cycle_task_status", task_id = Task.id },
},
},
{
type = "label",
style = "info_label",
caption = Task.priority or nil,
},
{
type = "label",
style = "info_label",
caption = Task.area or nil,
},
{
type = "sprite-button",
style = "mini_button_aligned_to_text_vertically_when_centered",
Expand Down Expand Up @@ -128,7 +139,7 @@ function templates.task_item(Task, index, completed)
name = "subtasks_flow",
direction = "vertical",
{ type = "flow", name = "incompleted", direction = "vertical", visible = false },
{ type = "flow", name = "completed", direction = "vertical", visible = false },
{ type = "flow", name = "completed", direction = "vertical", visible = false },
{
type = "flow",
style = "tlst_task_item_flow",
Expand Down
Loading