Skip to content

Commit

Permalink
Add a "No Employees" line for Caravanserai and Supply Post
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouaz committed Jan 4, 2024
1 parent d9aca99 commit 244fda9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ static translation_string all_strings[] = {
{TR_BUILDING_MESS_HALL_FOOD_TYPES_BONUS_2, "The diverse, nutritious diet enjoyed by your soldiers greatly increases morale."},
{TR_BUILDING_MESS_HALL_NO_SOLDIERS, "You have no soldiers to feed." },
{TR_BUILDING_MESS_HALL_MONTHS_FOOD_STORED, "Months of food stored:" },
{TR_BUILDING_MESS_HALL_NO_EMPLOYEES, "This supply post has no employees. Food can't be collected." },
{TR_BUILDING_MESS_HALL_NO_FOOD, "This supply post has employees, but they are currently looking for an available source of food." },
{TR_MESS_HALL_SPECIAL_ORDERS_HEADER, "Supply post instructions"},
{TR_BUILDING_BARRACKS_FOOD_WARNING, "Food shortages at your supply post are slowing soldier recruitment."},
Expand Down Expand Up @@ -420,6 +421,7 @@ static translation_string all_strings[] = {
{TR_BUILDING_CARAVANSERAI_POLICY_2, "Landed buyer's policy: Land imports are 20% cheaper, but land exports earn 10% less." },
{TR_BUILDING_CARAVANSERAI_POLICY_3_TITLE, "Consilium quantitas terrae" },
{TR_BUILDING_CARAVANSERAI_POLICY_3, "Landed quantity policy: Trade caravans carry 4 additional goods, but the Caravanserai consumes 20% more food." },
{TR_BUILDING_CARAVANSERAI_NO_EMPLOYEES, "This caravanserai has no employees. Food can't be collected." },
{TR_BUILDING_CARAVANSERAI_NO_FOOD, "This caravanserai has employees, but they are currently looking for an available source of food." },
{TR_BUILDING_LIGHTHOUSE_PHASE_1, "(Foundation)" },
{TR_BUILDING_LIGHTHOUSE_PHASE_2, "(Pedestal)" },
Expand Down
2 changes: 2 additions & 0 deletions src/translation/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ typedef enum {
TR_BUILDING_MESS_HALL_FOOD_TYPES_BONUS_2,
TR_BUILDING_MESS_HALL_NO_SOLDIERS,
TR_BUILDING_MESS_HALL_MONTHS_FOOD_STORED,
TR_BUILDING_MESS_HALL_NO_EMPLOYEES,
TR_BUILDING_MESS_HALL_NO_FOOD,
TR_MESS_HALL_SPECIAL_ORDERS_HEADER,
TR_BUILDING_BARRACKS_FOOD_WARNING,
Expand Down Expand Up @@ -416,6 +417,7 @@ typedef enum {
TR_BUILDING_CARAVANSERAI_POLICY_2,
TR_BUILDING_CARAVANSERAI_POLICY_3_TITLE,
TR_BUILDING_CARAVANSERAI_POLICY_3,
TR_BUILDING_CARAVANSERAI_NO_EMPLOYEES,
TR_BUILDING_CARAVANSERAI_NO_FOOD,
TR_BUILDING_LIGHTHOUSE_PHASE_1,
TR_BUILDING_LIGHTHOUSE_PHASE_2,
Expand Down
16 changes: 10 additions & 6 deletions src/window/building/distribution.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,10 +1366,12 @@ void window_building_draw_mess_hall(building_info_context *c)

text_draw_centered(translation_for(TR_BUILDING_MESS_HALL),
c->x_offset, c->y_offset + 12, BLOCK_SIZE * c->width_blocks, FONT_LARGE_BLACK, 0);
if (food_types > 0) {
draw_food_stocks(c, b, 64);
} else {
if (b->num_workers <= 0 && food_types <= 0) {
window_building_draw_description_at(c, 64, CUSTOM_TRANSLATION, TR_BUILDING_MESS_HALL_NO_EMPLOYEES);
} else if (b->num_workers > 0 && food_types <= 0) {
window_building_draw_description_at(c, 64, CUSTOM_TRANSLATION, TR_BUILDING_MESS_HALL_NO_FOOD);
} else {
draw_food_stocks(c, b, 64);
}
if (city_military_total_soldiers_in_city() > 0) {
int width = text_draw(translation_for(TR_BUILDING_MESS_HALL_FULFILLMENT),
Expand Down Expand Up @@ -1470,10 +1472,12 @@ void window_building_draw_caravanserai(building_info_context *c)

outer_panel_draw(c->x_offset, c->y_offset, c->width_blocks, c->height_blocks);

if (food_types > 0) {
draw_food_stocks(c, b, 44);
} else {
if (b->num_workers <= 0 && food_types <= 0) {
window_building_draw_description_at(c, 44, CUSTOM_TRANSLATION, TR_BUILDING_CARAVANSERAI_NO_EMPLOYEES);
} else if (b->num_workers > 0 && food_types <= 0) {
window_building_draw_description_at(c, 44, CUSTOM_TRANSLATION, TR_BUILDING_CARAVANSERAI_NO_FOOD);
} else {
draw_food_stocks(c, b, 44);
}
if (building_monument_has_labour_problems(b)) {
text_draw_multiline(translation_for(TR_BUILDING_CARAVANSERAI_NEEDS_WORKERS),
Expand Down

0 comments on commit 244fda9

Please sign in to comment.