Merging automelt hotkey into autotrade line when links intrude.

The new interface looks significantly different, but only when there are too many stockpile links to show the lines in their usual places.
The difference between bright green and grey should be obvious most of the time, right?
develop
Eric Wald 2014-09-09 21:08:38 -06:00
parent 8bc2f02aee
commit e76b8c4b6b
2 changed files with 26 additions and 5 deletions

@ -211,7 +211,21 @@ struct melt_hook : public df::viewscreen_dwarfmodest
int x = left_margin;
int y = dims.y2 - 6;
OutputToggleString(x, y, "Auto melt", "M", monitor.isMonitored(sp), true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
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, "M");
OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "elt ");
} else {
OutputToggleString(x, y, "Auto melt", "M", state, true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
}
}
};

@ -428,10 +428,17 @@ struct trade_hook : public df::viewscreen_dwarfmodest
links += sp->links.take_from_pile.size();
links += sp->links.give_to_workshop.size();
links += sp->links.take_from_workshop.size();
if (links + 12 >= y)
y += 5;
OutputToggleString(x, y, "Auto trade", "T", monitor.isMonitored(sp), true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
bool state = monitor.isMonitored(sp);
if (links + 12 >= y) {
y = dims.y2;
OutputString(COLOR_WHITE, x, y, "Auto: ");
x += 5;
OutputString(COLOR_LIGHTRED, x, y, "T");
OutputString(state? COLOR_LIGHTGREEN: COLOR_GREY, x, y, "rade ");
} else {
OutputToggleString(x, y, "Auto trade", "T", state, true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
}
}
};