fix DifficultyIcon hiding when no song is selected

(Note that in general, actors should never SetHidden(false) on themselves,
since that will cause themed "hidden,1" commands to be overridden.)
This commit is contained in:
Glenn Maynard
2004-04-28 22:57:42 +00:00
parent c27418fbbf
commit 73271fa3d2
3 changed files with 12 additions and 2 deletions
+7 -1
View File
@@ -26,6 +26,10 @@
#include "RageDisplay.h"
#include "arch/ArchHooks/ArchHooks.h"
DifficultyIcon::DifficultyIcon()
{
m_bBlank = false;
}
bool DifficultyIcon::Load( CString sPath )
{
@@ -48,13 +52,14 @@ bool DifficultyIcon::Load( CString sPath )
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Steps* pNotes )
{
if( pNotes == NULL )
SetHidden(true);
m_bBlank = true;
else
SetFromDifficulty( pn, pNotes->GetDifficulty() );
}
void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
{
m_bBlank = false;
switch( GetNumStates() )
{
case NUM_DIFFICULTIES: SetState( dc ); break;
@@ -65,6 +70,7 @@ void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
void DifficultyIcon::SetFromCourseDifficulty( PlayerNumber pn, CourseDifficulty cd )
{
m_bBlank = false;
switch( cd )
{
case COURSE_DIFFICULTY_REGULAR: SetFromDifficulty(pn,DIFFICULTY_MEDIUM); break;
+5
View File
@@ -19,7 +19,12 @@ class Steps;
class DifficultyIcon : public Sprite
{
bool m_bBlank;
public:
DifficultyIcon();
virtual bool EarlyAbortDraw() { return m_bBlank || Sprite::EarlyAbortDraw(); }
bool Load( CString sFilePath );
void SetFromNotes( PlayerNumber pn, Steps* pNotes );
-1
View File
@@ -17,7 +17,6 @@
#include "RandomSample.h"
#include "ScreenSelect.h"
#include "Sprite.h"
#include "DifficultyIcon.h"
#include "OptionsCursor.h"
class ScreenSelectDifficultyEX : public ScreenSelect