fix "PaneDisplay shows bogus values for edits"
This commit is contained in:
@@ -142,20 +142,23 @@ void PaneDisplay::Update( float fDeltaTime )
|
||||
|
||||
void PaneDisplay::SetContent( PaneContents c )
|
||||
{
|
||||
m_textContents[c].SetText( "" );
|
||||
|
||||
if( (g_Contents[c].req&NEED_NOTES) && !GAMESTATE->m_pCurSteps[m_PlayerNumber] )
|
||||
return;
|
||||
if( (g_Contents[c].req&NEED_COURSE) && !GAMESTATE->m_pCurTrail[m_PlayerNumber] )
|
||||
return;
|
||||
if( (g_Contents[c].req&NEED_PROFILE) && !PROFILEMAN->IsUsingProfile( m_PlayerNumber ) )
|
||||
return;
|
||||
CString str = "?"; // fill this in
|
||||
float val = 0; // fill this in
|
||||
|
||||
const Song *pSong = GAMESTATE->m_pCurSong;
|
||||
const Steps *pSteps = GAMESTATE->m_pCurSteps[m_PlayerNumber];
|
||||
const Course *pCourse = GAMESTATE->m_pCurCourse;
|
||||
const Trail *pTrail = GAMESTATE->m_pCurTrail[m_PlayerNumber];
|
||||
const Profile *pProfile = PROFILEMAN->GetProfile( m_PlayerNumber );
|
||||
|
||||
if( (g_Contents[c].req&NEED_NOTES) && !pSteps )
|
||||
goto done;
|
||||
if( (g_Contents[c].req&NEED_COURSE) && !pTrail )
|
||||
goto done;
|
||||
if( (g_Contents[c].req&NEED_PROFILE) && !pProfile )
|
||||
goto done;
|
||||
|
||||
{
|
||||
RadarValues rv;
|
||||
|
||||
if( g_Contents[c].req&NEED_NOTES )
|
||||
@@ -163,8 +166,6 @@ void PaneDisplay::SetContent( PaneContents c )
|
||||
else if( g_Contents[c].req&NEED_COURSE )
|
||||
rv = pTrail->GetRadarValues();
|
||||
|
||||
float val = 0;
|
||||
CString str;
|
||||
switch( c )
|
||||
{
|
||||
case COURSE_NUM_STEPS:
|
||||
@@ -242,6 +243,9 @@ void PaneDisplay::SetContent( PaneContents c )
|
||||
break;
|
||||
};
|
||||
|
||||
if( val == RADAR_VAL_UNKNOWN )
|
||||
goto done;
|
||||
|
||||
/* Scale, round, clamp, etc. for floats: */
|
||||
switch( c )
|
||||
{
|
||||
@@ -292,13 +296,14 @@ void PaneDisplay::SetContent( PaneContents c )
|
||||
case COURSE_PROFILE_RANK:
|
||||
str = ssprintf( "%.0f", val );
|
||||
}
|
||||
}
|
||||
|
||||
int p;
|
||||
|
||||
done:
|
||||
m_textContents[c].SetText( str );
|
||||
|
||||
const int num = NUM_ITEM_COLORS( g_Contents[c].name );
|
||||
for( p = 0; p < num; ++p )
|
||||
for( int p = 0; p < num; ++p )
|
||||
{
|
||||
const CString metric = ITEM_COLOR(g_Contents[c].name, p);
|
||||
CStringArray spec;
|
||||
|
||||
@@ -12,7 +12,8 @@ RadarValues::RadarValues()
|
||||
|
||||
void RadarValues::Init()
|
||||
{
|
||||
ZERO( *this );
|
||||
FOREACH_RadarCategory( rc )
|
||||
m_fValues[rc] = RADAR_VAL_UNKNOWN;
|
||||
}
|
||||
|
||||
XNode* RadarValues::CreateNode() const
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
#define RADAR_VAL_UNKNOWN -1
|
||||
|
||||
struct XNode;
|
||||
|
||||
struct RadarValues
|
||||
|
||||
Reference in New Issue
Block a user