From 0f5868378a931c20deffccafcf1b4fa34abbd3ce Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Tue, 27 Apr 2021 23:16:18 +0200 Subject: [PATCH 1/3] Fix documentation modules/control/tasks.lua Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com> --- modules/control/tasks.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/control/tasks.lua b/modules/control/tasks.lua index caacaeea..00f331b4 100644 --- a/modules/control/tasks.lua +++ b/modules/control/tasks.lua @@ -32,7 +32,7 @@ end) --[[-- Add a new task for a force, the task can be placed into a certain position for that force @tparam string force_name the name of the force to add the task for @tparam[opt] string player_name the player who added this task, will cause them to be listed under editing -@tparam[opt] string task_title the message title that is used for this task, if not given default is used +@tparam[opt] string task_title the message title that is used for the task, if not given the default is used @tparam[opt] string task_body the message body that is used for this task, if not given default is used @treturn string the uid of the task which was created @@ -179,4 +179,4 @@ function Tasks.get_editing(task_id, player_name) end -- Module Return -return Tasks \ No newline at end of file +return Tasks From 254d69f646bbf65a3a0e03820578312a1c7240b2 Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Tue, 27 Apr 2021 23:29:28 +0200 Subject: [PATCH 2/3] Fix documentation modules/gui/task-list.lua Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com> --- modules/gui/task-list.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index aa8e84be..f1031754 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -317,7 +317,7 @@ local task_view_footer = local message_pattern = "(.-)\n(.*)" ---- Parce a string into a message object with title and body +--- Parse a string into a message object with title and body -- @tparam string str message data local function parse_message(str) -- Trimm the spaces of the string From ea8e093c318780540beef14a101a6632e98ff401 Mon Sep 17 00:00:00 2001 From: Bastiaan Date: Tue, 27 Apr 2021 23:33:05 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com> --- modules/gui/task-list.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/gui/task-list.lua b/modules/gui/task-list.lua index f1031754..d8c9b260 100644 --- a/modules/gui/task-list.lua +++ b/modules/gui/task-list.lua @@ -320,12 +320,12 @@ local message_pattern = "(.-)\n(.*)" --- Parse a string into a message object with title and body -- @tparam string str message data local function parse_message(str) - -- Trimm the spaces of the string + -- Trim the spaces of the string local trimmed = string.gsub(str, "^%s*(.-)%s*$", "%1") local message = { title = "", body = "" } local title, body = string.match(trimmed, message_pattern) if not title then - -- If it doesn't match the patter return the str as a title + -- If it doesn't match the pattern return the str as a title message.title = trimmed else message.title = title @@ -501,7 +501,7 @@ local task_list_container = task_view_footer_element.visible = false task_edit_footer_element.visible = false task_create_footer_element.visible = false - -- Return the exteral container + -- Return the external container return container.parent end ):add_to_left_flow( @@ -675,7 +675,7 @@ PlayerSelected:on_update( edit_flow.visible = false end else - -- If new state nil then hide footer elements and set editing to nil for old_state + -- If new state is nil then hide footer elements and set editing to nil for old_state if old_state then Tasks.set_editing(old_state, player.name, nil) end @@ -718,7 +718,7 @@ local function role_update_event(event) PlayerSelected:set(selected) end - -- Update the new task button and create footer incase the user can now add them + -- Update the new task button and create footer in case the user can now add them local has_permission = check_player_permissions(player) local add_new_task_element = container.header.alignment[add_new_task.name] add_new_task_element.visible = has_permission