From 6dbc22350f716c2d7550e6b8be485984b7960023 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 23 Feb 2023 21:32:48 -0800 Subject: [PATCH] log to console instead of announcements --- docs/changelog.txt | 1 + plugins/autobutcher.cpp | 17 ++++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 51b81de0e..5508549c9 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -47,6 +47,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: -@ `confirm`: fix fps drop when enabled ## Misc Improvements +- `autobutcher`: logs activity to the console terminal instead of making disruptive in-game announcements - DFHack tool windows that capture mouse clicks (and therefore prevent you from clicking on the "pause" button) now unconditionally pause the game when they open (but you can still unpause with the keyboard if you want to). Examples of this behavior: `gui/quickfort`, `gui/blueprint`, `gui/liquids` - `showmood`: now shows the number of items needed for cloth and bars in addition to the technically correct but always confusing "total dimension" (150 per bar or 10,000 per cloth) -@ Stopped mouse clicks from affecting the map when a click on a DFHack screen dismisses the window diff --git a/plugins/autobutcher.cpp b/plugins/autobutcher.cpp index bee3a4503..536c74f0f 100644 --- a/plugins/autobutcher.cpp +++ b/plugins/autobutcher.cpp @@ -19,8 +19,6 @@ #include "LuaTools.h" #include "PluginManager.h" -#include "modules/Gui.h" -#include "modules/Maps.h" #include "modules/Persistence.h" #include "modules/Units.h" #include "modules/World.h" @@ -805,8 +803,8 @@ static void autobutcher_cycle(color_ostream &out) { w->UpdateConfig(out); watched_races.emplace(unit->race, w); - string announce = "New race added to autobutcher watchlist: " + Units::getRaceNamePluralById(unit->race); - Gui::showAnnouncement(announce, 2, false); + INFO(cycle,out).print("New race added to autobutcher watchlist: %s\n", + Units::getRaceNamePluralById(unit->race).c_str()); } if (w->isWatched) { @@ -828,9 +826,8 @@ static void autobutcher_cycle(color_ostream &out) { if (slaughter_count) { std::stringstream ss; ss << slaughter_count; - string announce = Units::getRaceNamePluralById(w.first) + " marked for slaughter: " + ss.str(); - DEBUG(cycle,out).print("%s\n", announce.c_str()); - Gui::showAnnouncement(announce, 2, false); + INFO(cycle,out).print("%s marked for slaughter: %s\n", + Units::getRaceNamePluralById(w.first).c_str(), ss.str().c_str()); } } } @@ -954,10 +951,8 @@ static void autobutcher_setWatchListRace(color_ostream &out, unsigned id, unsign WatchedRace * w = new WatchedRace(out, id, watched, fk, mk, fa, ma); w->UpdateConfig(out); watched_races.emplace(id, w); - - string announce; - announce = "New race added to autobutcher watchlist: " + Units::getRaceNamePluralById(id); - Gui::showAnnouncement(announce, 2, false); + INFO(status,out).print("New race added to autobutcher watchlist: %s\n", + Units::getRaceNamePluralById(id).c_str()); } // remove entry from watchlist