Added separate icon for smaniac
This commit is contained in:
@@ -25,22 +25,11 @@ BannerWithFrame::BannerWithFrame()
|
||||
|
||||
this->AddChild( &m_Banner );
|
||||
this->AddChild( &m_sprBannerFrame );
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
float fX = (m_sprBannerFrame.GetUnzoomedWidth()/2-26) * (p==PLAYER_1 ? -1 : 1 );
|
||||
float fY = m_sprBannerFrame.GetUnzoomedHeight()/2-26;
|
||||
m_Icon[p].SetX( fX );
|
||||
m_Icon[p].SetY( fY );
|
||||
this->AddChild( &m_Icon[p] );
|
||||
}
|
||||
}
|
||||
|
||||
void BannerWithFrame::LoadFromSongAndNotes( Song* pSong, Notes* pNotes[NUM_PLAYERS] )
|
||||
{
|
||||
LoadFromSong( pSong );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
m_Icon[p].SetFromNotes( pNotes[p] ); // NULL pNotes menas icon is hidden
|
||||
}
|
||||
|
||||
void BannerWithFrame::LoadFromSong( Song* pSong )
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
Class: BannerWithFrame
|
||||
|
||||
Desc: bonus meters and max combo number.
|
||||
Desc: show the banner inside a frame.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "ActorFrame.h"
|
||||
#include "Sprite.h"
|
||||
#include "Banner.h"
|
||||
#include "DifficultyIcon.h"
|
||||
class Song;
|
||||
class Course;
|
||||
|
||||
@@ -31,5 +30,4 @@ protected:
|
||||
|
||||
Sprite m_sprBannerFrame;
|
||||
Banner m_Banner;
|
||||
DifficultyIcon m_Icon[NUM_PLAYERS];
|
||||
};
|
||||
|
||||
@@ -66,16 +66,16 @@ void CourseContentDisplay::Load( int iNum, Song* pSong, Notes* pNotes )
|
||||
m_textNumber.SetText( ssprintf("%d", iNum) );
|
||||
|
||||
D3DXCOLOR colorGroup = SONGMAN->GetSongColor( pSong );
|
||||
D3DXCOLOR colorDifficulty = DifficultyToColor( pNotes->m_Difficulty );
|
||||
D3DXCOLOR colorNotes = pNotes->GetColor();
|
||||
|
||||
m_TextBanner.LoadFromSong( pSong );
|
||||
m_TextBanner.SetDiffuse( colorGroup );
|
||||
|
||||
m_textFoot.SetText( "1" );
|
||||
m_textFoot.SetDiffuse( colorDifficulty );
|
||||
m_textFoot.SetDiffuse( colorNotes );
|
||||
|
||||
m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->m_iMeter) );
|
||||
m_textDifficultyNumber.SetDiffuse( colorDifficulty );
|
||||
m_textDifficultyNumber.SetDiffuse( colorNotes );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,51 @@
|
||||
#include "stdafx.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
File: DifficultyIcon.h
|
||||
Class: DifficultyIcon
|
||||
|
||||
Desc: A graphic displayed in the DifficultyIcon during Dancing.
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "DifficultyIcon.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "Notes.h"
|
||||
#include "GameState.h"
|
||||
|
||||
|
||||
bool DifficultyIcon::Load( CString sPath )
|
||||
{
|
||||
Sprite::Load( sPath );
|
||||
if( GetNumStates() != 6 && GetNumStates() != 12 )
|
||||
throw RageException( "The difficulty icon graphic '%s' must have 6 or 12 states.", sPath );
|
||||
StopAnimating();
|
||||
return true;
|
||||
}
|
||||
|
||||
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Notes* pNotes )
|
||||
{
|
||||
if( pNotes == NULL )
|
||||
{
|
||||
SetDiffuse( D3DXCOLOR(1,1,1,0) );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDiffuse( D3DXCOLOR(1,1,1,1) );
|
||||
|
||||
int iStateNo = pNotes->GetNotesDisplayType();
|
||||
|
||||
switch( GetNumStates() )
|
||||
{
|
||||
case 6: SetState( iStateNo ); break;
|
||||
case 12: SetState( iStateNo*2+pn ); break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,50 +3,21 @@
|
||||
-----------------------------------------------------------------------------
|
||||
Class: DifficultyIcon
|
||||
|
||||
Desc: A graphic displayed in Select Music above the Groove Radar.
|
||||
Desc: Graphical representation of the difficulty class.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "Notes.h"
|
||||
#include "ThemeManager.h"
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
struct Notes;
|
||||
|
||||
class DifficultyIcon : public Sprite
|
||||
{
|
||||
public:
|
||||
DifficultyIcon()
|
||||
{
|
||||
Load( THEME->GetPathTo("Graphics","select music difficulty icons") );
|
||||
StopAnimating();
|
||||
|
||||
SetFromNotes( NULL );
|
||||
};
|
||||
|
||||
void SetFromNotes( const Notes* pNotes )
|
||||
{
|
||||
if( pNotes != NULL )
|
||||
{
|
||||
SetDiffuse( D3DXCOLOR(1,1,1,1) );
|
||||
switch( pNotes->m_Difficulty )
|
||||
{
|
||||
case DIFFICULTY_EASY: SetState( 0 ); break;
|
||||
case DIFFICULTY_MEDIUM: SetState( 1 ); break;
|
||||
case DIFFICULTY_HARD: SetState( 2 ); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDiffuse( D3DXCOLOR(1,1,1,0) );
|
||||
SetState( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
bool Load( CString sFilePath );
|
||||
|
||||
void SetFromNotes( PlayerNumber pn, Notes* pNotes );
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include "PrefsManager.h"
|
||||
|
||||
|
||||
const int NUM_FEET_IN_METER = 10;
|
||||
const int GLOW_IF_METER_GREATER_THAN = 9;
|
||||
|
||||
|
||||
FootMeter::FootMeter()
|
||||
{
|
||||
@@ -30,16 +33,12 @@ void FootMeter::SetFromNotes( Notes* pNotes )
|
||||
{
|
||||
SetDiffuse( D3DXCOLOR(1,1,1,1) );
|
||||
SetNumFeet( pNotes->m_iMeter );
|
||||
if( pNotes->m_iMeter >= 10 )
|
||||
if( pNotes->m_iMeter > GLOW_IF_METER_GREATER_THAN )
|
||||
this->SetEffectGlowing();
|
||||
else
|
||||
this->SetEffectNone();
|
||||
|
||||
SetDiffuse( pNotes->GetColor() );
|
||||
// this->StopTweening();
|
||||
// this->SetZoom( 1.1f );
|
||||
// this->BeginTweening( 0.3f, TWEEN_BOUNCE_BEGIN );
|
||||
// this->SetTweenZoom( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -52,12 +51,11 @@ void FootMeter::SetFromNotes( Notes* pNotes )
|
||||
void FootMeter::SetNumFeet( int iNumFeet )
|
||||
{
|
||||
CString sNewText;
|
||||
for( int f=0; f<=9; f++ )
|
||||
for( int f=0; f<NUM_FEET_IN_METER; f++ )
|
||||
sNewText += (f<iNumFeet) ? "1" : "0";
|
||||
for( f=10; f<=12; f++ )
|
||||
for( f=NUM_FEET_IN_METER; f<=13; f++ )
|
||||
if( f<iNumFeet )
|
||||
sNewText += "1";
|
||||
|
||||
SetText( sNewText );
|
||||
|
||||
}
|
||||
@@ -15,22 +15,8 @@
|
||||
|
||||
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
||||
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
|
||||
#define COLOR_EASY THEME->GetMetricC("Common","ColorEasy")
|
||||
#define COLOR_MEDIUM THEME->GetMetricC("Common","ColorMedium")
|
||||
#define COLOR_HARD THEME->GetMetricC("Common","ColorHard")
|
||||
|
||||
|
||||
D3DXCOLOR DifficultyToColor( Difficulty dc )
|
||||
{
|
||||
switch( dc )
|
||||
{
|
||||
case DIFFICULTY_EASY: return COLOR_EASY;
|
||||
case DIFFICULTY_MEDIUM: return COLOR_MEDIUM;
|
||||
case DIFFICULTY_HARD: return COLOR_HARD;
|
||||
default: ASSERT(0); return D3DXCOLOR(); // invalid Difficulty
|
||||
}
|
||||
}
|
||||
|
||||
CString DifficultyToString( Difficulty dc )
|
||||
{
|
||||
switch( dc )
|
||||
|
||||
@@ -52,8 +52,6 @@ enum Difficulty
|
||||
CLASS_INVALID
|
||||
};
|
||||
|
||||
D3DXCOLOR DifficultyToColor( Difficulty dc );
|
||||
|
||||
CString DifficultyToString( Difficulty dc );
|
||||
|
||||
Difficulty StringToDifficulty( CString sDC );
|
||||
|
||||
+36
-9
@@ -22,8 +22,15 @@
|
||||
#include "RageException.h"
|
||||
#include "MsdFile.h"
|
||||
#include "GameManager.h"
|
||||
#include "ThemeManager.h"
|
||||
|
||||
|
||||
#define COLOR_EASY THEME->GetMetricC("Notes","ColorEasy")
|
||||
#define COLOR_MEDIUM THEME->GetMetricC("Notes","ColorMedium")
|
||||
#define COLOR_HARD THEME->GetMetricC("Notes","ColorHard")
|
||||
#define COLOR_S_HARD THEME->GetMetricC("Notes","ColorSHard")
|
||||
#define COLOR_CHALLENGE THEME->GetMetricC("Notes","ColorChallenge")
|
||||
#define COLOR_BATTLE THEME->GetMetricC("Notes","ColorBattle")
|
||||
|
||||
|
||||
Notes::Notes()
|
||||
@@ -78,17 +85,37 @@ void Notes::GetNoteData( NoteData* pNoteDataOut ) const
|
||||
}
|
||||
|
||||
// Color is a function of Difficulty and Intended Style
|
||||
D3DXCOLOR Notes::GetColor() const
|
||||
NotesDisplayType Notes::GetNotesDisplayType() const
|
||||
{
|
||||
CString sDescription = m_sDescription;
|
||||
sDescription.MakeLower();
|
||||
|
||||
if( -1 != sDescription.Find("battle") )
|
||||
return D3DXCOLOR(1,0.5f,0,1); // orange
|
||||
else if( -1 != m_sDescription.Find("couple") )
|
||||
return D3DXCOLOR(0,0,1,1); // blue
|
||||
else
|
||||
return DifficultyToColor( m_Difficulty );
|
||||
if( -1 != sDescription.Find("battle") ) return NOTES_DISPLAY_BATTLE;
|
||||
else if( -1 != sDescription.Find("couple") ) return NOTES_DISPLAY_BATTLE;
|
||||
else if( -1 != sDescription.Find("smaniac") ) return NOTES_DISPLAY_S_HARD;
|
||||
else if( -1 != sDescription.Find("challenge") ) return NOTES_DISPLAY_CHALLENGE;
|
||||
|
||||
switch( m_Difficulty )
|
||||
{
|
||||
case DIFFICULTY_EASY: return NOTES_DISPLAY_EASY;
|
||||
case DIFFICULTY_MEDIUM: return NOTES_DISPLAY_MEDIUM;
|
||||
case DIFFICULTY_HARD: return NOTES_DISPLAY_HARD;
|
||||
default: ASSERT(0); return NOTES_DISPLAY_EASY;
|
||||
}
|
||||
}
|
||||
|
||||
D3DXCOLOR Notes::GetColor() const
|
||||
{
|
||||
switch( GetNotesDisplayType() )
|
||||
{
|
||||
case NOTES_DISPLAY_EASY: return COLOR_EASY;
|
||||
case NOTES_DISPLAY_MEDIUM: return COLOR_MEDIUM;
|
||||
case NOTES_DISPLAY_HARD: return COLOR_HARD;
|
||||
case NOTES_DISPLAY_S_HARD: return COLOR_S_HARD;
|
||||
case NOTES_DISPLAY_CHALLENGE: return COLOR_CHALLENGE;
|
||||
case NOTES_DISPLAY_BATTLE: return COLOR_BATTLE;
|
||||
default: return COLOR_EASY;
|
||||
}
|
||||
}
|
||||
|
||||
void Notes::TidyUpData()
|
||||
@@ -118,7 +145,7 @@ Difficulty Notes::DifficultyFromDescriptionAndMeter( CString sDescription, int i
|
||||
"easy",
|
||||
"basic",
|
||||
"light",
|
||||
"GARBAGE", // but don't worry - this will never match because the compare string is all lowercase
|
||||
"GARBAGE", // don't worry - this will never match because the compare string is all lowercase
|
||||
},
|
||||
{
|
||||
"medium",
|
||||
@@ -137,7 +164,7 @@ Difficulty Notes::DifficultyFromDescriptionAndMeter( CString sDescription, int i
|
||||
for( int i=0; i<NUM_DIFFICULTIES; i++ )
|
||||
for( int j=0; j<DESCRIPTIONS_PER_CLASS; j++ )
|
||||
if( sDescription.Find(sDescriptionParts[i][j]) != -1 )
|
||||
return Difficulty(i);
|
||||
return (Difficulty)i;
|
||||
|
||||
// guess difficulty class from meter
|
||||
if( iMeter <= 3 ) return DIFFICULTY_EASY;
|
||||
|
||||
+14
-4
@@ -16,6 +16,15 @@
|
||||
#include "Grade.h"
|
||||
class NoteData;
|
||||
|
||||
enum NotesDisplayType
|
||||
{
|
||||
NOTES_DISPLAY_EASY,
|
||||
NOTES_DISPLAY_MEDIUM,
|
||||
NOTES_DISPLAY_HARD,
|
||||
NOTES_DISPLAY_S_HARD,
|
||||
NOTES_DISPLAY_CHALLENGE,
|
||||
NOTES_DISPLAY_BATTLE
|
||||
};
|
||||
|
||||
struct Notes
|
||||
{
|
||||
@@ -29,15 +38,16 @@ public:
|
||||
|
||||
public:
|
||||
NotesType m_NotesType;
|
||||
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
|
||||
Difficulty m_Difficulty; // this is inferred from m_sDescription
|
||||
int m_iMeter; // difficulty from 1-10
|
||||
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
|
||||
Difficulty m_Difficulty; // difficulty classification
|
||||
int m_iMeter; // difficulty rating from 1-10
|
||||
float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
||||
|
||||
CString m_sSMNoteData;
|
||||
void GetNoteData( NoteData* pNoteDataOut ) const;
|
||||
void SetNoteData( NoteData* pNewNoteData );
|
||||
D3DXCOLOR GetColor() const;
|
||||
NotesDisplayType GetNotesDisplayType() const;
|
||||
D3DXCOLOR GetColor() const;
|
||||
|
||||
// Statistics
|
||||
Grade m_TopGrade;
|
||||
|
||||
@@ -203,16 +203,20 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
out.m_apNotes.Add( pNewNotes );
|
||||
|
||||
if( iNumParams != 7 )
|
||||
throw RageException( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath, iNumParams, 7 );
|
||||
|
||||
LoadFromSMTokens(
|
||||
sParams[1],
|
||||
sParams[2],
|
||||
sParams[3],
|
||||
sParams[4],
|
||||
sParams[5],
|
||||
sParams[6],
|
||||
*pNewNotes);
|
||||
{
|
||||
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have %d.", sPath, iNumParams, 7 );
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadFromSMTokens(
|
||||
sParams[1],
|
||||
sParams[2],
|
||||
sParams[3],
|
||||
sParams[4],
|
||||
sParams[5],
|
||||
sParams[6],
|
||||
*pNewNotes);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#define BANNER_Y THEME->GetMetricF("ScreenEvaluation","BannerY")
|
||||
#define STAGE_X THEME->GetMetricF("ScreenEvaluation","StageX")
|
||||
#define STAGE_Y THEME->GetMetricF("ScreenEvaluation","StageY")
|
||||
#define DIFFICULTY_ICON_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("DifficultyIconP%dX",p+1))
|
||||
#define DIFFICULTY_ICON_Y( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("DifficultyIconP%dY",p+1))
|
||||
#define GRADE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("GradeP%dX",p+1))
|
||||
#define GRADE_Y THEME->GetMetricF("ScreenEvaluation","GradeY")
|
||||
#define PERCENT_BASE_X( p ) THEME->GetMetricF("ScreenEvaluation",ssprintf("PercentBaseP%dX",p+1))
|
||||
@@ -186,7 +188,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
switch( m_ResultMode )
|
||||
{
|
||||
case RM_ARCADE_STAGE:
|
||||
m_BannerWithFrame[0].LoadFromSongAndNotes( GAMESTATE->m_pCurSong, GAMESTATE->m_pCurNotes );
|
||||
m_BannerWithFrame[0].LoadFromSong( GAMESTATE->m_pCurSong );
|
||||
m_BannerWithFrame[0].SetXY( BANNER_X, BANNER_Y );
|
||||
this->AddChild( &m_BannerWithFrame[0] );
|
||||
|
||||
@@ -197,6 +199,15 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_textStage.SetText( GAMESTATE->GetStageText() + " Stage" );
|
||||
this->AddChild( &m_textStage );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","select music difficulty icons 1x6") );
|
||||
m_DifficultyIcon[p].SetFromNotes( (PlayerNumber)p, GAMESTATE->m_pCurNotes[p] );
|
||||
m_DifficultyIcon[p].SetXY( DIFFICULTY_ICON_X(p), DIFFICULTY_ICON_Y(p) );
|
||||
this->AddChild( &m_DifficultyIcon[p] );
|
||||
}
|
||||
break;
|
||||
case RM_ARCADE_SUMMARY:
|
||||
{
|
||||
@@ -623,6 +634,9 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
m_textStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_textStage.SetTweenY( fOriginalY );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
m_DifficultyIcon[p].FadeOn( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
for( i=0; i<NUM_JUDGE_LINES; i++ )
|
||||
{
|
||||
fOriginalY = m_sprJudgeLabels[i].GetY();
|
||||
@@ -713,6 +727,9 @@ void ScreenEvaluation::TweenOffScreen()
|
||||
|
||||
m_textStage.FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
m_DifficultyIcon[p].FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
for( i=0; i<NUM_JUDGE_LINES; i++ )
|
||||
{
|
||||
m_sprJudgeLabels[i].FadeOff( 0, "foldy", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ScoreDisplayNormal.h"
|
||||
#include "StageBox.h"
|
||||
#include "BannerWithFrame.h"
|
||||
#include "DifficultyIcon.h"
|
||||
|
||||
|
||||
const int NUM_JUDGE_LINES = 7; // perfect, great, good, boo, miss, ok, max_combo
|
||||
@@ -48,6 +49,7 @@ protected:
|
||||
|
||||
BannerWithFrame m_BannerWithFrame[STAGES_TO_SHOW_IN_SUMMARY];
|
||||
BitmapText m_textStage;
|
||||
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
||||
|
||||
// used in arcade
|
||||
Sprite m_sprGradeFrame[NUM_PLAYERS];
|
||||
|
||||
@@ -307,8 +307,9 @@ ScreenGameplay::ScreenGameplay()
|
||||
if( !GAMESTATE->IsPlayerEnabled(PlayerNumber(p)) )
|
||||
continue;
|
||||
|
||||
m_DifficultyBanner[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) );
|
||||
this->AddChild( &m_DifficultyBanner[p] );
|
||||
m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","gameplay difficulty icons 2x6") );
|
||||
m_DifficultyIcon[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) );
|
||||
this->AddChild( &m_DifficultyIcon[p] );
|
||||
}
|
||||
|
||||
|
||||
@@ -539,7 +540,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
|
||||
ShowOniGameOver((PlayerNumber)p);
|
||||
|
||||
|
||||
m_DifficultyBanner[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] );
|
||||
m_DifficultyIcon[p].SetFromNotes( PlayerNumber(p), GAMESTATE->m_pCurNotes[p] );
|
||||
|
||||
|
||||
NoteData originalNoteData;
|
||||
@@ -1448,12 +1449,12 @@ void ScreenGameplay::TweenOnScreen()
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
float fOriginalX = m_DifficultyBanner[p].GetX();
|
||||
m_DifficultyBanner[p].SetX( (p==PLAYER_1) ? fOriginalX-200 : fOriginalX+200 );
|
||||
float fOriginalX = m_DifficultyIcon[p].GetX();
|
||||
m_DifficultyIcon[p].SetX( (p==PLAYER_1) ? fOriginalX-200 : fOriginalX+200 );
|
||||
if( !GAMESTATE->m_bDemonstration )
|
||||
m_DifficultyBanner[p].BeginTweening( 0.5f ); // sleep
|
||||
m_DifficultyBanner[p].BeginTweening( 1 );
|
||||
m_DifficultyBanner[p].SetTweenX( fOriginalX );
|
||||
m_DifficultyIcon[p].BeginTweening( 0.5f ); // sleep
|
||||
m_DifficultyIcon[p].BeginTweening( 1 );
|
||||
m_DifficultyIcon[p].SetTweenX( fOriginalX );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "Background.h"
|
||||
#include "LifeMeter.h"
|
||||
#include "ScoreDisplay.h"
|
||||
#include "DifficultyBanner.h"
|
||||
#include "DifficultyIcon.h"
|
||||
#include "TransitionFadeWipe.h"
|
||||
#include "TransitionOniFade.h"
|
||||
|
||||
@@ -113,7 +113,7 @@ private:
|
||||
|
||||
Player m_Player[NUM_PLAYERS];
|
||||
|
||||
DifficultyBanner m_DifficultyBanner[NUM_PLAYERS];
|
||||
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
||||
|
||||
Sprite m_sprOniGameOver[NUM_PLAYERS];
|
||||
void ShowOniGameOver( PlayerNumber pn );
|
||||
|
||||
@@ -107,6 +107,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
case 2: sHeaderFile = "select difficulty hard header"; sPictureFile = "select difficulty hard picture"; break;
|
||||
case 3: sHeaderFile = "select difficulty oni header"; sPictureFile = "select difficulty oni picture"; break;
|
||||
case 4: sHeaderFile = "select difficulty endless header"; sPictureFile = "select difficulty endless picture"; break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
m_sprPicture[d].Load( THEME->GetPathTo("Graphics",sPictureFile) );
|
||||
m_sprPicture[d].SetXY( ITEM_X(d), ITEM_Y(d) );
|
||||
@@ -305,7 +306,7 @@ bool ScreenSelectDifficulty::IsItemOnPage2( int iItemIndex )
|
||||
{
|
||||
ASSERT( iItemIndex >= 0 && iItemIndex < NUM_DIFFICULTY_ITEMS );
|
||||
|
||||
return iItemIndex >= NUM_DIFFICULTIES;
|
||||
return iItemIndex >= NUM_ITEMS_ON_PAGE_1;
|
||||
}
|
||||
|
||||
bool ScreenSelectDifficulty::SelectedSomethingOnPage2()
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
#include "MenuElements.h"
|
||||
|
||||
|
||||
const int NUM_DIFFICULTY_ITEMS = NUM_DIFFICULTIES + 2; // easy, medium, hard, Oni, Endless
|
||||
const int NUM_ITEMS_ON_PAGE_1 = 3; // easy, medium, hard,
|
||||
const int NUM_ITEMS_ON_PAGE_2 = 2; // Oni, Endless
|
||||
const int NUM_DIFFICULTY_ITEMS = NUM_ITEMS_ON_PAGE_1 + NUM_ITEMS_ON_PAGE_2;
|
||||
const int NUM_PAGES = 2; // easy-medium-hard, Oni
|
||||
|
||||
class ScreenSelectDifficulty : public Screen
|
||||
|
||||
@@ -77,7 +77,6 @@ const float TWEEN_TIME = 0.5f;
|
||||
|
||||
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User+2);
|
||||
const ScreenMessage SM_PlaySongSample = ScreenMessage(SM_User+3);
|
||||
|
||||
|
||||
|
||||
@@ -135,6 +134,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
m_sprDifficultyFrame[p].SetState( p );
|
||||
this->AddChild( &m_sprDifficultyFrame[p] );
|
||||
|
||||
m_DifficultyIcon[p].Load( THEME->GetPathTo("graphics","select music difficulty icons 1x6") );
|
||||
m_DifficultyIcon[p].SetXY( DIFFICULTY_ICON_X(p), DIFFICULTY_ICON_Y(p) );
|
||||
this->AddChild( &m_DifficultyIcon[p] );
|
||||
}
|
||||
@@ -234,6 +234,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
|
||||
m_bMadeChoice = false;
|
||||
m_bGoToOptions = false;
|
||||
m_fPlaySampleCountdown = 0;
|
||||
|
||||
UpdateOptionsDisplays();
|
||||
|
||||
@@ -378,6 +379,13 @@ void ScreenSelectMusic::Update( float fDeltaTime )
|
||||
{
|
||||
Screen::Update( fDeltaTime );
|
||||
|
||||
if( m_fPlaySampleCountdown > 0 )
|
||||
{
|
||||
m_fPlaySampleCountdown -= fDeltaTime;
|
||||
if( m_fPlaySampleCountdown < 0 )
|
||||
this->PlayMusicSample();
|
||||
}
|
||||
|
||||
float fNewRotation = m_sprCDTitle.GetRotationY()+D3DX_PI*fDeltaTime/2;
|
||||
fNewRotation = fmodf( fNewRotation, D3DX_PI*2 );
|
||||
m_sprCDTitle.SetRotationY( fNewRotation );
|
||||
@@ -530,9 +538,6 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
SCREENMAN->SetNewScreen( "ScreenStage" );
|
||||
}
|
||||
break;
|
||||
case SM_PlaySongSample:
|
||||
PlayMusicSample();
|
||||
break;
|
||||
case SM_SongChanged:
|
||||
AfterMusicChange();
|
||||
break;
|
||||
@@ -686,7 +691,7 @@ void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
|
||||
if( m_pNotes )
|
||||
m_HighScore[pn].SetScore( (float)m_pNotes->m_iTopScore );
|
||||
|
||||
m_DifficultyIcon[pn].SetFromNotes( pNotes );
|
||||
m_DifficultyIcon[pn].SetFromNotes( pn, pNotes );
|
||||
m_FootMeter[pn].SetFromNotes( pNotes );
|
||||
m_GrooveRadar.SetFromNotes( pn, pNotes );
|
||||
m_MusicWheel.NotesChanged( pn );
|
||||
@@ -721,7 +726,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
case TYPE_SONG:
|
||||
{
|
||||
MUSIC->Stop();
|
||||
this->SendScreenMessage( SM_PlaySongSample, SAMPLE_MUSIC_DELAY );
|
||||
m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY;
|
||||
|
||||
for( int pn = 0; pn < NUM_PLAYERS; ++pn) {
|
||||
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), pn, m_arrayNotes[pn] );
|
||||
@@ -743,8 +748,13 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) )
|
||||
continue;
|
||||
for( int i=0; i<m_arrayNotes[p].GetSize(); i++ )
|
||||
{
|
||||
if( m_arrayNotes[p][i]->m_Difficulty == GAMESTATE->m_PreferredDifficulty[p] )
|
||||
{
|
||||
m_iSelection[p] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes[p].GetSize() ) ;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ protected:
|
||||
bool m_bMadeChoice;
|
||||
bool m_bGoToOptions;
|
||||
Sprite m_sprOptionsMessage;
|
||||
float m_fPlaySampleCountdown;
|
||||
|
||||
RageSoundSample m_soundSelect;
|
||||
RageSoundSample m_soundChangeNotes;
|
||||
|
||||
+15
-1
@@ -33,7 +33,7 @@
|
||||
#include "NotesLoaderKSF.h"
|
||||
#include "NotesWriterDWI.h"
|
||||
|
||||
const int FILE_CACHE_VERSION = 97; // increment this when Song or Notes changes to invalidate cache
|
||||
const int FILE_CACHE_VERSION = 99; // increment this when Song or Notes changes to invalidate cache
|
||||
|
||||
|
||||
int CompareBPMSegments(const void *arg1, const void *arg2)
|
||||
@@ -544,6 +544,20 @@ void Song::TidyUpData()
|
||||
else
|
||||
m_fLastBeat = max( m_fLastBeat, fLastBeat );
|
||||
}
|
||||
|
||||
// challenge notes are encoded as smaniac. If there is only one Notes for
|
||||
// a NotesType and it's "smaniac", then convert it to "Challenge"
|
||||
for( NotesType nt=(NotesType)0; nt<NUM_NOTES_TYPES; nt=(NotesType)(nt+1) )
|
||||
{
|
||||
CArray<Notes*,Notes*> apNotes;
|
||||
GetNotesThatMatch( nt, apNotes );
|
||||
if( apNotes.GetSize() == 1 )
|
||||
if( 0 == apNotes[0]->m_sDescription.CompareNoCase("smaniac") )
|
||||
{
|
||||
apNotes[0]->m_sDescription = "Challenge";
|
||||
apNotes[0]->m_Difficulty = DIFFICULTY_HARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get Notes that match a given style and player. */
|
||||
|
||||
@@ -678,10 +678,10 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
RelativePath="CroppedSprite.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DifficultyIcon.cpp">
|
||||
RelativePath="DifficultyIcon.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\DifficultyIcon.h">
|
||||
RelativePath="DifficultyIcon.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FadingBanner.cpp">
|
||||
@@ -843,12 +843,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
<File
|
||||
RelativePath=".\Combo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="DifficultyBanner.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="DifficultyBanner.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\FocusingSprite.cpp">
|
||||
</File>
|
||||
|
||||
Reference in New Issue
Block a user