mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
add two new date formats, y/m/d and y/d/m, closes #1900
This commit is contained in:
@@ -3498,7 +3498,7 @@ STR_5156 :{SMALLFONT}{BLACK}Allows testing of most ride types even when the t
|
|||||||
STR_5157 :Unlock all prices
|
STR_5157 :Unlock all prices
|
||||||
STR_5158 :Quit to menu
|
STR_5158 :Quit to menu
|
||||||
STR_5159 :Exit OpenRCT2
|
STR_5159 :Exit OpenRCT2
|
||||||
STR_5160 :{MONTH} {STRINGID}, Year {COMMA16}
|
STR_5160 :{POP16}{MONTH} {PUSH16}{PUSH16}{STRINGID}, Year {POP16}{COMMA16}
|
||||||
STR_5161 :Date Format:
|
STR_5161 :Date Format:
|
||||||
STR_5162 :Day/Month/Year
|
STR_5162 :Day/Month/Year
|
||||||
STR_5163 :Month/Day/Year
|
STR_5163 :Month/Day/Year
|
||||||
@@ -3887,6 +3887,10 @@ STR_5545 :{SMALLFONT}{BLACK}Dark pink
|
|||||||
STR_5546 :{SMALLFONT}{BLACK}Bright pink
|
STR_5546 :{SMALLFONT}{BLACK}Bright pink
|
||||||
STR_5547 :{SMALLFONT}{BLACK}Light pink
|
STR_5547 :{SMALLFONT}{BLACK}Light pink
|
||||||
STR_5548 :Show all operating modes
|
STR_5548 :Show all operating modes
|
||||||
|
STR_5549 :Year/Month/Day
|
||||||
|
STR_5550 :{POP16}{POP16}Year {COMMA16}, {PUSH16}{PUSH16}{MONTH} {PUSH16}{PUSH16}{STRINGID}
|
||||||
|
STR_5551 :Year/Day/Month
|
||||||
|
STR_5552 :{POP16}{POP16}Year {COMMA16}, {PUSH16}{PUSH16}{PUSH16}{STRINGID} {MONTH}
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Rides/attractions #
|
# Rides/attractions #
|
||||||
|
|||||||
@@ -20,10 +20,24 @@
|
|||||||
|
|
||||||
#include "../addresses.h"
|
#include "../addresses.h"
|
||||||
#include "date.h"
|
#include "date.h"
|
||||||
|
#include "string_ids.h"
|
||||||
|
|
||||||
// rct2: 0x00993988
|
// rct2: 0x00993988
|
||||||
const sint16 days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31 };
|
const sint16 days_in_month[MONTH_COUNT] = { 31, 30, 31, 30, 31, 31, 30, 31 };
|
||||||
|
|
||||||
|
const rct_string_id DateFormatStringIds[] = {
|
||||||
|
STR_DATE_FORMAT_DAY_MONTH_YEAR,
|
||||||
|
STR_DATE_FORMAT_MONTH_DAY_YEAR,
|
||||||
|
STR_DATE_FORMAT_YEAR_MONTH_DAY,
|
||||||
|
STR_DATE_FORMAT_YEAR_DAY_MONTH
|
||||||
|
};
|
||||||
|
|
||||||
|
const rct_string_id DateFormatStringFormatIds[] = {
|
||||||
|
STR_DATE_FORMAT_DMY,
|
||||||
|
STR_DATE_FORMAT_MDY,
|
||||||
|
STR_DATE_FORMAT_YMD,
|
||||||
|
STR_DATE_FORMAT_YDM
|
||||||
|
};
|
||||||
|
|
||||||
int date_get_month(int months)
|
int date_get_month(int months)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,16 @@ enum {
|
|||||||
MONTH_COUNT
|
MONTH_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
DATE_FORMAT_DAY_MONTH_YEAR,
|
||||||
|
DATE_FORMAT_MONTH_DAY_YEAR,
|
||||||
|
DATE_FORMAT_YEAR_MONTH_DAY,
|
||||||
|
DATE_FORMAT_YEAR_DAY_MONTH
|
||||||
|
};
|
||||||
|
|
||||||
extern const sint16 days_in_month[MONTH_COUNT];
|
extern const sint16 days_in_month[MONTH_COUNT];
|
||||||
|
extern const rct_string_id DateFormatStringIds[];
|
||||||
|
extern const rct_string_id DateFormatStringFormatIds[];
|
||||||
|
|
||||||
int date_get_month(int months);
|
int date_get_month(int months);
|
||||||
int date_get_year(int months);
|
int date_get_year(int months);
|
||||||
|
|||||||
@@ -1393,6 +1393,8 @@ enum {
|
|||||||
|
|
||||||
STR_CHEAT_TIP_LARGE_TRAM_GUESTS = 2684,
|
STR_CHEAT_TIP_LARGE_TRAM_GUESTS = 2684,
|
||||||
|
|
||||||
|
STR_DATE_FORMAT_DMY = 2737,
|
||||||
|
|
||||||
STR_ROLLERCOASTER_TYCOON_1_DROPDOWN = 2740,
|
STR_ROLLERCOASTER_TYCOON_1_DROPDOWN = 2740,
|
||||||
STR_ROLLERCOASTER_TYCOON_2_DROPDOWN = 2741,
|
STR_ROLLERCOASTER_TYCOON_2_DROPDOWN = 2741,
|
||||||
|
|
||||||
@@ -1883,6 +1885,11 @@ enum {
|
|||||||
|
|
||||||
STR_CHEAT_UNLOCK_PRICES = 5157,
|
STR_CHEAT_UNLOCK_PRICES = 5157,
|
||||||
|
|
||||||
|
STR_DATE_FORMAT_MDY = 5160,
|
||||||
|
STR_DATE_FORMAT = 5161,
|
||||||
|
STR_DATE_FORMAT_DAY_MONTH_YEAR = 5162,
|
||||||
|
STR_DATE_FORMAT_MONTH_DAY_YEAR = 5163,
|
||||||
|
|
||||||
STR_TWITCH_NAME = 5164,
|
STR_TWITCH_NAME = 5164,
|
||||||
STR_TWITCH_PEEP_FOLLOWERS = 5165,
|
STR_TWITCH_PEEP_FOLLOWERS = 5165,
|
||||||
STR_TWITCH_PEEP_FOLLOWERS_TIP = 5166,
|
STR_TWITCH_PEEP_FOLLOWERS_TIP = 5166,
|
||||||
@@ -2107,6 +2114,11 @@ enum {
|
|||||||
|
|
||||||
STR_CHEAT_SHOW_ALL_OPERATING_MODES = 5548,
|
STR_CHEAT_SHOW_ALL_OPERATING_MODES = 5548,
|
||||||
|
|
||||||
|
STR_DATE_FORMAT_YEAR_MONTH_DAY = 5549,
|
||||||
|
STR_DATE_FORMAT_YMD = 5550,
|
||||||
|
STR_DATE_FORMAT_YEAR_DAY_MONTH = 5551,
|
||||||
|
STR_DATE_FORMAT_YDM = 5552,
|
||||||
|
|
||||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||||
STR_COUNT = 32768
|
STR_COUNT = 32768
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -452,19 +452,14 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
|||||||
int year = date_get_year(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16)) + 1;
|
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 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;
|
int day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) * days_in_month[month]) >> 16) & 0xFF;
|
||||||
if (gConfigGeneral.date_format) {
|
|
||||||
RCT2_GLOBAL(0x013CE952, short) = month;
|
rct_string_id stringId = DateFormatStringFormatIds[gConfigGeneral.date_format];
|
||||||
RCT2_GLOBAL(0x013CE954, short) = STR_DATE_DAY_1 + day;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
RCT2_GLOBAL(0x013CE952, short) = STR_DATE_DAY_1 + day;
|
RCT2_GLOBAL(0x013CE952, short) = STR_DATE_DAY_1 + day;
|
||||||
RCT2_GLOBAL(0x013CE954, short) = month;
|
RCT2_GLOBAL(0x013CE954, short) = month;
|
||||||
}
|
|
||||||
|
|
||||||
RCT2_GLOBAL(0x013CE956, short) = year;
|
RCT2_GLOBAL(0x013CE956, short) = year;
|
||||||
gfx_draw_string_centred(
|
gfx_draw_string_centred(
|
||||||
dpi,
|
dpi,
|
||||||
(gConfigGeneral.date_format ? 5160 : 2737),
|
stringId,
|
||||||
x,
|
x,
|
||||||
y,
|
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),
|
(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),
|
||||||
|
|||||||
@@ -31,17 +31,18 @@
|
|||||||
#include "../audio/mixer.h"
|
#include "../audio/mixer.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#include "../drawing/drawing.h"
|
#include "../drawing/drawing.h"
|
||||||
|
#include "../interface/themes.h"
|
||||||
|
#include "../interface/title_sequences.h"
|
||||||
#include "../interface/viewport.h"
|
#include "../interface/viewport.h"
|
||||||
#include "../interface/widget.h"
|
#include "../interface/widget.h"
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
|
#include "../localisation/date.h"
|
||||||
#include "../localisation/localisation.h"
|
#include "../localisation/localisation.h"
|
||||||
#include "../platform/platform.h"
|
#include "../platform/platform.h"
|
||||||
#include "../sprites.h"
|
#include "../sprites.h"
|
||||||
|
#include "../title.h"
|
||||||
#include "dropdown.h"
|
#include "dropdown.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "../interface/themes.h"
|
|
||||||
#include "../interface/title_sequences.h"
|
|
||||||
#include "../title.h"
|
|
||||||
|
|
||||||
enum WINDOW_OPTIONS_PAGE {
|
enum WINDOW_OPTIONS_PAGE {
|
||||||
WINDOW_OPTIONS_PAGE_DISPLAY,
|
WINDOW_OPTIONS_PAGE_DISPLAY,
|
||||||
@@ -789,11 +790,11 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
|
|||||||
gDropdownItemsChecked = 1 << (gCurrentLanguage - 1);
|
gDropdownItemsChecked = 1 << (gCurrentLanguage - 1);
|
||||||
break;
|
break;
|
||||||
case WIDX_DATE_FORMAT_DROPDOWN:
|
case WIDX_DATE_FORMAT_DROPDOWN:
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
gDropdownItemsFormat[i] = 1142;
|
gDropdownItemsFormat[i] = 1142;
|
||||||
gDropdownItemsArgs[i] = 5162 + i;
|
gDropdownItemsArgs[i] = DateFormatStringIds[i];
|
||||||
}
|
}
|
||||||
window_options_show_dropdown(w, widget, 2);
|
window_options_show_dropdown(w, widget, 4);
|
||||||
gDropdownItemsChecked = 1 << (gConfigGeneral.date_format);
|
gDropdownItemsChecked = 1 << (gConfigGeneral.date_format);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1334,7 +1335,7 @@ static void window_options_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||||||
gfx_draw_string_left(dpi, 5161, w, w->colours[1], w->x + 10, w->y + window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1);
|
gfx_draw_string_left(dpi, 5161, w, w->colours[1], w->x + 10, w->y + window_options_culture_widgets[WIDX_DATE_FORMAT].top + 1);
|
||||||
gfx_draw_string_left(
|
gfx_draw_string_left(
|
||||||
dpi,
|
dpi,
|
||||||
5162 + gConfigGeneral.date_format,
|
DateFormatStringIds[gConfigGeneral.date_format],
|
||||||
NULL,
|
NULL,
|
||||||
w->colours[1],
|
w->colours[1],
|
||||||
w->x + window_options_culture_widgets[WIDX_DATE_FORMAT].left + 1,
|
w->x + window_options_culture_widgets[WIDX_DATE_FORMAT].left + 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user