tron@2186: /* $Id$ */ tron@2186: belugas@6201: /** @file music_gui.cpp */ belugas@6201: truelight@0: #include "stdafx.h" Darkvater@1891: #include "openttd.h" tron@507: #include "table/strings.h" Darkvater@4937: #include "table/sprites.h" rubidium@7266: #include "strings.h" tron@2163: #include "functions.h" rubidium@6929: #include "fileio.h" truelight@0: #include "window.h" truelight@0: #include "gfx.h" truelight@0: #include "sound.h" tron@2159: #include "macros.h" tron@2159: #include "variables.h" belugas@4120: #include "music.h" peter1138@7170: #include "music/music_driver.hpp" truelight@0: tron@2155: static byte _music_wnd_cursong; tron@2155: static bool _song_is_active; belugas@4120: static byte _cur_playlist[NUM_SONGS_PLAYLIST]; tron@2155: truelight@0: truelight@0: truelight@0: static byte _playlist_all[] = { tron@2639: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0 truelight@0: }; truelight@0: truelight@0: static byte _playlist_old_style[] = { tron@2639: 1, 8, 2, 9, 14, 15, 19, 13, 0 truelight@0: }; truelight@0: truelight@0: static byte _playlist_new_style[] = { truelight@0: 6, 11, 10, 17, 21, 18, 5, 0 truelight@0: }; truelight@0: truelight@0: static byte _playlist_ezy_street[] = { truelight@0: 12, 7, 16, 3, 20, 4, 0 truelight@0: }; truelight@0: truelight@0: static byte * const _playlists[] = { truelight@0: _playlist_all, truelight@0: _playlist_old_style, truelight@0: _playlist_new_style, truelight@0: _playlist_ezy_street, truelight@0: msf.custom_1, truelight@0: msf.custom_2, truelight@0: }; truelight@0: rubidium@6247: static void SkipToPrevSong() truelight@0: { truelight@0: byte *b = _cur_playlist; truelight@0: byte *p = b; truelight@0: byte t; truelight@0: belugas@4867: if (b[0] == 0) return; // empty playlist truelight@193: belugas@4867: do p++; while (p[0] != 0); // find the end truelight@0: belugas@4867: t = *--p; // and copy the bytes truelight@0: while (p != b) { truelight@0: p--; truelight@0: p[1] = p[0]; truelight@0: } truelight@0: *b = t; truelight@0: truelight@0: _song_is_active = false; truelight@0: } truelight@0: rubidium@6247: static void SkipToNextSong() truelight@0: { tron@2639: byte* b = _cur_playlist; tron@2639: byte t; truelight@0: tron@2639: t = b[0]; tron@2639: if (t != 0) { tron@2639: while (b[1] != 0) { truelight@0: b[0] = b[1]; truelight@0: b++; truelight@0: } truelight@0: b[0] = t; truelight@0: } truelight@0: truelight@0: _song_is_active = false; truelight@0: } truelight@0: truelight@0: static void MusicVolumeChanged(byte new_vol) truelight@0: { peter1138@7170: _music_driver->SetVolume(new_vol); truelight@0: } truelight@0: rubidium@6247: static void DoPlaySong() truelight@0: { rubidium@6929: char filename[MAX_PATH]; rubidium@6929: FioFindFullPath(filename, lengthof(filename), GM_DIR, rubidium@6929: origin_songs_specs[_music_wnd_cursong - 1].filename); peter1138@7170: _music_driver->PlaySong(filename); truelight@0: } truelight@0: rubidium@6247: static void DoStopMusic() truelight@0: { peter1138@7170: _music_driver->StopSong(); truelight@0: } truelight@0: rubidium@6247: static void SelectSongToPlay() truelight@0: { truelight@2247: uint i = 0; belugas@4120: uint j = 0; truelight@0: truelight@2247: memset(_cur_playlist, 0, sizeof(_cur_playlist)); hackykid@1884: do { rubidium@6929: /* We are now checking for the existence of that file prior rubidium@6929: * to add it to the list of available songs */ rubidium@6929: if (FioCheckFileExists(origin_songs_specs[_playlists[msf.playlist][i]].filename, GM_DIR)) { rubidium@6929: _cur_playlist[j] = _playlists[msf.playlist][i]; rubidium@6929: j++; belugas@4120: } truelight@2247: } while (_playlists[msf.playlist][i++] != 0 && i < lengthof(_cur_playlist) - 1); truelight@0: belugas@7744: /* Do not shuffle when on the intro-start window, as the song to play has to be the original TTD Theme*/ belugas@7744: if (msf.shuffle && _game_mode != GM_MENU) { truelight@0: i = 500; truelight@0: do { truelight@0: uint32 r = InteractiveRandom(); tron@2140: byte *a = &_cur_playlist[GB(r, 0, 5)]; tron@2140: byte *b = &_cur_playlist[GB(r, 8, 5)]; truelight@0: truelight@0: if (*a != 0 && *b != 0) { truelight@0: byte t = *a; truelight@0: *a = *b; truelight@0: *b = t; truelight@0: } truelight@0: } while (--i); truelight@0: } truelight@0: } truelight@0: rubidium@6247: static void StopMusic() truelight@0: { truelight@0: _music_wnd_cursong = 0; truelight@0: DoStopMusic(); truelight@0: _song_is_active = false; truelight@0: InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9); truelight@0: } truelight@0: rubidium@6247: static void PlayPlaylistSong() truelight@0: { truelight@0: if (_cur_playlist[0] == 0) { truelight@0: SelectSongToPlay(); belugas@4867: /* if there is not songs in the playlist, it may indicate belugas@4867: * no file on the gm folder, or even no gm folder. belugas@4867: * Stop the playback, then */ belugas@4120: if (_cur_playlist[0] == 0) { belugas@4120: _song_is_active = false; belugas@4120: _music_wnd_cursong = 0; belugas@4120: msf.playing = false; belugas@4120: return; belugas@4120: } truelight@0: } truelight@0: _music_wnd_cursong = _cur_playlist[0]; truelight@0: DoPlaySong(); truelight@0: _song_is_active = true; truelight@193: truelight@0: InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9); truelight@0: } truelight@0: rubidium@6247: void ResetMusic() truelight@0: { truelight@0: _music_wnd_cursong = 1; truelight@0: DoPlaySong(); truelight@0: } truelight@0: rubidium@6247: void MusicLoop() truelight@0: { Darkvater@3052: if (!msf.playing && _song_is_active) { truelight@0: StopMusic(); Darkvater@3052: } else if (msf.playing && !_song_is_active) { belugas@7744: PlayPlaylistSong(); truelight@0: } truelight@0: belugas@4120: if (!_song_is_active) return; truelight@0: peter1138@7170: if (!_music_driver->IsSongPlaying()) { Darkvater@1724: if (_game_mode != GM_MENU) { Darkvater@1724: StopMusic(); Darkvater@1724: SkipToNextSong(); Darkvater@1724: PlayPlaylistSong(); tron@2639: } else { Darkvater@1724: ResetMusic(); tron@2639: } truelight@0: } truelight@0: } truelight@0: truelight@0: static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e) truelight@0: { tron@2952: switch (e->event) { truelight@0: case WE_PAINT: { tron@2630: const byte* p; tron@2133: uint i; tron@2133: int y; truelight@0: rubidium@7997: w->SetWidgetDisabledState(11, msf.playlist <= 3); rubidium@7997: w->LowerWidget(3); rubidium@7997: w->LowerWidget(4); truelight@0: DrawWindowWidgets(w); truelight@0: rubidium@6491: GfxFillRect(3, 23, 3 + 177, 23 + 191, 0); rubidium@6491: GfxFillRect(251, 23, 251 + 177, 23 + 191, 0); truelight@0: belugas@7824: DrawStringCentered(92, 15, STR_01EE_TRACK_INDEX, TC_FROMSTRING); truelight@0: tron@534: SetDParam(0, STR_01D5_ALL + msf.playlist); belugas@7824: DrawStringCentered(340, 15, STR_01EF_PROGRAM, TC_FROMSTRING); truelight@0: tron@2133: for (i = 1; i <= NUM_SONGS_AVAILABLE; i++) { tron@534: SetDParam(0, i); tron@534: SetDParam(2, i); tron@534: SetDParam(1, SPECSTR_SONGNAME); belugas@7824: DrawString(4, 23 + (i - 1) * 6, (i < 10) ? STR_01EC_0 : STR_01ED, TC_FROMSTRING); truelight@0: } truelight@0: tron@2639: for (i = 0; i != 6; i++) { belugas@7824: DrawStringCentered(216, 45 + i * 8, STR_01D5_ALL + i, (i == msf.playlist) ? TC_WHITE : TC_BLACK); truelight@0: } truelight@0: belugas@7824: DrawStringCentered(216, 45 + 8 * 6 + 16, STR_01F0_CLEAR, TC_FROMSTRING); tron@4468: #if 0 belugas@7824: DrawStringCentered(216, 45 + 8 * 6 + 16 * 2, STR_01F1_SAVE, TC_FROMSTRING); tron@4468: #endif truelight@0: truelight@0: y = 23; tron@2639: for (p = _playlists[msf.playlist], i = 0; (i = *p) != 0; p++) { tron@534: SetDParam(0, i); tron@2639: SetDParam(1, SPECSTR_SONGNAME); tron@534: SetDParam(2, i); belugas@7824: DrawString(252, y, (i < 10) ? STR_01EC_0 : STR_01ED, TC_FROMSTRING); truelight@0: y += 6; truelight@0: } truelight@0: break; truelight@0: } truelight@193: truelight@0: case WE_CLICK: belugas@4634: switch (e->we.click.widget) { belugas@4867: case 3: { // add to playlist belugas@4634: int y = (e->we.click.pt.y - 23) / 6; tron@2639: uint i; truelight@0: byte *p; tron@2639: truelight@0: if (msf.playlist < 4) return; skidd13@7954: if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return; truelight@0: truelight@0: p = _playlists[msf.playlist]; belugas@4120: for (i = 0; i != NUM_SONGS_PLAYLIST - 1; i++) { truelight@0: if (p[i] == 0) { tron@2639: p[i] = y + 1; tron@2639: p[i + 1] = 0; truelight@0: SetWindowDirty(w); truelight@0: SelectSongToPlay(); truelight@0: break; truelight@0: } truelight@0: } belugas@4120: } break; truelight@0: belugas@4867: case 4: { // remove from playlist belugas@4634: int y = (e->we.click.pt.y - 23) / 6; belugas@4120: uint i; belugas@4120: byte *p; belugas@4120: belugas@4120: if (msf.playlist < 4) return; skidd13@7954: if (!IsInsideMM(y, 0, NUM_SONGS_AVAILABLE)) return; belugas@4120: belugas@4120: p = _playlists[msf.playlist]; belugas@4120: for (i = y; i != NUM_SONGS_PLAYLIST - 1; i++) { belugas@4120: p[i] = p[i + 1]; belugas@4120: } belugas@4120: belugas@4120: SetWindowDirty(w); belugas@4120: SelectSongToPlay(); truelight@0: } break; belugas@4120: belugas@4867: case 11: // clear truelight@0: _playlists[msf.playlist][0] = 0; truelight@0: SetWindowDirty(w); truelight@0: StopMusic(); truelight@0: SelectSongToPlay(); truelight@0: break; belugas@4120: rubidium@4432: #if 0 belugas@4867: case 12: // save Darkvater@5576: ShowInfo("MusicTrackSelectionWndProc:save not implemented"); rubidium@4432: break; rubidium@4432: #endif belugas@4120: truelight@0: case 5: case 6: case 7: case 8: case 9: case 10: /* set playlist */ belugas@4634: msf.playlist = e->we.click.widget - 5; truelight@0: SetWindowDirty(w); truelight@0: InvalidateWindow(WC_MUSIC_WINDOW, 0); truelight@0: StopMusic(); truelight@0: SelectSongToPlay(); truelight@0: break; truelight@0: } truelight@0: break; truelight@0: } truelight@0: } truelight@0: truelight@0: static const Widget _music_track_selection_widgets[] = { rubidium@4344: { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, truelight@867: { WWT_CAPTION, RESIZE_NONE, 14, 11, 431, 0, 13, STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 0, 431, 14, 217, 0x0, STR_NULL}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 2, 181, 22, 215, 0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 250, 429, 22, 215, 0x0, STR_CLICK_ON_TRACK_TO_REMOVE}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 44, 51, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 52, 59, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 60, 67, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 68, 75, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 76, 83, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 84, 91, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 108, 115, 0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1}, tron@4468: #if 0 Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 186, 245, 124, 131, 0x0, STR_01F9_SAVE_MUSIC_SETTINGS}, tron@4468: #endif darkvater@176: { WIDGETS_END}, truelight@0: }; truelight@0: truelight@0: static const WindowDesc _music_track_selection_desc = { rubidium@7341: 104, 131, 432, 218, 432, 218, rubidium@5893: WC_MUSIC_TRACK_SELECTION, WC_NONE, truelight@0: WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, truelight@0: _music_track_selection_widgets, truelight@0: MusicTrackSelectionWndProc truelight@0: }; truelight@0: rubidium@6247: static void ShowMusicTrackSelection() truelight@0: { truelight@0: AllocateWindowDescFront(&_music_track_selection_desc, 0); truelight@0: } truelight@0: truelight@0: static void MusicWindowWndProc(Window *w, WindowEvent *e) truelight@0: { tron@2952: switch (e->event) { truelight@0: case WE_PAINT: { tron@2639: uint i; truelight@0: StringID str; truelight@0: rubidium@7997: w->RaiseWidget(7); rubidium@7997: w->RaiseWidget(9); truelight@0: DrawWindowWidgets(w); truelight@0: truelight@0: GfxFillRect(187, 16, 200, 33, 0); truelight@0: tron@2639: for (i = 0; i != 8; i++) { truelight@0: int color = 0xD0; truelight@0: if (i > 4) { truelight@0: color = 0xBF; truelight@0: if (i > 6) { truelight@0: color = 0xB8; truelight@0: } truelight@0: } belugas@4120: GfxFillRect(187, NUM_SONGS_PLAYLIST - i * 2, 200, NUM_SONGS_PLAYLIST - i * 2, color); truelight@0: } truelight@0: truelight@0: GfxFillRect(60, 46, 239, 52, 0); truelight@0: tron@2639: if (_song_is_active == 0 || _music_wnd_cursong == 0) { tron@2639: str = STR_01E3; tron@2639: } else { tron@534: SetDParam(0, _music_wnd_cursong); tron@2639: str = (_music_wnd_cursong < 10) ? STR_01E4_0 : STR_01E5; truelight@0: } belugas@7824: DrawString(62, 46, str, TC_FROMSTRING); truelight@0: truelight@0: str = STR_01E6; truelight@0: if (_song_is_active != 0 && _music_wnd_cursong != 0) { truelight@0: str = STR_01E7; tron@534: SetDParam(0, SPECSTR_SONGNAME); tron@534: SetDParam(1, _music_wnd_cursong); truelight@0: } belugas@7824: DrawStringCentered(155, 46, str, TC_FROMSTRING); truelight@0: truelight@0: belugas@7824: DrawString(60, 38, STR_01E8_TRACK_XTITLE, TC_FROMSTRING); truelight@193: tron@2639: for (i = 0; i != 6; i++) { belugas@7824: DrawStringCentered(25 + i * 50, 59, STR_01D5_ALL + i, msf.playlist == i ? TC_WHITE : TC_BLACK); truelight@0: } truelight@0: belugas@7824: DrawStringCentered(31, 43, STR_01E9_SHUFFLE, (msf.shuffle ? TC_WHITE : TC_BLACK)); belugas@7824: DrawStringCentered(269, 43, STR_01EA_PROGRAM, TC_FROMSTRING); belugas@7824: DrawStringCentered(141, 15, STR_01DB_MUSIC_VOLUME, TC_FROMSTRING); belugas@7824: DrawStringCentered(141, 29, STR_01DD_MIN_MAX, TC_FROMSTRING); belugas@7824: DrawStringCentered(247, 15, STR_01DC_EFFECTS_VOLUME, TC_FROMSTRING); belugas@7824: DrawStringCentered(247, 29, STR_01DD_MIN_MAX, TC_FROMSTRING); truelight@0: hackykid@1938: DrawFrameRect(108, 23, 174, 26, 14, FR_LOWERED); hackykid@1938: DrawFrameRect(214, 23, 280, 26, 14, FR_LOWERED); truelight@0: tron@4468: DrawFrameRect( rubidium@5587: 108 + msf.music_vol / 2, 22, 111 + msf.music_vol / 2, 28, 14, FR_NONE tron@4468: ); truelight@0: tron@4468: DrawFrameRect( rubidium@5587: 214 + msf.effect_vol / 2, 22, 217 + msf.effect_vol / 2, 28, 14, FR_NONE tron@4468: ); truelight@0: } break; truelight@0: truelight@0: case WE_CLICK: belugas@4634: switch (e->we.click.widget) { truelight@0: case 2: // skip to prev truelight@0: if (!_song_is_active) truelight@0: return; truelight@0: SkipToPrevSong(); truelight@0: break; truelight@0: case 3: // skip to next truelight@0: if (!_song_is_active) truelight@0: return; truelight@0: SkipToNextSong(); truelight@0: break; truelight@0: case 4: // stop playing Darkvater@3052: msf.playing = false; truelight@0: break; truelight@0: case 5: // start playing Darkvater@3052: msf.playing = true; truelight@0: break; Darkvater@6124: case 6: { // volume sliders Darkvater@6124: byte *vol, new_vol; belugas@4634: int x = e->we.click.pt.x - 88; truelight@0: Darkvater@6124: if (x < 0) return; truelight@0: truelight@0: vol = &msf.music_vol; truelight@0: if (x >= 106) { truelight@0: vol = &msf.effect_vol; truelight@0: x -= 106; truelight@0: } truelight@0: Darkvater@6124: new_vol = min(max(x - 21, 0) * 2, 127); truelight@0: if (new_vol != *vol) { truelight@0: *vol = new_vol; truelight@0: if (vol == &msf.music_vol) truelight@0: MusicVolumeChanged(new_vol); truelight@0: SetWindowDirty(w); truelight@0: } truelight@0: truelight@0: _left_button_clicked = false; truelight@0: } break; truelight@0: case 10: //toggle shuffle truelight@0: msf.shuffle ^= 1; truelight@0: StopMusic(); truelight@0: SelectSongToPlay(); truelight@0: break; truelight@0: case 11: //show track selection truelight@0: ShowMusicTrackSelection(); truelight@0: break; truelight@0: case 12: case 13: case 14: case 15: case 16: case 17: // playlist belugas@4634: msf.playlist = e->we.click.widget - 12; truelight@0: SetWindowDirty(w); truelight@0: InvalidateWindow(WC_MUSIC_TRACK_SELECTION, 0); truelight@0: StopMusic(); truelight@0: SelectSongToPlay(); truelight@0: break; truelight@0: } truelight@0: break; truelight@0: truelight@0: case WE_MOUSELOOP: truelight@0: InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 7); truelight@0: break; truelight@0: } truelight@0: truelight@0: } truelight@0: truelight@0: static const Widget _music_window_widgets[] = { rubidium@4344: { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, truelight@867: { WWT_CAPTION, RESIZE_NONE, 14, 11, 299, 0, 13, STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS}, Darkvater@4937: { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 21, 14, 35, SPR_IMG_SKIP_TO_PREV, STR_01DE_SKIP_TO_PREVIOUS_TRACK}, Darkvater@4937: { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 22, 43, 14, 35, SPR_IMG_SKIP_TO_NEXT, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION}, Darkvater@4937: { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 44, 65, 14, 35, SPR_IMG_STOP_MUSIC, STR_01E0_STOP_PLAYING_MUSIC}, Darkvater@4937: { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 66, 87, 14, 35, SPR_IMG_PLAY_MUSIC, STR_01E1_START_PLAYING_MUSIC}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 88, 299, 14, 35, 0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 186, 201, 15, 34, 0x0, STR_NULL}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 0, 299, 36, 57, 0x0, STR_NULL}, Darkvater@4938: { WWT_PANEL, RESIZE_NONE, 14, 59, 240, 45, 53, 0x0, STR_NULL}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 6, 55, 42, 49, 0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 244, 293, 42, 49, 0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 0, 49, 58, 65, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 50, 99, 58, 65, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 100, 149, 58, 65, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 150, 199, 58, 65, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 200, 249, 58, 65, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, Darkvater@4938: { WWT_PUSHBTN, RESIZE_NONE, 14, 250, 299, 58, 65, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, darkvater@176: { WIDGETS_END}, truelight@0: }; truelight@0: truelight@0: static const WindowDesc _music_window_desc = { rubidium@7341: 0, 22, 300, 66, 300, 66, rubidium@5893: WC_MUSIC_WINDOW, WC_NONE, truelight@0: WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, truelight@0: _music_window_widgets, truelight@0: MusicWindowWndProc truelight@0: }; truelight@0: rubidium@6247: void ShowMusicWindow() truelight@0: { truelight@0: AllocateWindowDescFront(&_music_window_desc, 0); truelight@0: }