From 7c9002c4ea9321d89067d261225ff98ab6200db7 Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sat, 9 Jan 2016 14:47:00 -0700 Subject: [PATCH] Avoid overwriting dynamic lines. Even vanilla DF has three additional workshop order lines that only show up with modded raws. --- plugins/autogems.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/autogems.cpp b/plugins/autogems.cpp index 4ae6b7efc..dcce37c3c 100644 --- a/plugins/autogems.cpp +++ b/plugins/autogems.cpp @@ -246,7 +246,15 @@ struct autogem_hook : public df::viewscreen_dwarfmodest { auto dims = Gui::getDwarfmodeViewDims(); int x = dims.menu_x1 + 1; int y = dims.y1 + 12; - OutputHotkeyString(x, y, (running? "Auto Cut Gems": "No Auto Cut Gems"), "g", false, x, COLOR_WHITE, COLOR_LIGHTRED); + Screen::Pen pen = Screen::readTile(x, y); + + while (pen.valid() && pen.ch != ' ') { + pen = Screen::readTile(x, ++y); + } + + if (pen.valid()) { + OutputHotkeyString(x, y, (running? "Auto Cut Gems": "No Auto Cut Gems"), "g", false, x, COLOR_WHITE, COLOR_LIGHTRED); + } } } };