Changeset - r27011:a6903514ebbd
[Not reviewed]
master
0 1 0
Peter Nelson - 20 months ago 2023-03-07 22:43:22
peter1138@openttd.org
Change: Resize jukebox when changing music set.
1 file changed with 13 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/music_gui.cpp
Show inline comments
 
@@ -175,12 +175,14 @@ void MusicSystem::ChangeMusicSet(const s
 
	BaseMusic::ini_set = set_name;
 

	
 
	this->BuildPlaylists();
 
	this->ChangePlaylist(this->selected_playlist);
 

	
 
	InvalidateWindowData(WC_GAME_OPTIONS, WN_GAME_OPTIONS_GAME_OPTIONS, 0, true);
 
	InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0, 1, true);
 
	InvalidateWindowData(WC_MUSIC_WINDOW, 0, 1, true);
 
}
 

	
 
/** Enable shuffle mode and restart playback */
 
void MusicSystem::Shuffle()
 
{
 
	_settings_client.music.shuffle = true;
 
@@ -477,13 +479,18 @@ struct MusicTrackSelectionWindow : publi
 
	{
 
		if (!gui_scope) return;
 
		for (int i = 0; i < 6; i++) {
 
			this->SetWidgetLoweredState(WID_MTS_ALL + i, i == _settings_client.music.playlist);
 
		}
 
		this->SetWidgetDisabledState(WID_MTS_CLEAR, _settings_client.music.playlist <= 3);
 
		this->SetDirty();
 

	
 
		if (data == 1) {
 
			this->ReInit();
 
		} else {
 
			this->SetDirty();
 
		}
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
 
	{
 
		switch (widget) {
 
			case WID_MTS_PLAYLIST: {
 
@@ -761,13 +768,17 @@ struct MusicWindow : public Window {
 
		for (int i = 0; i < 6; i++) {
 
			this->SetWidgetLoweredState(WID_M_ALL + i, i == _settings_client.music.playlist);
 
		}
 

	
 
		UpdateDisabledButtons();
 

	
 
		this->SetDirty();
 
		if (data == 1) {
 
			this->ReInit();
 
		} else {
 
			this->SetDirty();
 
		}
 
	}
 

	
 
	void OnClick(Point pt, int widget, int click_count) override
 
	{
 
		switch (widget) {
 
			case WID_M_PREV: // skip to prev
0 comments (0 inline, 0 general)