From 244fda94e4a47cb30931b24303e71cc4f64cc378 Mon Sep 17 00:00:00 2001 From: Ouaz Date: Thu, 4 Jan 2024 19:00:37 +0100 Subject: [PATCH] Add a "No Employees" line for Caravanserai and Supply Post --- src/translation/english.c | 2 ++ src/translation/translation.h | 2 ++ src/window/building/distribution.c | 16 ++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/translation/english.c b/src/translation/english.c index 0dabc65d18..b81b926281 100644 --- a/src/translation/english.c +++ b/src/translation/english.c @@ -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."}, @@ -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)" }, diff --git a/src/translation/translation.h b/src/translation/translation.h index 060d00135b..b227bdd569 100644 --- a/src/translation/translation.h +++ b/src/translation/translation.h @@ -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, @@ -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, diff --git a/src/window/building/distribution.c b/src/window/building/distribution.c index eddf438396..acf0bd707d 100644 --- a/src/window/building/distribution.c +++ b/src/window/building/distribution.c @@ -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), @@ -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),