Skip to content

Commit 3c1e072

Browse files
committed
Update autotrade stockpile controls
1 parent 842bd35 commit 3c1e072

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

plugins/autodump.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,23 @@ struct dump_hook : public df::viewscreen_dwarfmodest
212212
auto dims = Gui::getDwarfmodeViewDims();
213213
int left_margin = dims.menu_x1 + 1;
214214
int x = left_margin;
215-
int y = 26;
216-
217-
OutputToggleString(x, y, "Auto dump", "Shift-D", monitor.isMonitored(sp), true, left_margin);
215+
int y = dims.y2 - 7;
216+
217+
int links = 0;
218+
links += sp->links.give_to_pile.size();
219+
links += sp->links.take_from_pile.size();
220+
links += sp->links.give_to_workshop.size();
221+
links += sp->links.take_from_workshop.size();
222+
bool state = monitor.isMonitored(sp);
223+
224+
if (links + 12 >= y) {
225+
y = dims.y2;
226+
OutputString(COLOR_WHITE, x, y, "Auto: ");
227+
OutputString(COLOR_LIGHTRED, x, y, "D");
228+
OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "ump ");
229+
} else {
230+
OutputToggleString(x, y, "Auto dump", "D", state, true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
231+
}
218232
}
219233
};
220234

plugins/automelt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ struct melt_hook : public df::viewscreen_dwarfmodest
237237
if (links + 12 >= y) {
238238
y = dims.y2;
239239
OutputString(COLOR_WHITE, x, y, "Auto: ");
240+
x += 5;
240241
OutputString(COLOR_LIGHTRED, x, y, "M");
241242
OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "elt ");
242243
} else {

plugins/autotrade.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ struct trade_hook : public df::viewscreen_dwarfmodest
432432
if (links + 12 >= y) {
433433
y = dims.y2;
434434
OutputString(COLOR_WHITE, x, y, "Auto: ");
435-
x += 5;
435+
x += 11;
436436
OutputString(COLOR_LIGHTRED, x, y, "T");
437437
OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "rade ");
438438
} else {

0 commit comments

Comments
 (0)