1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 23:04:36 +01:00

allow translation of unit and date strings, closes #307

This commit is contained in:
IntelOrca
2015-02-09 12:53:11 +00:00
parent ee51f31f57
commit 7ea809492a
4 changed files with 124 additions and 88 deletions

View File

@@ -477,20 +477,16 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
y = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + w->y + 2;
// Date
char *freeStr = (char*)0x009BC677;
freeStr[0] = FORMAT_STRINGID;
freeStr[1] = ' ';
freeStr[2] = FORMAT_MONTHYEAR;
freeStr[3] = 0;
int month = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7;
int year = date_get_year(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16)) + 1;
int month = date_get_month(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7);
int day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) * days_in_month[month]) >> 16) & 0xFF;
RCT2_GLOBAL(0x013CE952, short) = STR_DATE_DAY_1 + day;
RCT2_GLOBAL(0x013CE954, short) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16);
RCT2_GLOBAL(0x013CE954, short) = month;
RCT2_GLOBAL(0x013CE956, short) = year;
gfx_draw_string_centred(
dpi,
3165,
2737,
x,
y,
(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WINDOWCLASS, rct_windowclass) == 2 && RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WIDGETINDEX, sint32) == WIDX_DATE ? 2 : w->colours[0] & 0x7F),