From 714df2f8127b5c6d56823c43b4096da1e0d88045 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 28 Sep 2024 13:07:46 -0700 Subject: [PATCH] deduplicate notes blueprints if run on repeat --- changelog.txt | 1 + internal/quickfort/notes.lua | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index e9a183309c..e93bc153e4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -31,6 +31,7 @@ Template for new versions: ## New Features ## Fixes +- `gui/quickfort`: only print a help blueprint's text once even if the repeat setting is enabled ## Misc Improvements - `control-panel`: Add realistic-melting tweak to control-panel registry diff --git a/internal/quickfort/notes.lua b/internal/quickfort/notes.lua index aa64168607..5667cfb933 100644 --- a/internal/quickfort/notes.lua +++ b/internal/quickfort/notes.lua @@ -31,7 +31,11 @@ function do_run(_, grid, ctx) if #line > 0 then table.insert(lines, table.concat(line, ' ')) end - table.insert(ctx.messages, table.concat(lines, '\n')) + local message = table.concat(lines, '\n') + if not ctx.messages_set[message] then + table.insert(ctx.messages, message) + ctx.messages_set[message] = true + end end function do_orders()