Skip to content

Commit

Permalink
Fix some issues with aux infantry
Browse files Browse the repository at this point in the history
  • Loading branch information
Keriew committed Jan 31, 2024
1 parent 5e864ed commit 6dfee44
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,7 @@ static translation_string all_strings[] = {
{TR_REPLAY_MAP_NOT_FOUND_TITLE, "Unable to replay map"},
{TR_REPLAY_MAP_NOT_FOUND_MESSAGE, "The original map file for this saved game was not found.\nYou need the following file with either a .map or .mapx extension:"},
{TR_BUILDING_FORT_AUXILIA_INFANTRY, "Auxiliaries - Infantry"},
{TR_WINDOW_ADVISOR_MILITARY_INFANTRY, "Infantrymen"}
};

void translation_english(const translation_string **strings, int *num_strings)
Expand Down
1 change: 1 addition & 0 deletions src/translation/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ typedef enum {
TR_REPLAY_MAP_NOT_FOUND_TITLE,
TR_REPLAY_MAP_NOT_FOUND_MESSAGE,
TR_BUILDING_FORT_AUXILIA_INFANTRY,
TR_WINDOW_ADVISOR_MILITARY_INFANTRY,
TRANSLATION_MAX_KEY
} translation_key;

Expand Down
3 changes: 3 additions & 0 deletions src/window/advisor/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ static int draw_background(void)
case FIGURE_FORT_JAVELIN:
lang_text_draw(138, 35, 84 + width, 100 + 44 * i, FONT_NORMAL_GREEN);
break;
case FIGURE_FORT_INFANTRY:
text_draw(translation_for(TR_WINDOW_ADVISOR_MILITARY_INFANTRY), 84 + width, 100 + 44 * i, FONT_NORMAL_GREEN, 0);
break;
}
int morale_offset = m->morale / 5;
if (morale_offset > 20) {
Expand Down
10 changes: 8 additions & 2 deletions src/window/building/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,18 @@ void window_building_draw_legion_info(building_info_context *c)
flag_image_id += 9;
} else if (m->figure_type == FIGURE_FORT_MOUNTED) {
flag_image_id += 18;
} else if (m->figure_type == FIGURE_FORT_INFANTRY) {
flag_image_id = assets_get_image_id("Military", "auxinf_banner_0");
}
if (m->is_halted) {
flag_image_id += 8;
}
if (m->figure_type == FIGURE_FORT_INFANTRY) {
if (m->is_halted) {
flag_image_id = assets_get_image_id("Military", "auxinf_banner_0");
} else {
flag_image_id = assets_get_image_id("Military", "auxinf_banner_01");
}
}

const image *flag_image = image_get(flag_image_id);
int flag_height = flag_image->height;
image_draw(flag_image_id, c->x_offset + 16 + (40 - flag_image->width - flag_image->x_offset) / 2,
Expand Down

0 comments on commit 6dfee44

Please sign in to comment.