mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-21 04:29:42 +01:00
Change: Less intrusive "no music" message from Music window
This commit is contained in:
parent
e172794947
commit
bb809e35ce
@ -650,6 +650,7 @@ STR_MUSIC_RULER_MARKER :{TINY_FONT}{BLA
|
|||||||
STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}--
|
STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}--
|
||||||
STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM}
|
STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM}
|
||||||
STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------
|
STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------
|
||||||
|
STR_MUSIC_TITLE_NOMUSIC :{TINY_FONT}{DKGREEN}No music available
|
||||||
STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{RAW_STRING}"
|
STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{RAW_STRING}"
|
||||||
STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Track
|
STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Track
|
||||||
STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Title
|
STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Title
|
||||||
|
@ -591,6 +591,9 @@ struct MusicWindow : public Window {
|
|||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_M_TRACK_NR: {
|
case WID_M_TRACK_NR: {
|
||||||
GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK);
|
GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK);
|
||||||
|
if (BaseMusic::GetUsedSet()->num_available == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
StringID str = STR_MUSIC_TRACK_NONE;
|
StringID str = STR_MUSIC_TRACK_NONE;
|
||||||
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
||||||
SetDParam(0, GetTrackNumber(_music_wnd_cursong - 1));
|
SetDParam(0, GetTrackNumber(_music_wnd_cursong - 1));
|
||||||
@ -604,7 +607,9 @@ struct MusicWindow : public Window {
|
|||||||
case WID_M_TRACK_NAME: {
|
case WID_M_TRACK_NAME: {
|
||||||
GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, PC_BLACK);
|
GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, PC_BLACK);
|
||||||
StringID str = STR_MUSIC_TITLE_NONE;
|
StringID str = STR_MUSIC_TITLE_NONE;
|
||||||
if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
if (BaseMusic::GetUsedSet()->num_available == 0) {
|
||||||
|
str = STR_MUSIC_TITLE_NOMUSIC;
|
||||||
|
} else if (_song_is_active != 0 && _music_wnd_cursong != 0) {
|
||||||
str = STR_MUSIC_TITLE_NAME;
|
str = STR_MUSIC_TITLE_NAME;
|
||||||
SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
|
SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
|
||||||
}
|
}
|
||||||
@ -799,6 +804,5 @@ static WindowDesc _music_window_desc(
|
|||||||
|
|
||||||
void ShowMusicWindow()
|
void ShowMusicWindow()
|
||||||
{
|
{
|
||||||
if (BaseMusic::GetUsedSet()->num_available == 0) ShowErrorMessage(STR_ERROR_NO_SONGS, INVALID_STRING_ID, WL_WARNING);
|
|
||||||
AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
|
AllocateWindowDescFront<MusicWindow>(&_music_window_desc, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user