auto-update MusicSortDisplay
This commit is contained in:
@@ -2,15 +2,29 @@
|
||||
#include "MusicSortDisplay.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#include "GameState.h"
|
||||
|
||||
MusicSortDisplay::MusicSortDisplay()
|
||||
{
|
||||
this->SubscribeToMessage( Message_SortOrderChanged );
|
||||
|
||||
Set( GAMESTATE->m_SortOrder );
|
||||
}
|
||||
|
||||
void MusicSortDisplay::Set( SortOrder so )
|
||||
{
|
||||
Load( THEME->GetPathG("MusicSortDisplay",SortOrderToString(so)) );
|
||||
if( so == SORT_INVALID )
|
||||
this->UnloadTexture();
|
||||
else
|
||||
Load( THEME->GetPathG("MusicSortDisplay",SortOrderToString(so)) );
|
||||
}
|
||||
|
||||
void MusicSortDisplay::HandleMessage( const CString& sMessage )
|
||||
{
|
||||
if( sMessage == "SortOrderChanged" )
|
||||
Set( GAMESTATE->m_SortOrder );
|
||||
|
||||
Sprite::HandleMessage( sMessage );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef MUSICSORTDISPLAY_H
|
||||
#define MUSICSORTDISPLAY_H
|
||||
#ifndef MUSIC_SORT_DISPLAY_H
|
||||
#define MUSIC_SORT_DISPLAY_H
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
@@ -11,6 +11,7 @@ class MusicSortDisplay : public Sprite
|
||||
public:
|
||||
MusicSortDisplay();
|
||||
void Set( SortOrder so );
|
||||
virtual void HandleMessage( const CString& sMessage );
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -269,7 +269,6 @@ void ScreenSelectMusic::Init()
|
||||
}
|
||||
|
||||
m_MusicSortDisplay.SetName( "SortIcon" );
|
||||
m_MusicSortDisplay.Set( GAMESTATE->m_SortOrder );
|
||||
SET_XY( m_MusicSortDisplay );
|
||||
this->AddChild( &m_MusicSortDisplay );
|
||||
|
||||
@@ -1121,7 +1120,6 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
else if( SM == SM_SortOrderChanging ) /* happens immediately */
|
||||
{
|
||||
// m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
|
||||
TweenScoreOnAndOffAfterChangeSort();
|
||||
}
|
||||
else if( SM == SM_SortOrderChanged ) /* happens after the wheel is off and the new song is selected */
|
||||
@@ -1813,7 +1811,6 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
|
||||
void ScreenSelectMusic::SortOrderChanged()
|
||||
{
|
||||
m_MusicSortDisplay.Set( GAMESTATE->m_SortOrder );
|
||||
if( SHOW_PANES )
|
||||
FOREACH_HumanPlayer(pn)
|
||||
m_PaneDisplay[pn].SetFromGameState( GAMESTATE->m_SortOrder );
|
||||
@@ -1832,9 +1829,6 @@ void ScreenSelectMusic::SortOrderChanged()
|
||||
m_DifficultyList.Show();
|
||||
break;
|
||||
}
|
||||
|
||||
// tween music sort on screen
|
||||
// m_MusicSortDisplay.FadeOn( 0, "fade", TWEEN_TIME );
|
||||
}
|
||||
|
||||
// lua start
|
||||
|
||||
Reference in New Issue
Block a user