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