Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/god advisor #1032

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ set(WINDOW_FILES
${PROJECT_SOURCE_DIR}/src/window/editor/start_year.c
${PROJECT_SOURCE_DIR}/src/window/editor/starting_conditions.c
${PROJECT_SOURCE_DIR}/src/window/editor/win_criteria.c
${PROJECT_SOURCE_DIR}/src/window/epithets.c
${PROJECT_SOURCE_DIR}/src/window/cck_selection.c
${PROJECT_SOURCE_DIR}/src/window/city.c
${PROJECT_SOURCE_DIR}/src/window/config.c
Expand Down
1 change: 1 addition & 0 deletions res/assets/Graphics/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<image id="Panth M2 Icon" src="Pantheon_Temple_Complex_Module2_Banner"/>
<image id="Venus M Icon" src="Venus_Temple_Complex_Module_Banner"/>
<image id="Venus M2 Icon" src="Venus_Temple_Complex_Module2_Banner"/>

<!-- Note: Banner images for Construction Sites -->
<image id="Const. Banner 01" src="Construction_Banner_01"/>
<image id="Const. Banner 02" src="Construction_Banner_02"/>
Expand Down
2 changes: 2 additions & 0 deletions src/graphics/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ typedef uint32_t color_t;
#define COLOR_SIDEBAR 0xffbdb592

#define COLOR_BORDER_GREEN 0xfffae094
#define COLOR_BORDER_ORANGE 0xffffb584
#define COLOR_BORDER_RED 0xffac5446
#define COLOR_BORDER_BROWN 0xff684a34

#define COLOR_FONT_RED COLOR_RED
#define COLOR_FONT_BLUE 0xff0055ff
Expand Down
1 change: 1 addition & 0 deletions src/graphics/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef enum {
WINDOW_TRADE_PRICES,
WINDOW_RESOURCE_SETTINGS,
WINDOW_HOLD_FESTIVAL,
WINDOW_EPITHETS,
// empire and dialog
WINDOW_EMPIRE,
WINDOW_TRADE_OPENED,
Expand Down
8 changes: 8 additions & 0 deletions src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,14 @@ static translation_string all_strings[] = {
{TR_EDITOR_CAESAR_SALARY, "Caesar's salary"},
{TR_CITY_MESSAGE_TEXT_CARAVANSERAI_COMPLETE, "The caravanserai is completed. New commercial horizons are emerging. Caravans from all over the world are eager to come and trade in your city."},
{TR_CONFIG_SHOW_DESIRABILITY_RANGE, "Show desirability when building mausoleums and nymphaeums"},
{TR_WINDOW_ADVISOR_EPITHETS, "Gods Epithets"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP, "What the gods can grant you"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_CERES, "Ceres gifts"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_NEPTUNE, "Neptune gifts"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MERCURY, "Mercury gifts"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MARS, "Mars gifts"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_VENUS, "Venus gifts"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_JUPITER, "Jupiter gifts"},
};

void translation_english(const translation_string **strings, int *num_strings)
Expand Down
10 changes: 9 additions & 1 deletion src/translation/french.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,13 +1402,21 @@ static translation_string all_strings[] = {
{TR_WINDOW_CAMPAIGN_NO_DESC, "Pas de description"},
{TR_WINDOW_ORIGINAL_CAMPAIGN_NAME, "Campagne d'origine" },
{TR_WINDOW_ORIGINAL_CAMPAIGN_DESC, "Campagne originelle de Caesar III, dans toute sa gloire d'antan et ses 25 ans d'âge."},
{TR_WINDOW_INVALID_CAMPAIGN_TITLE, "Fichier de campagne invalide" },
{TR_WINDOW_INVALID_CAMPAIGN_TITLE, "Fichier de campagne invalide" },
{TR_WINDOW_INVALID_CAMPAIGN_TEXT, "Le fichier de campagne est invalide.\nVeuillez consulter augustus-log.txt dans votre répertoire Augustus pour plus de détails."},
{TR_WINDOW_CAMPAIGN_MISSION_FAILED_TO_LOAD_TITLE, "Impossible d'ouvrir la mission"},
{TR_WINDOW_CAMPAIGN_MISSION_FAILED_TO_LOAD_TEXT, "La mission choisie ne peut être ouverte.\nVeuillez consulter augustus-log.txt dans votre répertoire Augustus pour plus de détails."},
{TR_EDITOR_CAESAR_SALARY, "Salaire de Caesar"},
{TR_CITY_MESSAGE_TEXT_CARAVANSERAI_COMPLETE, "Le caravanserail est achevé. De nouveaux horizons commerciaux se profilent. Les caravanes des quatre coins du monde sont enthousiastes à l'idée de venir commercer dans votre cité."},
{TR_CONFIG_SHOW_DESIRABILITY_RANGE , "Voir l'attrait des mausolées et des nymphées lors du placement"},
{TR_WINDOW_ADVISOR_EPITHETS, "Epithètes des dieux"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP, "Ce que les dieux peuvent vous accorder"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_CERES, "Dons de Ceres"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_NEPTUNE, "Dons de Neptune"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MERCURY, "Dons de Mercury"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MARS, "Dons de Mars"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_VENUS, "Dons de Venus"},
{TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_JUPITER, "Dons de Jupiter"},
};

void translation_french(const translation_string **strings, int *num_strings)
Expand Down
10 changes: 9 additions & 1 deletion src/translation/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ typedef enum {
TR_BUILDING_OVERGROWN_GARDENS,
TR_WINDOW_ADVISOR_RELIGION_ALTARS_HEADER,
TR_REPLAY_MAP_NOT_FOUND_TITLE,
TR_REPLAY_MAP_NOT_FOUND_MESSAGE,
TR_REPLAY_MAP_NOT_FOUND_MESSAGE,
TR_BUILDING_FORT_AUXILIA_INFANTRY,
TR_WINDOW_ADVISOR_MILITARY_INFANTRY,
TR_TOOLTIP_BUTTON_ROADBLOCK_ORDER_ACCEPT_ALL,
Expand Down Expand Up @@ -1410,6 +1410,14 @@ typedef enum {
TR_EDITOR_CAESAR_SALARY,
TR_CITY_MESSAGE_TEXT_CARAVANSERAI_COMPLETE,
TR_CONFIG_SHOW_DESIRABILITY_RANGE,
TR_WINDOW_ADVISOR_EPITHETS,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_CERES,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_NEPTUNE,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MERCURY,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_MARS,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_VENUS,
TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP_JUPITER,
TRANSLATION_MAX_KEY
} translation_key;

Expand Down
2 changes: 1 addition & 1 deletion src/window/advisor/military.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void button_empire_service(int legion_id, int param2);
static void button_return_all_to_fort(int param1, int param2);
static void on_scroll(void);

static scrollbar_type scrollbar = { 592, 70, 272, 576, MAX_VISIBLE_LEGIONS, on_scroll };
static scrollbar_type scrollbar = { 592, 70, 270, 576, MAX_VISIBLE_LEGIONS, on_scroll, 0, 4};

static generic_button fort_buttons[] = {
{384, 83, 30, 30, button_go_to_legion, button_none, 1, 0},
Expand Down
18 changes: 16 additions & 2 deletions src/window/advisor/religion.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
#include "graphics/panel.h"
#include "graphics/text.h"
#include "window/hold_festival.h"
#include "window/epithets.h"

static void button_hold_festival(int param1, int param2);
static void button_epithets(int param1, int param2);

static generic_button hold_festival_button[] = {
{102, 340, 300, 20, button_hold_festival, button_none, 0, 0},
{590, 20, 32, 24, button_epithets, button_none, 0, 1}
};

static int focus_button_id;
Expand Down Expand Up @@ -170,11 +173,15 @@ static void draw_foreground(void)
if (!city_festival_is_planned()) {
button_border_draw(102, 335, 300, 20, focus_button_id == 1);
}

button_border_draw(590, 20, 32, 24, focus_button_id == 2);

image_draw(982, 594, 24, COLOR_MASK_NONE, SCALE_NONE);
}

static int handle_mouse(const mouse *m)
{
return generic_buttons_handle_mouse(m, 0, 0, hold_festival_button, 1, &focus_button_id);
return generic_buttons_handle_mouse(m, 0, 0, hold_festival_button, 2, &focus_button_id);
}

static void button_hold_festival(int param1, int param2)
Expand All @@ -184,10 +191,17 @@ static void button_hold_festival(int param1, int param2)
}
}

static void button_epithets(int param1, int param2)
{
window_epithets_show();
}

static void get_tooltip_text(advisor_tooltip_result *r)
{
if (focus_button_id) {
if (focus_button_id == 1) {
r->text_id = 112;
} else if (focus_button_id == 2) {
r->translation_key = TR_WINDOW_ADVISOR_EPITHETS_TOOLTIP;
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/window/advisor/trade.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ static int draw_background(void)
button_border_draw(160, 392, 200, 24, data.focus_button_id == 2);
lang_text_draw_centered(54, 30, 160, 398, 200, FONT_NORMAL_BLACK);

if (data.list.size > MAX_VISIBLE_ROWS) {
inner_panel_draw(scrollbar.x + 4, scrollbar.y + 28, 2, scrollbar.height / BLOCK_SIZE - 3);
}

int land_policy_available = building_monument_working(BUILDING_CARAVANSERAI);
int sea_policy_available = building_monument_working(BUILDING_LIGHTHOUSE);

Expand Down
12 changes: 6 additions & 6 deletions src/window/building/culture.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,18 +947,18 @@ void window_building_draw_colosseum_background(building_info_context *c)
window_building_draw_employment(c, 138);
window_building_draw_risks(c, c->x_offset + c->width_blocks * BLOCK_SIZE - 76, c->y_offset + 144);
if (b->data.entertainment.days1 > 0) {
int width = lang_text_draw(74, 8, c->x_offset + 32, c->y_offset + 182, FONT_NORMAL_BROWN);
int width = lang_text_draw(74, 8, c->x_offset + 32, c->y_offset + 188, FONT_NORMAL_BROWN);
lang_text_draw_amount(8, 44, 2 * b->data.entertainment.days1,
c->x_offset + width + 32, c->y_offset + 182, FONT_NORMAL_BROWN);
c->x_offset + width + 32, c->y_offset + 188, FONT_NORMAL_BROWN);
} else {
lang_text_draw(74, 7, c->x_offset + 32, c->y_offset + 182, FONT_NORMAL_BROWN);
lang_text_draw(74, 7, c->x_offset + 32, c->y_offset + 188, FONT_NORMAL_BROWN);
}
if (b->data.entertainment.days2 > 0) {
int width = lang_text_draw(74, 10, c->x_offset + 32, c->y_offset + 202, FONT_NORMAL_BROWN);
int width = lang_text_draw(74, 10, c->x_offset + 32, c->y_offset + 208, FONT_NORMAL_BROWN);
lang_text_draw_amount(8, 44, 2 * b->data.entertainment.days2,
c->x_offset + width + 32, c->y_offset + 202, FONT_NORMAL_BROWN);
c->x_offset + width + 32, c->y_offset + 208, FONT_NORMAL_BROWN);
} else {
lang_text_draw(74, 9, c->x_offset + 32, c->y_offset + 202, FONT_NORMAL_BROWN);
lang_text_draw(74, 9, c->x_offset + 32, c->y_offset + 208, FONT_NORMAL_BROWN);
}

if (b->type == BUILDING_ARENA) {
Expand Down
Loading
Loading