Skip to content

Commit 45da6fd

Browse files
committed
Add speedrun difficulty info
1 parent 9748444 commit 45da6fd

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/core/config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static const char *ini_keys[] = {
1616
"gameplay_fix_100y_ghosts",
1717
"screen_display_scale",
1818
"screen_cursor_scale",
19+
"screen_display_speedrun_infos",
1920
"ui_sidebar_info",
2021
"ui_show_intro_video",
2122
"ui_smooth_scrolling",

src/core/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ typedef enum {
88
CONFIG_GP_FIX_100_YEAR_GHOSTS,
99
CONFIG_SCREEN_DISPLAY_SCALE,
1010
CONFIG_SCREEN_CURSOR_SCALE,
11+
CONFIG_SCREEN_DISPLAY_SPEEDRUN_INFOS,
1112
CONFIG_UI_SIDEBAR_INFO,
1213
CONFIG_UI_SHOW_INTRO_VIDEO,
1314
CONFIG_UI_SMOOTH_SCROLLING,

src/window/city.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,23 @@ static void draw_time_left(void)
9292
}
9393
}
9494

95+
static void draw_speedrun_infos(void)
96+
{
97+
if (config_get(CONFIG_SCREEN_DISPLAY_SPEEDRUN_INFOS)) {
98+
int x, y, width, height;
99+
city_view_get_viewport(&x, &y, &width, &height);
100+
101+
large_label_draw(x, height, 10, 0);
102+
lang_text_draw_centered(153, setting_difficulty() + 1, x + 4, height + 8, 150, FONT_NORMAL_WHITE);
103+
}
104+
}
105+
95106
static void draw_foreground(void)
96107
{
97108
widget_top_menu_draw(0);
98109
window_city_draw();
99110
widget_sidebar_city_draw_foreground();
111+
draw_speedrun_infos();
100112
if (window_is(WINDOW_CITY) || window_is(WINDOW_CITY_MILITARY)) {
101113
draw_time_left();
102114
if (mouse_get()->is_touch) {

0 commit comments

Comments
 (0)