Merge pull request #1050 from trigger-death/develop

Added option for random title music in main menu
This commit is contained in:
Ted John 2015-05-11 18:26:04 +01:00
commit 09c05d95b1
5 changed files with 16 additions and 4 deletions

View File

@ -3459,3 +3459,4 @@ STR_5122 :Show all vehicles sharing a track/ride type
STR_5123 :Renew rides
STR_5124 :No Six Flags
STR_5125 :All destructable
STR_5126 :Random title music

View File

@ -3471,3 +3471,4 @@ STR_5122 :Show all vehicles sharing a track/ride type
STR_5123 :Renew rides
STR_5124 :No Six Flags
STR_5125 :All destructable
STR_5126 :Random title music

View File

@ -1549,6 +1549,12 @@ void start_title_music()
case 2:
musicPathId = PATH_ID_CSS17;
break;
case 3:
if (rand() & 1)
musicPathId = PATH_ID_CSS50;
else
musicPathId = PATH_ID_CSS17;
break;
}
if ((RCT2_GLOBAL(0x009AF284, uint32) & (1 << 0)) && RCT2_GLOBAL(0x009AF59D, uint8) & 1

View File

@ -72,6 +72,7 @@ int rct2_init()
RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, int) = 0;
RCT2_GLOBAL(0x009AC310, char*) = RCT2_GLOBAL(RCT2_ADDRESS_CMDLINE, char*);
get_system_time();
srand(time(0));
RCT2_GLOBAL(0x009DEA69, short) = RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_DAY, short);
RCT2_GLOBAL(0x009DEA6B, short) = RCT2_GLOBAL(RCT2_ADDRESS_OS_TIME_MONTH, short);
if (!rct2_init_directories())

View File

@ -396,12 +396,15 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
gDropdownItemsChecked = gConfigGeneral.show_height_as_units ? 1 : 2;
break;
case WIDX_TITLE_MUSIC_DROPDOWN:
num_items = 3;
num_items = 4;
for (i = 0; i < num_items; i++) {
for (i = 0; i < num_items - 1; i++) {
gDropdownItemsFormat[i] = 1142;
gDropdownItemsArgs[i] = 2739 + i;
}
// Random title music
gDropdownItemsFormat[3] = 1142;
gDropdownItemsArgs[3] = 5126;
window_options_show_dropdown(w, widget, num_items);
@ -556,7 +559,7 @@ static void window_options_dropdown()
window_options_update_height_markers();
break;
case WIDX_TITLE_MUSIC_DROPDOWN:
if (dropdownIndex == 1 && !platform_file_exists(get_file_path(PATH_ID_CSS50))) {
if ((dropdownIndex == 1 || dropdownIndex == 3) && !platform_file_exists(get_file_path(PATH_ID_CSS50))) {
window_error_open(2742, 2743);
} else {
gConfigSound.title_music = (sint8)dropdownIndex;
@ -837,7 +840,7 @@ static void window_options_paint()
gfx_draw_string_left(dpi, 2738, w, 12, w->x + 10, w->y + window_options_widgets[WIDX_TITLE_MUSIC].top + 1);
gfx_draw_string_left(
dpi,
2739 + gConfigSound.title_music,
(gConfigSound.title_music == 3 ? 5126 : 2739 + gConfigSound.title_music),
NULL,
12,
w->x + window_options_widgets[WIDX_TITLE_MUSIC].left + 1,