Skip to content

Commit

Permalink
Add health rating value to health advisor
Browse files Browse the repository at this point in the history
- Also add "Disease surveillance" subtitle to make clearer that city_health (which is global) and sickness_level (which fetches the house with the higher sickness value in the city) are somewhat independent under some circumstances.
- Thanks to Awatibala/dvincent56 for the proofreading.
  • Loading branch information
Ouaz committed Jan 23, 2024
1 parent 1cef2eb commit 93d916a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ static translation_string all_strings[] = {
{TR_BUILDING_HOUSE_DISEASE_DESC, "Pestilence has struck! Without adequate healthcare, residents dwelling here have died. This house is in quarantine while a doctor or surgeon decontaminates the area."},
{TR_BUILDING_FUMIGATION_DESC, "The building is being cleansed of disease. The fumigation should last a few days."},
{TR_OVERLAY_SICKNESS, "Sickness"},
{TR_ADVISOR_HEALTH_RATING, "Rating:"},
{TR_ADVISOR_HEALTH_SURVEILLANCE, "Disease surveillance:"},
{TR_ADVISOR_SICKNESS_LEVEL_LOW, "Disease is a rare occurrence in the city. The high standard of healthcare provided to the vast majority of residents effectively prevents epidemics spreading here."},
{TR_ADVISOR_SICKNESS_LEVEL_MEDIUM, "Some infectious diseases have appeared in areas of the city with a lacking hygiene, but the situation is under control. A sufficiently high level of healthcare will mitigate the impact of epidemics in the city."},
{TR_ADVISOR_SICKNESS_LEVEL_HIGH, "Infectious diseases spread in areas of the city having a poor level of hygiene. If the situation is not remedied soon, some buildings may be quarantined. Greater access to healthcare would effectively prevent epidemics from breaking out."},
Expand Down
2 changes: 2 additions & 0 deletions src/translation/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ typedef enum {
TR_BUILDING_HOUSE_DISEASE_DESC,
TR_BUILDING_FUMIGATION_DESC,
TR_OVERLAY_SICKNESS,
TR_ADVISOR_HEALTH_RATING,
TR_ADVISOR_HEALTH_SURVEILLANCE,
TR_ADVISOR_SICKNESS_LEVEL_LOW,
TR_ADVISOR_SICKNESS_LEVEL_MEDIUM,
TR_ADVISOR_SICKNESS_LEVEL_HIGH,
Expand Down
7 changes: 7 additions & 0 deletions src/window/advisor/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ static int draw_background(void)
int sickness_level = city_health_get_global_sickness_level();

lang_text_draw(56, 0, 60, 12, FONT_LARGE_BLACK);

int x_offset = lang_text_get_width(56, 0, FONT_LARGE_BLACK);
x_offset += lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_HEALTH_RATING, 60 + x_offset, 25, FONT_NORMAL_BLACK);
text_draw_number(city_health(), 0, "", 60 + x_offset, 25, FONT_NORMAL_BLACK, 0);

if (city_population() >= 200) {
lang_text_draw_multiline(56, city_health() / 10 + 16, 60, 46, 512, FONT_NORMAL_BLACK);
} else {
Expand Down Expand Up @@ -89,6 +94,8 @@ static int draw_background(void)

int text_height = lang_text_draw_multiline(56, 7 + get_health_advice(), 60, 210, 512, FONT_NORMAL_BLACK);

lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_HEALTH_SURVEILLANCE, 60, 230 + text_height, FONT_NORMAL_BLACK);
text_height += 17;
text_draw_multiline(translation_for(TR_ADVISOR_SICKNESS_LEVEL_LOW + sickness_level),
60, 230 + text_height, 512, FONT_NORMAL_BLACK, 0);

Expand Down

0 comments on commit 93d916a

Please sign in to comment.