From 65f970748ad19f6c4136105219bac0d53542216b Mon Sep 17 00:00:00 2001 From: RedRafe Date: Wed, 25 Feb 2026 02:14:37 +0100 Subject: [PATCH 1/2] Update player list GUI --- features/gui/player_list.lua | 436 +++++++++++++++++------------------ utils/core.lua | 29 +++ 2 files changed, 238 insertions(+), 227 deletions(-) diff --git a/features/gui/player_list.lua b/features/gui/player_list.lua index 3df756dc1..49c93b481 100644 --- a/features/gui/player_list.lua +++ b/features/gui/player_list.lua @@ -32,6 +32,7 @@ local get_rank_color = Rank.get_rank_color local get_rank_name = Rank.get_rank_name local get_player_rank = Rank.get_player_rank local donator_is_donator = Donator.is_donator +local format_number = require '__core__/lualib/util'.format_number local tooltip_lines_cap = 53 @@ -39,7 +40,7 @@ local poke_cooldown_time = 240 -- in ticks. local sprite_time_step = 54000 -- in ticks local symbol_asc = ' ▲' local symbol_desc = ' ▼' -local focus_color = Color.dark_orange +local focus_color = { 128, 206, 240 } local donator_color = Color.donator local notify_name = 'notify_poke' @@ -48,7 +49,7 @@ Settings.register(notify_name, Settings.types.boolean, true, 'player_list.poke_n local rank_column_width = 100 local inv_sprite_time_step = 1 / sprite_time_step -local donator_label_caption = {'', '(', {'ranks.donator_abbreviation'}, ')'} +local donator_label_caption = { '', '(', { 'ranks.donator_abbreviation' }, ')' } local player_poke_cooldown = {} local player_pokes = {} @@ -56,20 +57,17 @@ local player_settings = {} local no_notify_players = {} local prototype_locale_string_cache = {} -Global.register( - { - player_poke_cooldown = player_poke_cooldown, - player_pokes = player_pokes, - player_settings = player_settings, - no_notify_players = no_notify_players - }, - function(tbl) - player_poke_cooldown = tbl.player_poke_cooldown - player_pokes = tbl.player_pokes - player_settings = tbl.player_settings - no_notify_players = tbl.no_notify_players - end -) +Global.register({ + player_poke_cooldown = player_poke_cooldown, + player_pokes = player_pokes, + player_settings = player_settings, + no_notify_players = no_notify_players, +}, function(tbl) + player_poke_cooldown = tbl.player_poke_cooldown + player_pokes = tbl.player_pokes + player_settings = tbl.player_settings + no_notify_players = tbl.no_notify_players +end) local main_button_name = Gui.uid_name() local main_frame_name = Gui.uid_name() @@ -125,7 +123,7 @@ end local function apply_heading_style(style) style.font_color = focus_color - style.font = 'default-bold' + style.font = 'default-semibold' style.horizontal_align = 'center' end @@ -142,7 +140,7 @@ local column_builders = { return a < b end, draw_heading = function(parent) - local label = parent.add {type = 'label', name = sprite_heading_name, caption = ' '} + local label = parent.add { type = 'label', name = sprite_heading_name, caption = ' ' } local label_style = label.style apply_heading_style(label_style) label_style.width = 32 @@ -150,18 +148,17 @@ local column_builders = { return label end, draw_cell = function(parent, cell_data) - local label = - parent.add { + local label = parent.add { type = 'sprite', name = sprite_cell_name, - sprite = player_sprites[cell_data] + sprite = player_sprites[cell_data], } local label_style = label.style label_style.horizontal_align = 'center' label_style.width = 32 return label - end + end, }, [player_name_heading_name] = { create_data = function(player) @@ -171,8 +168,8 @@ local column_builders = { return a.name:lower() < b.name:lower() end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.name_caption', sort_symbol} - local label = parent.add {type = 'label', name = player_name_heading_name, caption = caption} + local caption = { 'player_list.name_caption', sort_symbol } + local label = parent.add { type = 'label', name = player_name_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) label_style.width = 150 @@ -183,12 +180,11 @@ local column_builders = { local color = cell_data.color lighten_color(color) local name = cell_data.name - local label = - parent.add { + local label = parent.add { type = 'label', name = player_name_cell_name, caption = name, - tooltip = name + tooltip = name, } local label_style = label.style label_style.font_color = color @@ -196,7 +192,7 @@ local column_builders = { label_style.width = 150 return label - end + end, }, [time_heading_name] = { create_data = function(player) @@ -206,31 +202,31 @@ local column_builders = { return a < b end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.time_caption', sort_symbol} - local label = parent.add {type = 'label', name = time_heading_name, caption = caption} + local caption = { 'player_list.time_caption', sort_symbol } + local label = parent.add { type = 'label', name = time_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) - label_style.width = 125 + label_style.width = 70 return label end, draw_cell = function(parent, cell_data) - local text = Utils.format_time(cell_data) + local text = Utils.format_time_short(cell_data) - local label = parent.add {type = 'label', name = time_cell_name, caption = text} + local label = parent.add { type = 'label', name = time_cell_name, caption = text } local label_style = label.style label_style.horizontal_align = 'left' - label_style.width = 125 + label_style.width = 70 return label - end + end, }, [rank_heading_name] = { create_data = function(player) local player_name = player.name return { rank = get_player_rank(player_name), - is_donator = donator_is_donator(player_name) + is_donator = donator_is_donator(player_name), } end, sort = function(a, b) @@ -241,8 +237,8 @@ local column_builders = { return a_rank < b_rank end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.rank_caption', sort_symbol} - local label = parent.add {type = 'label', name = rank_heading_name, caption = caption} + local caption = { 'player_list.rank_caption', sort_symbol } + local label = parent.add { type = 'label', name = rank_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) label_style.width = rank_column_width @@ -253,20 +249,20 @@ local column_builders = { local is_donator = cell_data.is_donator local rank = cell_data.rank if is_donator then - local flow = parent.add {type = 'flow', name = rank_cell_name, direction = 'horizontal'} + local flow = parent.add { type = 'flow', name = rank_cell_name, direction = 'horizontal' } local flow_style = flow.style flow_style.horizontal_align = 'left' flow_style.width = rank_column_width - local label_rank = flow.add {type = 'label', caption = get_rank_name(rank)} + local label_rank = flow.add { type = 'label', caption = get_rank_name(rank) } label_rank.style.font_color = get_rank_color(rank) - local label_donator = flow.add {type = 'label', caption = donator_label_caption} + local label_donator = flow.add { type = 'label', caption = donator_label_caption } label_donator.style.font_color = donator_color return flow else - local label = parent.add {type = 'label', name = rank_cell_name, caption = get_rank_name(rank)} + local label = parent.add { type = 'label', name = rank_cell_name, caption = get_rank_name(rank) } local label_style = label.style label_style.horizontal_align = 'left' label_style.font_color = get_rank_color(rank) @@ -274,7 +270,7 @@ local column_builders = { return label end - end + end, }, [distance_heading_name] = { create_data = function(player) @@ -284,31 +280,31 @@ local column_builders = { return a < b end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.distance_caption', sort_symbol} - local label = parent.add {type = 'label', name = distance_heading_name, caption = caption} + local caption = { 'player_list.distance_caption', sort_symbol } + local label = parent.add { type = 'label', name = distance_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) - label_style.width = 70 + label_style.width = 80 return label end, draw_cell = function(parent, cell_data) local text = format_distance(cell_data) - local label = parent.add {type = 'label', name = distance_cell_name, caption = text} + local label = parent.add { type = 'label', name = distance_cell_name, caption = text } local label_style = label.style label_style.horizontal_align = 'center' - label_style.width = 70 + label_style.width = 80 return label - end + end, }, [coin_heading_name] = { create_data = function(player) local index = player.index return { coin_earned = get_for_player(index, coins_earned_name), - coin_spent = get_for_player(index, coins_spent_name) + coin_spent = get_for_player(index, coins_spent_name), } end, sort = function(a, b) @@ -320,30 +316,29 @@ local column_builders = { end end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.coins_caption', sort_symbol} - local label = - parent.add { + local caption = { 'player_list.coins_caption', sort_symbol } + local label = parent.add { type = 'label', name = coin_heading_name, caption = caption, - tooltip = 'Coins earned / spent.' + tooltip = 'Coins earned / spent.', } local label_style = label.style apply_heading_style(label_style) - label_style.width = 80 + label_style.width = 90 return label end, draw_cell = function(parent, cell_data) - local text = concat({cell_data.coin_earned, '/', cell_data.coin_spent}) + local text = concat({ format_number(cell_data.coin_earned, true), '/', format_number(cell_data.coin_spent, true) }) - local label = parent.add {type = 'label', name = coin_cell_name, caption = text} + local label = parent.add { type = 'label', name = coin_cell_name, caption = text } local label_style = label.style label_style.horizontal_align = 'center' - label_style.width = 80 + label_style.width = 90 return label - end + end, }, [kills_heading_name] = { create_data = function(player) @@ -354,40 +349,40 @@ local column_builders = { return a < b end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.kills_caption', sort_symbol} - local label = parent.add {type = 'label', name = kills_heading_name, caption = caption} + local caption = { 'player_list.kills_caption', sort_symbol } + local label = parent.add { type = 'label', name = kills_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) - label_style.width = 80 + label_style.width = 70 return label end, draw_cell = function(parent, cell_data) - local label = parent.add {type = 'label', name = kills_cell_name, caption = cell_data} + local label = parent.add { type = 'label', name = kills_cell_name, caption = format_number(cell_data, true) } local label_style = label.style label_style.horizontal_align = 'center' - label_style.width = 80 + label_style.width = 70 return label - end + end, }, [deaths_heading_name] = { create_data = function(player) local player_index = player.index return { count = get_for_player(player_index, player_deaths_name), - causes = PlayerStats.get_all_death_causes_by_player(player_index) + causes = PlayerStats.get_all_death_causes_by_player(player_index), } end, sort = function(a, b) return a.count < b.count end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.deaths_caption', sort_symbol} - local label = parent.add {type = 'label', name = deaths_heading_name, caption = caption} + local caption = { 'player_list.deaths_caption', sort_symbol } + local label = parent.add { type = 'label', name = deaths_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) - label_style.width = 60 + label_style.width = 70 return label end, @@ -407,7 +402,7 @@ local column_builders = { if not prototype then prototype = prototypes.item[name] end - prototype_locale_string_cache[name] = prototype and prototype.localised_name or {'', name} + prototype_locale_string_cache[name] = prototype and prototype.localised_name or { '', name } end local str = ': ' .. count @@ -418,25 +413,24 @@ local column_builders = { tooltip = tooltip:add(prototype_locale_string_cache[name]):add(str) end - local label = - parent.add {type = 'label', name = deaths_cell_name, caption = cell_data.count, tooltip = tooltip} + local label = parent.add { type = 'label', name = deaths_cell_name, caption = cell_data.count, tooltip = tooltip } local label_style = label.style label_style.horizontal_align = 'center' - label_style.width = 60 + label_style.width = 70 return label - end + end, }, [poke_name_heading_name] = { create_data = function(player) - return {poke_count = player_pokes[player.index] or 0, player = player} + return { poke_count = player_pokes[player.index] or 0, player = player } end, sort = function(a, b) return a.poke_count < b.poke_count end, draw_heading = function(parent, sort_symbol, data) - local caption = {'player_list.poke_caption', sort_symbol} - local label = parent.add {type = 'label', name = poke_name_heading_name, caption = caption} + local caption = { 'player_list.poke_caption', sort_symbol } + local label = parent.add { type = 'label', name = poke_name_heading_name, caption = caption } local label_style = label.style apply_heading_style(label_style) label_style.width = 60 @@ -452,23 +446,21 @@ local column_builders = { parent_style.width = 64 parent_style.horizontal_align = 'center' - local label = parent.add {type = 'button', name = poke_cell_name, caption = cell_data.poke_count} - local label_style = label.style - label_style.horizontal_align = 'center' - label_style.minimal_width = 32 - label_style.height = 24 - label_style.font = 'default-bold' - label_style.top_padding = 0 - label_style.bottom_padding = 0 - label_style.left_padding = 0 - label_style.right_padding = 0 + local label = parent.add { type = 'button', name = poke_cell_name, caption = cell_data.poke_count, style = 'crafting_queue_slot' } + Gui.set_style(label, { + horizontal_align = 'center', + minimal_width = 32, + height = 24, + font = 'default-bold', + padding = 0, + }) data.poke_buttons[player.index] = label - Gui.set_data(label, {data = data, player = player}) + Gui.set_data(label, { data = data, player = player }) return label - end + end, }, [report_heading_name] = { create_data = function(player) @@ -478,47 +470,44 @@ local column_builders = { return a.name:lower() < b.name:lower() end, draw_heading = function(parent, sort_symbol) - local caption = {'player_list.report_caption', sort_symbol} - local label = - parent.add { + local caption = { 'player_list.report_caption', sort_symbol } + local label = parent.add { type = 'label', name = report_heading_name, caption = caption, - tooltip = {'player_list.report_tooltip'} + tooltip = { 'player_list.report_tooltip' }, } local label_style = label.style apply_heading_style(label_style) - label_style.width = 58 + label_style.width = 65 return label end, draw_cell = function(parent, cell_data) local parent_style = parent.style - parent_style.width = 58 + parent_style.width = 65 parent_style.horizontal_align = 'center' - local label = - parent.add { + local label = parent.add { type = 'sprite-button', name = report_cell_name, sprite = 'utility/force_editor_icon', - tooltip = {'player_list.report_button_tooltip', cell_data.name} + tooltip = { 'player_list.report_button_tooltip', cell_data.name }, + style = 'slot_button_in_shallow_frame' } - local label_style = label.style - label_style.horizontal_align = 'center' - label_style.minimal_width = 32 - label_style.height = 24 - label_style.font = 'default-bold' - label_style.top_padding = 0 - label_style.bottom_padding = 0 - label_style.left_padding = 0 - label_style.right_padding = 0 + Gui.set_style(label, { + horizontal_align = 'center', + minimal_width = 32, + height = 24, + font = 'default-bold', + padding = 0, + }) Gui.set_data(label, cell_data) return label - end - } + end, + }, } local function get_default_player_settings() @@ -540,7 +529,7 @@ local function get_default_player_settings() return { columns = columns, - sort = -3 + sort = -3, } end @@ -550,7 +539,7 @@ local function redraw_title(data) local online_count = #game.connected_players local total_count = get_for_global(player_count_name) - frame.caption = {'player_list.title', online_count, total_count} + frame.caption = { 'player_list.title', online_count, total_count } end local function redraw_headings(data) @@ -562,7 +551,7 @@ local function redraw_headings(data) local heading_table_flow = data.heading_table_flow Gui.clear(heading_table_flow) - local heading_table = heading_table_flow.add {type = 'table', column_count = #columns} + local heading_table = heading_table_flow.add { type = 'table', column_count = #columns } for i, c in ipairs(settings.columns) do local sort_symbol = '' @@ -573,7 +562,7 @@ local function redraw_headings(data) local heading = column_builders[c].draw_heading(heading_table, sort_symbol, data) - Gui.set_data(heading, {data = data, index = i}) + Gui.set_data(heading, { data = data, index = i }) end end @@ -599,7 +588,7 @@ local function redraw_cells(data) local cell_table_scroll_pane = data.cell_table_scroll_pane Gui.clear(cell_table_scroll_pane) - local grid = cell_table_scroll_pane.add {type = 'table', column_count = #columns} + local grid = cell_table_scroll_pane.add { type = 'table', column_count = #columns } local list_data = {} for _, p in ipairs(game.connected_players) do @@ -617,7 +606,7 @@ local function redraw_cells(data) for _, row in ipairs(list_data) do for c_i, c in ipairs(columns) do - local flow = grid.add {type = 'flow'} + local flow = grid.add { type = 'flow' } column_builders[c].draw_cell(flow, row[c_i], data) end end @@ -625,21 +614,28 @@ end local function draw_main_frame(left, player) local player_index = player.index - local frame = left.add {type = 'frame', name = main_frame_name, direction = 'vertical', style = 'non_draggable_frame'} + local frame = left.add { + type = 'frame', + name = main_frame_name, + direction = 'vertical', + style = 'non_draggable_frame', + } - local heading_table_flow = frame.add {type = 'flow'} + local inner = frame.add { type = 'frame', style = 'inside_shallow_frame', direction = 'vertical' } + Gui.set_style(inner, { padding = 8, right_padding = 0 }) - local cell_table_scroll_pane = frame.add {type = 'scroll-pane'} - cell_table_scroll_pane.style.maximal_height = 400 + local heading_table_flow = inner.add { type = 'flow' } + + local cell_table_scroll_pane = inner.add { type = 'scroll-pane' } + Gui.set_style(cell_table_scroll_pane, { maximal_height = 400 }) local state = Settings.get(player.index, notify_name) - local notify_checkbox = - frame.add { + local notify_checkbox = frame.add { type = 'checkbox', name = notify_checkbox_name, state = state, - caption = {'player_list.poke_notify_caption'}, - tooltip = {'player_list.poke_notify_tooltip'} + caption = { 'player_list.poke_notify_caption' }, + tooltip = { 'player_list.poke_notify_tooltip' }, } Gui.make_close_button(frame, main_button_name) @@ -650,7 +646,7 @@ local function draw_main_frame(left, player) heading_table_flow = heading_table_flow, cell_table_scroll_pane = cell_table_scroll_pane, settings = settings, - notify_checkbox = notify_checkbox + notify_checkbox = notify_checkbox, } redraw_title(data) @@ -698,15 +694,13 @@ local function player_created(event) return end - Gui.add_top_element(player, - { - type = 'sprite-button', - name = main_button_name, - sprite = 'entity/character', - tooltip = {'player_list.tooltip'}, - auto_toggle = true, - } - ) + Gui.add_top_element(player, { + type = 'sprite-button', + name = main_button_name, + sprite = 'entity/character', + tooltip = { 'player_list.tooltip' }, + auto_toggle = true, + }) end local function player_removed(event) @@ -736,24 +730,21 @@ Event.add(defines.events.on_player_left_game, update_player_list) Gui.on_click(main_button_name, toggle) -Gui.on_checked_state_changed( - notify_checkbox_name, - function(event) - local player_index = event.player_index - local checkbox = event.element - local state = checkbox.state - - local no_notify - if state then - no_notify = nil - else - no_notify = true - end +Gui.on_checked_state_changed(notify_checkbox_name, function(event) + local player_index = event.player_index + local checkbox = event.element + local state = checkbox.state - no_notify_players[player_index] = no_notify - Settings.set(player_index, notify_name, state) + local no_notify + if state then + no_notify = nil + else + no_notify = true end -) + + no_notify_players[player_index] = no_notify + Settings.set(player_index, notify_name, state) +end) local function headings_click(event) local heading_data = Gui.get_data(event.element) @@ -780,104 +771,95 @@ for name, _ in pairs(column_builders) do Gui.on_click(name, headings_click) end -Gui.on_click( - poke_cell_name, - function(event) - local element = event.element - local button_data = Gui.get_data(element) - local poke_player = button_data.player - local player = event.player +Gui.on_click(poke_cell_name, function(event) + local element = event.element + local button_data = Gui.get_data(element) + local poke_player = button_data.player + local player = event.player - if poke_player == player then - return - end + if poke_player == player then + return + end - local poke_player_index = poke_player.index - if not do_poke_spam_protection(player) then - return - end + local poke_player_index = poke_player.index + if not do_poke_spam_protection(player) then + return + end - local count = (player_pokes[poke_player_index] or 0) + 1 - player_pokes[poke_player_index] = count + local count = (player_pokes[poke_player_index] or 0) + 1 + player_pokes[poke_player_index] = count - local poke_str = poke_messages[random(#poke_messages)] - local message = concat({'>> ', player.name, ' has poked ', poke_player.name, ' with ', poke_str, ' <<'}) + local poke_str = poke_messages[random(#poke_messages)] + local message = concat({ '>> ', player.name, ' has poked ', poke_player.name, ' with ', poke_str, ' <<' }) - for _, p in ipairs(game.connected_players) do - local frame = Gui.get_left_element(p, main_frame_name) - if frame and frame.valid then - local frame_data = Gui.get_data(frame) - local poke_bottons = frame_data.poke_buttons + for _, p in ipairs(game.connected_players) do + local frame = Gui.get_left_element(p, main_frame_name) + if frame and frame.valid then + local frame_data = Gui.get_data(frame) + local poke_bottons = frame_data.poke_buttons - if poke_bottons then - local settings = frame_data.settings + if poke_bottons then + local settings = frame_data.settings - local columns = settings.columns - local sort = settings.sort + local columns = settings.columns + local sort = settings.sort - local sorted_column = columns[abs(sort)] - if sorted_column == poke_name_heading_name then - redraw_cells(frame_data) - else - local poke_button = poke_bottons[poke_player_index] - poke_button.caption = count - end + local sorted_column = columns[abs(sort)] + if sorted_column == poke_name_heading_name then + redraw_cells(frame_data) + else + local poke_button = poke_bottons[poke_player_index] + poke_button.caption = count end end + end - if not no_notify_players[p.index] then - p.print(message) - end + if not no_notify_players[p.index] then + p.print(message) end end -) - -Gui.on_click( - report_cell_name, - function(event) - local reporting_player = event.player - local reported_player = Gui.get_data(event.element) - if reporting_player.admin then - Report.jail(reported_player, reporting_player) - else - Report.spawn_reporting_popup(reporting_player, reported_player) - end +end) + +Gui.on_click(report_cell_name, function(event) + local reporting_player = event.player + local reported_player = Gui.get_data(event.element) + if reporting_player.admin then + Report.jail(reported_player, reporting_player) + else + Report.spawn_reporting_popup(reporting_player, reported_player) end -) +end) Gui.allow_player_to_toggle_top_element_visibility(main_button_name) -Event.add( - Settings.events.on_setting_set, - function(event) - if event.setting_name ~= notify_name then - return - end +Event.add(Settings.events.on_setting_set, function(event) + if event.setting_name ~= notify_name then + return + end - local player_index = event.player_index - local player = game.get_player(player_index) - if not player or not player.valid then - return - end + local player_index = event.player_index + local player = game.get_player(player_index) + if not player or not player.valid then + return + end - local state = event.new_value - local no_notify - if state then - no_notify = nil - else - no_notify = true - end + local state = event.new_value + local no_notify + if state then + no_notify = nil + else + no_notify = true + end - no_notify_players[player_index] = no_notify + no_notify_players[player_index] = no_notify - local frame = Gui.get_left_element(player, main_frame_name) - if not frame then - return - end + local frame = Gui.get_left_element(player, main_frame_name) + if not frame then + return + end - local data = Gui.get_data(frame) - local checkbox = data.notify_checkbox + local data = Gui.get_data(frame) + local checkbox = data.notify_checkbox - checkbox.state = state - end -) + checkbox.state = state +end) diff --git a/utils/core.lua b/utils/core.lua index 996337174..3825de15b 100644 --- a/utils/core.lua +++ b/utils/core.lua @@ -209,6 +209,35 @@ function Module.format_time(ticks, include_seconds) return concat(result, ' ') end +--- Takes a time in ticks and returns a string with the time in format "x hour(s) x minute(s)" +function Module.format_time_short(ticks, include_seconds) + local result = {} + + local hours = floor(ticks * ticks_to_hours) + local has_previous = false + if hours > 0 then + has_previous = true + ticks = ticks - hours * hours_to_ticks + insert(result, hours..'h') + end + + local minutes = floor(ticks * ticks_to_minutes) + if minutes > 0 or (not include_seconds and not has_previous) then + has_previous = true + ticks = ticks - minutes * minutes_to_ticks + insert(result, minutes..'m') + end + + if include_seconds then + local seconds = floor(ticks * ticks_to_seconds) + if seconds > 0 or not has_previous then + insert(result, seconds..'s') + end + end + + return concat(result, ' ') +end + --- Prints a message letting the player know they cannot run a command -- @param name string name of the command function Module.cant_run(name) From cedb08143c23f6a53c86722c6e623fcc4af8c214 Mon Sep 17 00:00:00 2001 From: RedRafe <93430988+RedRafe@users.noreply.github.com> Date: Wed, 25 Feb 2026 09:29:06 +0100 Subject: [PATCH 2/2] Update utils/core.lua Co-authored-by: grilledham --- utils/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/core.lua b/utils/core.lua index 3825de15b..08c6a70a4 100644 --- a/utils/core.lua +++ b/utils/core.lua @@ -209,7 +209,7 @@ function Module.format_time(ticks, include_seconds) return concat(result, ' ') end ---- Takes a time in ticks and returns a string with the time in format "x hour(s) x minute(s)" +--- Takes a time in ticks and returns a string with the time in format "xh xm" function Module.format_time_short(ticks, include_seconds) local result = {}