Skip to content

Commit

Permalink
Fix UI indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenikus8 committed Jan 26, 2025
1 parent 73f02b0 commit 1d9ec0e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
10 changes: 5 additions & 5 deletions src/window/advisor/entertainment.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ static int draw_background(void)

// colosseums
int has_colosseum = building_count_active(BUILDING_COLOSSEUM) ? 1 : 0;
lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_NO_ACTIVE_COLOSSEUM + has_colosseum, 40, 143, FONT_NORMAL_WHITE);
lang_text_draw_centered(57, has_colosseum ? 21 : 10, COVERAGE_OFFSET, 143, COVERAGE_WIDTH, FONT_NORMAL_WHITE);
lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_NO_ACTIVE_COLOSSEUM + has_colosseum, 45, 145, FONT_NORMAL_WHITE);
lang_text_draw_centered(57, has_colosseum ? 21 : 10, COVERAGE_OFFSET, 145, COVERAGE_WIDTH, FONT_NORMAL_WHITE);

// hippodromes
int has_hippodrome = building_count_active(BUILDING_HIPPODROME) ? 1 : 0;
lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_NO_ACTIVE_HIPPODROME + has_hippodrome, 40, 163, FONT_NORMAL_WHITE);
lang_text_draw_centered(57, has_hippodrome ? 21 : 10, COVERAGE_OFFSET, 163, COVERAGE_WIDTH, FONT_NORMAL_WHITE);
lang_text_draw(CUSTOM_TRANSLATION, TR_ADVISOR_NO_ACTIVE_HIPPODROME + has_hippodrome, 45, 165, FONT_NORMAL_WHITE);
lang_text_draw_centered(57, has_hippodrome ? 21 : 10, COVERAGE_OFFSET, 165, COVERAGE_WIDTH, FONT_NORMAL_WHITE);

lang_text_draw_multiline(58, 7 + get_entertainment_advice(), 60, 198, 512, FONT_NORMAL_BLACK);
lang_text_draw_multiline(58, 7 + get_entertainment_advice(), 52, 208, 530, FONT_NORMAL_BLACK);

draw_games_info();

Expand Down
42 changes: 21 additions & 21 deletions src/window/advisor/religion.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ static void draw_god_row(god_type god, int y_offset, building_type altar, buildi
{
lang_text_draw(59, 11 + god, 24, y_offset, FONT_NORMAL_WHITE);
lang_text_draw(59, 16 + god, 104, y_offset + 1, FONT_SMALL_PLAIN);
text_draw_number_centered(building_count_total(altar), 186, y_offset, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_active(small_temple), 246, y_offset, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_total(altar), 190, y_offset, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_active(small_temple), 250, y_offset, 50, FONT_NORMAL_WHITE);
if (building_count_active(grand_temple)) {
text_draw_number_centered(building_count_active(large_temple) + building_count_active(grand_temple),
306, y_offset, 50, FONT_NORMAL_GREEN);
310, y_offset, 50, FONT_NORMAL_GREEN);
} else {
text_draw_number_centered(building_count_active(large_temple), 306, y_offset, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_active(large_temple), 310, y_offset, 50, FONT_NORMAL_WHITE);
}
text_draw_number_centered(city_god_months_since_festival(god), 376, y_offset, 50, FONT_NORMAL_WHITE);
int width = lang_text_draw(59, 32 + city_god_happiness(god) / 10, 476, y_offset, FONT_NORMAL_WHITE);
text_draw_number_centered(city_god_months_since_festival(god), 380, y_offset, 50, FONT_NORMAL_WHITE);
int width = lang_text_draw(59, 32 + city_god_happiness(god) / 10, 470, y_offset, FONT_NORMAL_WHITE);
int bolts = city_god_wrath_bolts(god);
for (int i = 0; i < bolts / 10; i++) {
image_draw(image_group(GROUP_GOD_BOLT), 10 * i + width + 476, y_offset - 4, COLOR_MASK_NONE, SCALE_NONE);
image_draw(image_group(GROUP_GOD_BOLT), 10 * i + width + 470, y_offset - 4, COLOR_MASK_NONE, SCALE_NONE);
}
int happy_bolts = city_god_happy_bolts(god);
for (int i = 0; i < happy_bolts; i++) {
image_draw(assets_get_image_id("UI", "Happy God Icon"),
10 * i + width + 476, y_offset - 4, COLOR_MASK_NONE, SCALE_NONE);
10 * i + width + 470, y_offset - 4, COLOR_MASK_NONE, SCALE_NONE);
}
}

Expand All @@ -74,12 +74,12 @@ static void draw_oracle_row(void)
int large_oracle_count = building_count_active(BUILDING_NYMPHAEUM) +
building_count_active(BUILDING_PANTHEON) + building_count_active(BUILDING_LARGE_MAUSOLEUM);
lang_text_draw(59, 8, 24, 166, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_total(BUILDING_LARARIUM), 186, 166, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(oracle_count, 246, 166, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(building_count_total(BUILDING_LARARIUM), 190, 166, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(oracle_count, 250, 166, 50, FONT_NORMAL_WHITE);
if (building_count_active(BUILDING_PANTHEON)) {
text_draw_number_centered(large_oracle_count, 306, 166, 50, FONT_NORMAL_GREEN);
text_draw_number_centered(large_oracle_count, 310, 166, 50, FONT_NORMAL_GREEN);
} else {
text_draw_number_centered(large_oracle_count, 306, 166, 50, FONT_NORMAL_WHITE);
text_draw_number_centered(large_oracle_count, 310, 166, 50, FONT_NORMAL_WHITE);
}
}

Expand Down Expand Up @@ -130,14 +130,14 @@ static int draw_background(void)
lang_text_draw(59, 0, 60, 12, FONT_LARGE_BLACK);

// table header
text_draw(translation_for(TR_WINDOW_ADVISOR_RELIGION_ALTARS_HEADER), 196, 46, FONT_SMALL_PLAIN, 0);
lang_text_draw(59, 5, 286, 32, FONT_SMALL_PLAIN);
lang_text_draw(59, 1, 256, 46, FONT_SMALL_PLAIN);
lang_text_draw(59, 2, 316, 46, FONT_SMALL_PLAIN);
lang_text_draw(59, 3, 466, 46, FONT_SMALL_PLAIN);
lang_text_draw(59, 6, 386, 18, FONT_SMALL_PLAIN);
lang_text_draw(59, 9, 386, 32, FONT_SMALL_PLAIN);
lang_text_draw(59, 7, 386, 46, FONT_SMALL_PLAIN);
text_draw(translation_for(TR_WINDOW_ADVISOR_RELIGION_ALTARS_HEADER), 195, 46, FONT_SMALL_PLAIN, 0);
lang_text_draw(59, 5, 277, 32, FONT_SMALL_PLAIN); //Temples
lang_text_draw(59, 1, 255, 46, FONT_SMALL_PLAIN); //Small
lang_text_draw(59, 2, 320, 46, FONT_SMALL_PLAIN); //large
lang_text_draw(59, 6, 385, 18, FONT_SMALL_PLAIN); //Months
lang_text_draw(59, 9, 385, 32, FONT_SMALL_PLAIN); //since
lang_text_draw(59, 7, 385, 46, FONT_SMALL_PLAIN); //Festival
lang_text_draw(59, 3, 470, 46, FONT_SMALL_PLAIN); //The gods are

inner_panel_draw(16, 60, 38, 8);

Expand All @@ -158,7 +158,7 @@ static int draw_background(void)

city_gods_calculate_least_happy();

lang_text_draw_multiline(59, 21 + get_religion_advice(), 60, 208, 512, FONT_NORMAL_BLACK);
lang_text_draw_multiline(59, 21 + get_religion_advice(), 52, 208, 530, FONT_NORMAL_BLACK);

draw_festival_info();

Expand Down
30 changes: 15 additions & 15 deletions src/window/building/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static struct {
static void draw_priority_buttons(int x, int y, unsigned int buttons, int building_id)
{
int base_priority_image_id = assets_get_image_id("UI", "Barracks_Priority_Legionaries_OFF");
data.building_id = building_id;
data.building_id = building_id;

for (unsigned int i = 0; i < buttons; i++) {
int has_focus = 0;
Expand All @@ -89,13 +89,13 @@ static void draw_priority_buttons(int x, int y, unsigned int buttons, int buildi
}

static void draw_delivery_buttons(int x, int y, int building_id)
{
{
data.building_id = building_id;

building *barracks = building_get(data.building_id);

int accept_delivery = barracks->accepted_goods[RESOURCE_WEAPONS];

if (!accept_delivery) {
inner_panel_draw(x + 2, y + 2, 3, 3);
}
Expand All @@ -106,7 +106,7 @@ static void draw_delivery_buttons(int x, int y, int building_id)
image_draw(assets_get_image_id("UI", "Large_Widget_Cross"), x + 15, y + 15,
COLOR_MASK_NONE, SCALE_NONE);
}

button_border_draw(x, y, 52, 52, data.focus_delivery_button_id || !accept_delivery ? 1 : 0);
}

Expand Down Expand Up @@ -199,7 +199,7 @@ void window_building_draw_barracks(building_info_context *c)

lang_text_draw(CUSTOM_TRANSLATION, TR_WINDOW_BARRACKS_PRIORITY,
c->x_offset + 32, c->y_offset + 170, FONT_NORMAL_BLACK); // "Priority"

inner_panel_draw(c->x_offset + 16, c->y_offset + 290, c->width_blocks - 2, 4);
window_building_draw_employment(c, 294);
window_building_draw_risks(c, c->x_offset + c->width_blocks * BLOCK_SIZE - 76, c->y_offset + 298);
Expand Down Expand Up @@ -230,9 +230,9 @@ void window_building_draw_delivery_buttons(int x, int y, int building_id)
int window_building_handle_mouse_barracks(const mouse *m, building_info_context *c)
{
if (generic_buttons_handle_mouse(m, c->x_offset + 46, c->y_offset + 222,
priority_buttons, 7, &data.focus_priority_button_id) ||
priority_buttons, 7, &data.focus_priority_button_id) ||
generic_buttons_handle_mouse(m, c->x_offset + 392, c->y_offset + 40,
delivery_buttons, 1, &data.focus_delivery_button_id)) {
delivery_buttons, 1, &data.focus_delivery_button_id)) {
window_invalidate();
return 1;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ void window_building_draw_fort(building_info_context *c)
image_draw(assets_get_image_id("UI", "Fort_Banner_01"),
c->x_offset + 37, c->y_offset + 195, COLOR_MASK_NONE, SCALE_NONE);
image_draw_border(assets_get_image_id("UI", "Large_Banner_Border"),
c->x_offset + 32, c->y_offset + 190 , COLOR_MASK_NONE);
c->x_offset + 32, c->y_offset + 190, COLOR_MASK_NONE);
}

void window_building_draw_legion_info(building_info_context *c)
Expand Down Expand Up @@ -415,13 +415,13 @@ void window_building_draw_legion_info(building_info_context *c)
// food warnings
if (m->mess_hall_max_morale_modifier < -20) {
text_draw_centered(translation_for(TR_BUILDING_LEGION_FOOD_WARNING_2),
c->x_offset + 20, c->y_offset + 360, c->width_blocks * 16 - 40, FONT_NORMAL_PLAIN, COLOR_FONT_RED);
c->x_offset + 20, c->y_offset + 355, c->width_blocks * 16 - 40, FONT_NORMAL_PLAIN, COLOR_FONT_RED);
} else if (m->mess_hall_max_morale_modifier < -5) {
text_draw_centered(translation_for(TR_BUILDING_LEGION_FOOD_WARNING_1),
c->x_offset + 20, c->y_offset + 360, c->width_blocks * 16 - 40, FONT_NORMAL_BLACK, 0);
c->x_offset + 20, c->y_offset + 355, c->width_blocks * 16 - 40, FONT_NORMAL_BLACK, 0);
} else if (m->mess_hall_max_morale_modifier > 0) {
text_draw_centered(translation_for(TR_BUILDING_LEGION_FOOD_BONUS),
c->x_offset + 20, c->y_offset + 360, c->width_blocks * 16 - 40, FONT_NORMAL_BLACK, 0);
c->x_offset + 20, c->y_offset + 355, c->width_blocks * 16 - 40, FONT_NORMAL_BLACK, 0);
}

if (m->num_figures) {
Expand Down Expand Up @@ -576,9 +576,9 @@ void window_building_draw_legion_info_foreground(building_info_context *c)

if (!m->is_at_fort && !m->in_distant_battle) {
button_border_draw(c->x_offset + BLOCK_SIZE * (c->width_blocks - 18) / 2,
c->y_offset + BLOCK_SIZE * c->height_blocks - 48, 288, 32, data.return_button_id == 1);
c->y_offset + 2 + BLOCK_SIZE * c->height_blocks - 48, 288, 32, data.return_button_id == 1);
lang_text_draw_centered(138, 58, c->x_offset + BLOCK_SIZE * (c->width_blocks - 18) / 2,
c->y_offset + BLOCK_SIZE * c->height_blocks - 39, 288, FONT_NORMAL_BLACK);
c->y_offset + 2 + BLOCK_SIZE * c->height_blocks - 39, 288, FONT_NORMAL_BLACK);
}
}

Expand Down Expand Up @@ -700,13 +700,13 @@ static void button_layout(int index, int param2)
static void button_priority(int index, int param2)
{
building *barracks = building_get(data.building_id);
building_barracks_set_priority(barracks, index);
building_barracks_set_priority(barracks, index);
}

static void button_delivery(int index, int param2)
{
building *barracks = building_get(data.building_id);
building_barracks_toggle_delivery(barracks);
building_barracks_toggle_delivery(barracks);
}

void window_building_draw_watchtower(building_info_context *c)
Expand Down

0 comments on commit 1d9ec0e

Please sign in to comment.