Recalculate size after toggling columns (goals can be longer than professions)

develop
lethosor 2020-08-08 00:45:57 -04:00
parent 6a1f046995
commit a28e939370
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 3 additions and 2 deletions

@ -1769,7 +1769,7 @@ void viewscreen_unitlaborsst::feed(set<df::interface_key> *events)
std::stable_sort(units.begin(), units.end(), sortBySquad); std::stable_sort(units.begin(), units.end(), sortBySquad);
} else if (detail_mode == DETAIL_MODE_JOB) { } else if (detail_mode == DETAIL_MODE_JOB) {
std::stable_sort(units.begin(), units.end(), sortByJob); std::stable_sort(units.begin(), units.end(), sortByJob);
} else if (detail_mode == DETAIL_MODE_PROFESSION){ } else if (detail_mode == DETAIL_MODE_PROFESSION) {
std::stable_sort(units.begin(), units.end(), sortByProfession); std::stable_sort(units.begin(), units.end(), sortByProfession);
} else { } else {
std::stable_sort(units.begin(), units.end(), sortByGoal); std::stable_sort(units.begin(), units.end(), sortByGoal);
@ -1818,6 +1818,7 @@ void viewscreen_unitlaborsst::feed(set<df::interface_key> *events)
} else { } else {
detail_mode = DETAIL_MODE_PROFESSION; detail_mode = DETAIL_MODE_PROFESSION;
} }
calcSize();
} }
if (events->count(interface_key::CUSTOM_SHIFT_X)) if (events->count(interface_key::CUSTOM_SHIFT_X))
@ -2202,7 +2203,7 @@ void viewscreen_unitlaborsst::render()
OutputString(15, x, y, "Squad"); OutputString(15, x, y, "Squad");
} else if (detail_mode == DETAIL_MODE_JOB) { } else if (detail_mode == DETAIL_MODE_JOB) {
OutputString(15, x, y, "Job"); OutputString(15, x, y, "Job");
} else if (detail_mode == DETAIL_MODE_PROFESSION){ } else if (detail_mode == DETAIL_MODE_PROFESSION) {
OutputString(15, x, y, "Profession"); OutputString(15, x, y, "Profession");
} else { } else {
OutputString(15, x, y, "Goal"); OutputString(15, x, y, "Goal");