From 3c1e07252be3d34053e93159f570d520c0a7335b Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 15 Nov 2014 16:16:32 -0500 Subject: [PATCH] Update autotrade stockpile controls --- plugins/autodump.cpp | 20 +++++++++++++++++--- plugins/automelt.cpp | 1 + plugins/autotrade.cpp | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index 4d80309f3..dcbc7c083 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -212,9 +212,23 @@ struct dump_hook : public df::viewscreen_dwarfmodest auto dims = Gui::getDwarfmodeViewDims(); int left_margin = dims.menu_x1 + 1; int x = left_margin; - int y = 26; - - OutputToggleString(x, y, "Auto dump", "Shift-D", monitor.isMonitored(sp), true, left_margin); + int y = dims.y2 - 7; + + int links = 0; + links += sp->links.give_to_pile.size(); + links += sp->links.take_from_pile.size(); + links += sp->links.give_to_workshop.size(); + links += sp->links.take_from_workshop.size(); + bool state = monitor.isMonitored(sp); + + if (links + 12 >= y) { + y = dims.y2; + OutputString(COLOR_WHITE, x, y, "Auto: "); + OutputString(COLOR_LIGHTRED, x, y, "D"); + OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "ump "); + } else { + OutputToggleString(x, y, "Auto dump", "D", state, true, left_margin, COLOR_WHITE, COLOR_LIGHTRED); + } } }; diff --git a/plugins/automelt.cpp b/plugins/automelt.cpp index cfd348455..ab286e358 100644 --- a/plugins/automelt.cpp +++ b/plugins/automelt.cpp @@ -237,6 +237,7 @@ struct melt_hook : public df::viewscreen_dwarfmodest if (links + 12 >= y) { y = dims.y2; OutputString(COLOR_WHITE, x, y, "Auto: "); + x += 5; OutputString(COLOR_LIGHTRED, x, y, "M"); OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "elt "); } else { diff --git a/plugins/autotrade.cpp b/plugins/autotrade.cpp index f3922b96a..e6156b0c3 100644 --- a/plugins/autotrade.cpp +++ b/plugins/autotrade.cpp @@ -432,7 +432,7 @@ struct trade_hook : public df::viewscreen_dwarfmodest if (links + 12 >= y) { y = dims.y2; OutputString(COLOR_WHITE, x, y, "Auto: "); - x += 5; + x += 11; OutputString(COLOR_LIGHTRED, x, y, "T"); OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "rade "); } else {