overhauling editor UI

This commit is contained in:
Chris Danford
2003-02-18 23:15:38 +00:00
parent b64afd4f0c
commit ac9e58f760
32 changed files with 1209 additions and 674 deletions
+8 -8
View File
@@ -83,7 +83,7 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
for(i=0; i<4; i++)
m_temp.diffuse[i] = bBlinkOn ? m_effectColor1 : m_effectColor2;
break;
case diffuse_camelion:
case diffuse_shift:
for(i=0; i<4; i++)
m_temp.diffuse[i] = m_effectColor1*fPercentBetweenColors + m_effectColor2*(1.0f-fPercentBetweenColors);
break;
@@ -91,7 +91,7 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
m_temp.glow = bBlinkOn ? m_effectColor1 : m_effectColor2;
m_temp.glow.a *= fOriginalAlpha; // don't glow if the Actor is transparent!
break;
case glow_camelion:
case glow_shift:
m_temp.glow = m_effectColor1*fPercentBetweenColors + m_effectColor2*(1.0f-fPercentBetweenColors);
m_temp.glow.a *= fOriginalAlpha; // don't glow if the Actor is transparent!
break;
@@ -224,9 +224,9 @@ void Actor::Update( float fDeltaTime )
case no_effect:
break;
case diffuse_blinking:
case diffuse_camelion:
case diffuse_shift:
case glow_blinking:
case glow_camelion:
case glow_shift:
case wagging:
case bouncing:
case bobbing:
@@ -400,9 +400,9 @@ void Actor::SetEffectDiffuseBlinking( float fEffectPeriodSeconds, RageColor c1,
m_fSecsIntoEffect = 0;
}
void Actor::SetEffectDiffuseCamelion( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
void Actor::SetEffectDiffuseShift( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
{
m_Effect = diffuse_camelion;
m_Effect = diffuse_shift;
m_effectColor1 = c1;
m_effectColor2 = c2;
m_fEffectPeriodSeconds = fEffectPeriodSeconds;
@@ -418,9 +418,9 @@ void Actor::SetEffectGlowBlinking( float fEffectPeriodSeconds, RageColor c1, Rag
m_fSecsIntoEffect = 0;
}
void Actor::SetEffectGlowCamelion( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
void Actor::SetEffectGlowShift( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
{
m_Effect = glow_camelion;
m_Effect = glow_shift;
m_effectColor1 = c1;
m_effectColor2 = c2;
m_fEffectPeriodSeconds = fEffectPeriodSeconds;
+5 -5
View File
@@ -31,8 +31,8 @@ public:
TWEEN_SPRING,
};
enum Effect { no_effect,
diffuse_blinking, diffuse_camelion,
glow_blinking, glow_camelion,
diffuse_blinking, diffuse_shift,
glow_blinking, glow_shift,
wagging, spinning,
vibrating, flickering,
bouncing, bobbing
@@ -156,13 +156,13 @@ public:
void SetEffectDiffuseBlinking( float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(0.5f,0.5f,0.5f,1),
RageColor c2 = RageColor(1,1,1,1) );
void SetEffectDiffuseCamelion( float fEffectPeriodSeconds = 1.0f,
void SetEffectDiffuseShift( float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(0,0,0,1),
RageColor c2 = RageColor(1,1,1,1) );
void SetEffectGlowBlinking( float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(1,1,1,0.2f),
RageColor c2 = RageColor(1,1,1,0.8f) );
void SetEffectGlowCamelion( float fEffectPeriodSeconds = 1.0f,
void SetEffectGlowShift( float fEffectPeriodSeconds = 1.0f,
RageColor c1 = RageColor(1,1,1,0.2f),
RageColor c2 = RageColor(1,1,1,0.8f) );
void SetEffectWagging( float fWagRadians = 0.2,
@@ -278,7 +278,7 @@ protected:
float m_fSecsIntoEffect;
float m_fEffectPeriodSeconds;
// Counting variables for camelion and glowing:
// Counting variables for shift and glowing:
RageColor m_effectColor1;
RageColor m_effectColor2;
+3 -1
View File
@@ -184,12 +184,14 @@ float ArrowGetGlow( PlayerNumber pn, float fYPos, float fPercentFadeToFail )
float ArrowGetBrightness( PlayerNumber pn, float fNoteBeat )
{
if( GAMESTATE->m_bEditing )
return 1;
float fSongBeat = GAMESTATE->m_fSongBeat;
float fBeatsUntilStep = fNoteBeat - fSongBeat;
float fBrightness = SCALE( fBeatsUntilStep, 0, -1, 1.f, 0.f );
CLAMP( fBrightness, 0, 1 );
// noisy printf( "fBrightness = %f\n", fBrightness );
return fBrightness;
}
+4
View File
@@ -226,12 +226,16 @@ void EditMenu::ChangeToRow( Row newRow )
m_sprArrows[i].SetY( ROW_Y(newRow) );
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
}
void EditMenu::OnRowValueChanged( Row row )
{
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
switch( row )
{
+1 -1
View File
@@ -37,7 +37,7 @@ void FootMeter::SetFromNotes( Notes* pNotes )
SetDiffuse( RageColor(1,1,1,1) );
SetNumFeet( pNotes->GetMeter() );
if( pNotes->GetMeter() > GLOW_IF_METER_GREATER_THAN )
this->SetEffectGlowCamelion();
this->SetEffectGlowShift();
else
this->SetEffectNone();
+2 -2
View File
@@ -84,12 +84,12 @@ void GroupList::AfterChange()
m_sprButton[iSel].StopTweening();
m_sprButton[iSel].BeginTweening( 0.2f );
m_sprButton[iSel].SetTweenX( BUTTON_SELECTED_X );
m_sprButton[iSel].SetEffectGlowCamelion();
m_sprButton[iSel].SetEffectGlowShift();
m_screenLabels[iSel].StopTweening();
m_screenLabels[iSel].BeginTweening( 0.2f );
m_screenLabels[iSel].SetTweenX( BUTTON_SELECTED_X );
m_screenLabels[iSel].SetEffectGlowCamelion();
m_screenLabels[iSel].SetEffectGlowShift();
}
void GroupList::Up()
+4
View File
@@ -162,12 +162,16 @@ void JukeboxMenu::ChangeToRow( Row newRow )
m_sprArrows[i].SetY( ROW_Y(newRow) );
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
}
void JukeboxMenu::OnRowValueChanged( Row row )
{
m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
m_sprArrows[0].EnableAnimation( CanGoLeft() );
m_sprArrows[1].EnableAnimation( CanGoRight() );
switch( row )
{
+2 -2
View File
@@ -87,8 +87,8 @@ void MenuTimer::Update( float fDeltaTime )
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("hurry up") );
else if( fOldSecondsLeft > 5 && fNewSecondsLeft < 5 ) // transition to below 5
{
m_textDigit1.SetEffectGlowCamelion( 0.15f, RageColor(1,0,0,0), RageColor(1,0,0,1) );
m_textDigit2.SetEffectGlowCamelion( 0.15f, RageColor(1,0,0,0), RageColor(1,0,0,1) );
m_textDigit1.SetEffectGlowShift( 0.15f, RageColor(1,0,0,0), RageColor(1,0,0,1) );
m_textDigit2.SetEffectGlowShift( 0.15f, RageColor(1,0,0,0), RageColor(1,0,0,1) );
m_soundBeep.Play();
}
else if( fOldSecondsLeft > 4 && fNewSecondsLeft < 4 ) // transition to below 4
+1 -1
View File
@@ -80,7 +80,7 @@ MusicWheel::MusicWheel()
m_sprSelectionOverlay.Load( THEME->GetPathTo("Graphics","select music song highlight") );
m_sprSelectionOverlay.SetXY( 0, 0 );
m_sprSelectionOverlay.SetDiffuse( RageColor(1,1,1,1) );
m_sprSelectionOverlay.SetEffectGlowCamelion( 1.0f, RageColor(1,1,1,0.4f), RageColor(1,1,1,1) );
m_sprSelectionOverlay.SetEffectGlowShift( 1.0f, RageColor(1,1,1,0.4f), RageColor(1,1,1,1) );
AddChild( &m_sprSelectionOverlay );
m_ScrollBar.SetX( SCROLL_BAR_X );
+89 -39
View File
@@ -795,7 +795,7 @@ void NoteDataUtil::RemoveHoldNotes(NoteData &in)
}
void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
void NoteDataUtil::Turn( NoteData &in, TurnType tt )
{
int iTakeFromTrack[MAX_NOTE_TRACKS]; // New track "t" will take from old track iTakeFromTrack[t]
@@ -803,15 +803,10 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
switch( tt )
{
case PlayerOptions::TURN_NONE:
return; // nothing to do
case PlayerOptions::TURN_MIRROR:
for( t=0; t<in.GetNumTracks(); t++ )
iTakeFromTrack[t] = in.GetNumTracks()-t-1;
break;
case PlayerOptions::TURN_LEFT:
case PlayerOptions::TURN_RIGHT: // HACK: TurnRight does the same thing as TurnLeft. I'll fix this later...
// Chris: Handling each NotesType case is a terrible way to do this, but oh well...
case left:
case right:
// FIXME: TurnRight does the same thing as TurnLeft.
// Is there a way to do this withoutn handling each NotesType? -Chris
switch( GAMESTATE->GetCurrentStyleDef()->m_NotesType )
{
case NOTES_TYPE_DANCE_SINGLE:
@@ -878,8 +873,12 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
break;
}
break;
case PlayerOptions::TURN_SHUFFLE:
case PlayerOptions::TURN_SUPER_SHUFFLE: // use this code to shuffle the HoldNotes
case mirror:
for( t=0; t<in.GetNumTracks(); t++ )
iTakeFromTrack[t] = in.GetNumTracks()-t-1;
break;
case shuffle:
case super_shuffle: // use this code to shuffle the HoldNotes
{
vector<int> aiTracksLeftToMap;
for( t=0; t<in.GetNumTracks(); t++ )
@@ -895,8 +894,6 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
}
}
break;
// handle this below
break;
default:
ASSERT(0);
}
@@ -915,41 +912,85 @@ void NoteDataUtil::Turn( NoteData &in, PlayerOptions::TurnType tt )
in.CopyAll( &tempNoteData ); // copy note data from newData back into this
in.Convert2sAnd3sToHoldNotes();
if( tt == PlayerOptions::TURN_SUPER_SHUFFLE )
SuperShuffleTaps( in );
}
void NoteDataUtil::SuperShuffleTaps( NoteData &in )
{
// We already did the normal shuffling code above, which did a good job
// of shuffling HoldNotes without creating impossible patterns.
// Now, go in and shuffle the TapNotes per-row.
in.ConvertHoldNotesTo4s();
int max_row = in.GetLastRow();
for( int r=0; r<=max_row; r++ )
{
// We already did the normal shuffling code above, which did a good job
// of shuffling HoldNotes without creating impossible patterns.
// Now, go in and shuffle the TapNotes per-row.
in.ConvertHoldNotesTo4s();
for( int r=0; r<=max_row; r++ )
for( int t1=0; t1<in.GetNumTracks(); t1++ )
{
for( int t1=0; t1<in.GetNumTracks(); t1++ )
TapNote tn1 = in.GetTapNote(t1, r);
if( tn1!='4' ) // a tap that is not part of a hold
{
TapNote tn1 = in.GetTapNote(t1, r);
if( tn1!='4' ) // a tap that is not part of a hold
// probe for a spot to swap with
while( 1 )
{
// probe for a spot to swap with
while( 1 )
int t2 = rand() % in.GetNumTracks();
TapNote tn2 = in.GetTapNote(t2, r);
if( tn2!='4' ) // a tap that is not part of a hold
{
int t2 = rand() % in.GetNumTracks();
TapNote tn2 = in.GetTapNote(t2, r);
if( tn2!='4' ) // a tap that is not part of a hold
{
// swap
in.SetTapNote(t1, r, tn2);
in.SetTapNote(t2, r, tn1);
break;
}
// swap
in.SetTapNote(t1, r, tn2);
in.SetTapNote(t2, r, tn1);
break;
}
}
}
}
in.Convert4sToHoldNotes();
}
in.Convert4sToHoldNotes();
}
void NoteDataUtil::MakeLittle(NoteData &in)
void NoteDataUtil::Backwards( NoteData &in )
{
in.ConvertHoldNotesTo4s();
int max_row = in.GetLastRow();
for( int r=0; r<=max_row/2; r++ )
{
int iRowEarlier = r;
int iRowLater = max_row-r;
for( int t=0; t<in.GetNumTracks(); t++ )
{
TapNote tnEarlier = in.GetTapNote(t, iRowEarlier);
TapNote tnLater = in.GetTapNote(t, iRowLater);
in.SetTapNote(t, iRowEarlier, tnLater);
in.SetTapNote(t, iRowLater, tnEarlier);
}
}
in.Convert4sToHoldNotes();
}
void NoteDataUtil::SwapSides( NoteData &in )
{
in.ConvertHoldNotesTo4s();
int max_row = in.GetLastRow();
for( int r=0; r<=max_row; r++ )
{
for( int t=0; t<in.GetNumTracks()/2; t++ )
{
int iTrackEarlier = t;
int iTrackLater = in.GetNumTracks()-1-t;
TapNote tnEarlier = in.GetTapNote(iTrackEarlier, r);
TapNote tnLater = in.GetTapNote(iTrackLater, r);
in.SetTapNote(iTrackEarlier, r, tnLater);
in.SetTapNote(iTrackLater, r, tnEarlier);
}
}
in.Convert4sToHoldNotes();
}
void NoteDataUtil::Little(NoteData &in)
{
// filter out all non-quarter notes
int max_row = in.GetLastRow();
@@ -968,7 +1009,7 @@ void NoteDataUtil::MakeLittle(NoteData &in)
// leave HoldNotes unchanged (what should be do with them?)
}
void NoteDataUtil::MakeBig(NoteData &in)
void NoteDataUtil::Big( NoteData &in )
{
in.ConvertHoldNotesTo4s();
@@ -976,12 +1017,21 @@ void NoteDataUtil::MakeBig(NoteData &in)
int max_row = in.GetLastRow();
for( int i=0; i<=max_row; i+=ROWS_PER_BEAT )
{
int iNum = in.GetNumTapNonEmptyTracksInRow(i);
int iNum = in.GetNumTapNonEmptyTracks(i);
if( iNum == 1 )
{
// add a note determinitsitcally
int iBeat = (int)roundf( NoteRowToBeat(i) );
int iTrackToAdd = iBeat % in.GetNumTracks();
int iTrackOfNote = in.GetFirstNonEmptyTrack(i);
int iTrackToAdd = iTrackOfNote + (iBeat%4)-2;
CLAMP( iTrackToAdd, 0, in.GetNumTracks() );
if( iTrackToAdd == iTrackOfNote )
iTrackToAdd++;
CLAMP( iTrackToAdd, 0, in.GetNumTracks() );
if( iTrackToAdd == iTrackOfNote )
iTrackToAdd--;
CLAMP( iTrackToAdd, 0, in.GetNumTracks() );
if( in.GetTapNote(iTrackToAdd, i) != TAP_EMPTY )
{
iTrackToAdd = (iTrackToAdd+1) % in.GetNumTracks();
+16 -6
View File
@@ -15,7 +15,6 @@
*/
//#include "GameConstantsAndTypes.h"
#include "PlayerOptions.h"
#include "NoteTypes.h"
// '1' = tap note
@@ -68,7 +67,7 @@ public:
return false;
return true;
}
inline int GetNumTapNonEmptyTracksInRow( int index ) const
inline int GetNumTapNonEmptyTracks( int index ) const
{
int iNum = 0;
for( int t=0; t<m_iNumTracks; t++ )
@@ -76,6 +75,13 @@ public:
iNum++;
return iNum;
}
inline int GetFirstNonEmptyTrack( int index ) const
{
for( int t=0; t<m_iNumTracks; t++ )
if( GetTapNote(t, index) != TAP_EMPTY )
return t;
return -1;
}
// used in edit/record
void AddHoldNote( HoldNote newNote ); // add note hold note merging overlapping HoldNotes and destroying TapNotes underneath
@@ -129,10 +135,14 @@ namespace NoteDataUtil
// radar values - return between 0.0 and 1.2
float GetRadarValue( const NoteData &in, RadarCategory rv, float fSongSeconds );
void RemoveHoldNotes(NoteData &in);
void Turn( NoteData &in, PlayerOptions::TurnType tt );
void MakeLittle(NoteData &in);
void MakeBig(NoteData &in);
void RemoveHoldNotes( NoteData &in );
enum TurnType { left, right, mirror, shuffle, super_shuffle, NUM_TURN_TYPES };
void Turn( NoteData &in, TurnType tt );
void Little( NoteData &in );
void Big( NoteData &in );
void SuperShuffleTaps( NoteData &in );
void Backwards( NoteData &in );
void SwapSides( NoteData &in );
void SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
inline void SnapToNearestNoteType( NoteData &in, NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( in, nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
+84 -27
View File
@@ -37,7 +37,7 @@ NoteField::NoteField()
m_textMeasureNumber.SetZoom( 1.0f );
m_rectMarkerBar.TurnShadowOff();
m_rectMarkerBar.SetEffectGlowCamelion();
m_rectMarkerBar.SetEffectDiffuseShift( 2, RageColor(1,1,1,0.5f), RageColor(0.5f,0.5f,0.5f,0.5f) );
m_fBeginMarker = m_fEndMarker = -1;
@@ -75,25 +75,56 @@ void NoteField::Update( float fDeltaTime )
m_fPercentFadeToFail = min( m_fPercentFadeToFail + fDeltaTime/1.5f, 1 ); // take 1.5 seconds to totally fade
}
void NoteField::DrawMeasureBar( int iMeasureIndex )
int NoteField::GetWidth()
{
const int iMeasureNoDisplay = iMeasureIndex+1;
const float fBeat = float(iMeasureIndex * BEATS_PER_MEASURE);
return (GetNumTracks()+1) * ARROW_SIZE;
}
void NoteField::DrawBeatBar( const float fBeat )
{
bool bIsMeasure = fmodf( fBeat, (float)BEATS_PER_MEASURE ) == 0;
int iMeasureIndex = (int)fBeat / BEATS_PER_MEASURE;
int iMeasureNoDisplay = iMeasureIndex+1;
NoteType nt = BeatToNoteType( fBeat );
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
const float fYPos = ArrowGetYPos( m_PlayerNumber, fYOffset );
m_rectMeasureBar.SetXY( 0, fYPos );
m_rectMeasureBar.SetZoomX( (float)(GetNumTracks()+1) * ARROW_SIZE );
m_rectMeasureBar.SetZoomY( 20 );
m_rectMeasureBar.SetDiffuse( RageColor(0,0,0,0.5f) );
m_rectMeasureBar.Draw();
m_textMeasureNumber.SetDiffuse( RageColor(1,1,1,1) );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,0) );
m_textMeasureNumber.SetText( ssprintf("%d", iMeasureNoDisplay) );
m_textMeasureNumber.SetXY( -m_rectMeasureBar.GetZoomedWidth()/2 + 10, fYPos );
m_textMeasureNumber.Draw();
int iSegWidth;
int iSpaceWidth;
float fBrightness;
float fScrollSpeed = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fScrollSpeed;
switch( nt )
{
default: ASSERT(0);
case NOTE_TYPE_4TH: iSegWidth = 16; iSpaceWidth = 0; fBrightness = 1; break;
case NOTE_TYPE_8TH: iSegWidth = 12; iSpaceWidth = 4; fBrightness = SCALE(fScrollSpeed,1.f,2.f,0.f,1.f); break;
case NOTE_TYPE_16TH:iSegWidth = 4; iSpaceWidth = 4; fBrightness = SCALE(fScrollSpeed,2.f,4.f,0.f,1.f); break;
}
CLAMP( fBrightness, 0, 1 );
int iWidth = GetWidth();
for( int i=-iWidth/2; i<+iWidth/2; )
{
m_rectMeasureBar.StretchTo( RectI(i,0,i+iSegWidth,0) );
m_rectMeasureBar.SetY( fYPos );
m_rectMeasureBar.SetZoomY( bIsMeasure ? 6.f : 2.f );
m_rectMeasureBar.SetDiffuse( RageColor(1,1,1,0.5f*fBrightness) );
m_rectMeasureBar.Draw();
i += iSegWidth + iSpaceWidth;
}
if( bIsMeasure )
{
m_textMeasureNumber.SetDiffuse( RageColor(1,1,1,1) );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,0) );
m_textMeasureNumber.SetText( ssprintf("%d", iMeasureNoDisplay) );
m_textMeasureNumber.SetXY( -iWidth/2.f + 10, fYPos );
m_textMeasureNumber.Draw();
}
}
void NoteField::DrawMarkerBar( const float fBeat )
@@ -103,11 +134,25 @@ void NoteField::DrawMarkerBar( const float fBeat )
m_rectMarkerBar.SetXY( 0, fYPos );
m_rectMarkerBar.SetZoomX( (float)(GetNumTracks()+1) * ARROW_SIZE );
m_rectMarkerBar.SetZoomY( 20 );
m_rectMarkerBar.SetDiffuse( RageColor(0,0,0,0.5f) );
m_rectMarkerBar.SetZoomY( (float)ARROW_SIZE );
m_rectMarkerBar.Draw();
}
void NoteField::DrawAreaHighlight( const float fStartBeat, const float fEndBeat )
{
const float fYStartOffset = ArrowGetYOffset( m_PlayerNumber, fStartBeat );
const float fYStartPos = ArrowGetYPos( m_PlayerNumber, fYStartOffset );
const float fYEndOffset = ArrowGetYOffset( m_PlayerNumber, fEndBeat );
const float fYEndPos = ArrowGetYPos( m_PlayerNumber, fYEndOffset );
m_rectAreaHighlight.StretchTo( RectI(0, (int)fYStartPos-ARROW_SIZE/2, 1, (int)fYEndPos+ARROW_SIZE/2) );
m_rectAreaHighlight.SetZoomX( (float)(GetNumTracks()+1) * ARROW_SIZE );
m_rectAreaHighlight.SetDiffuse( RageColor(1,0,0,0.3f) );
m_rectAreaHighlight.Draw();
}
void NoteField::DrawBPMText( const float fBeat, const float fBPM )
{
const float fYOffset = ArrowGetYOffset( m_PlayerNumber, fBeat );
@@ -116,7 +161,7 @@ void NoteField::DrawBPMText( const float fBeat, const float fBPM )
m_textMeasureNumber.SetDiffuse( RageColor(1,0,0,1) );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,cosf(RageTimer::GetTimeSinceStart()*2)/2+0.5f) );
m_textMeasureNumber.SetText( ssprintf("%.2f", fBPM) );
m_textMeasureNumber.SetXY( -m_rectMeasureBar.GetZoomedWidth()/2 - 60, fYPos );
m_textMeasureNumber.SetXY( -GetWidth()/2.f - 60, fYPos );
m_textMeasureNumber.Draw();
}
@@ -128,7 +173,7 @@ void NoteField::DrawFreezeText( const float fBeat, const float fSecs )
m_textMeasureNumber.SetDiffuse( RageColor(0.8f,0.8f,0,1) );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,cosf(RageTimer::GetTimeSinceStart()*2)/2+0.5f) );
m_textMeasureNumber.SetText( ssprintf("%.2f", fSecs) );
m_textMeasureNumber.SetXY( -m_rectMeasureBar.GetZoomedWidth()/2 - 10, fYPos );
m_textMeasureNumber.SetXY( -GetWidth()/2.f - 10, fYPos );
m_textMeasureNumber.Draw();
}
@@ -140,7 +185,7 @@ void NoteField::DrawBGChangeText( const float fBeat, const CString sNewBGName )
m_textMeasureNumber.SetDiffuse( RageColor(0,1,0,1) );
m_textMeasureNumber.SetGlow( RageColor(1,1,1,cosf(RageTimer::GetTimeSinceStart()*2)/2+0.5f) );
m_textMeasureNumber.SetText( sNewBGName );
m_textMeasureNumber.SetXY( +m_rectMeasureBar.GetZoomedWidth()/2 + 10, fYPos );
m_textMeasureNumber.SetXY( +GetWidth()/2.f + 10, fYPos );
m_textMeasureNumber.Draw();
}
@@ -193,12 +238,13 @@ void NoteField::DrawPrimitives()
unsigned i;
//
// Draw measure bars
// Draw beat bars
//
unsigned iFirstMeasureToDraw = max(0, int(fFirstBeatToDraw)/BEATS_PER_MEASURE);
unsigned iLastMeasureToDraw = max(0, (int(fLastBeatToDraw)/BEATS_PER_MEASURE)+1);
for( i=iFirstMeasureToDraw; i<=iLastMeasureToDraw; i++ )
DrawMeasureBar( i );
{
float fStartDrawingMeasureBars = max( 0, froundf(fFirstBeatToDraw-0.25f,0.25f) );
for( float f=fStartDrawingMeasureBars; f<fLastBeatToDraw; f+=0.25f )
DrawBeatBar( f );
}
//
// BPM text
@@ -235,9 +281,11 @@ void NoteField::DrawPrimitives()
//
// Draw marker bars
//
if( m_fBeginMarker != -1 )
if( m_fBeginMarker != -1 && m_fEndMarker != -1 )
DrawAreaHighlight( m_fBeginMarker, m_fEndMarker );
else if( m_fBeginMarker != -1 )
DrawMarkerBar( m_fBeginMarker );
if( m_fEndMarker != -1 )
else if( m_fEndMarker != -1 )
DrawMarkerBar( m_fEndMarker );
}
@@ -304,7 +352,16 @@ void NoteField::DrawPrimitives()
}
}
m_NoteDisplay[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, m_fPercentFadeToFail );
bool bIsInSelectionRange = false;
float fGlow = 0;
if( m_fBeginMarker!=-1 && m_fEndMarker!=-1 )
{
float fBeat = NoteRowToBeat(i);
bIsInSelectionRange = m_fBeginMarker<=fBeat && fBeat<=m_fEndMarker;
fGlow = SCALE( cosf(RageTimer::GetTimeSinceStart()*2), -1, 1, 0.1f, 0.3f );
}
m_NoteDisplay[c].DrawTap( c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bIsInSelectionRange ? fGlow : m_fPercentFadeToFail );
}
}
+4 -1
View File
@@ -42,11 +42,13 @@ public:
void FadeToFail();
protected:
void DrawMeasureBar( const int iMeasureIndex );
void DrawBeatBar( const float fBeat );
void DrawMarkerBar( const float fBeat );
void DrawAreaHighlight( const float fStartBeat, const float fEndBeat );
void DrawBPMText( const float fBeat, const float fBPM );
void DrawFreezeText( const float fBeat, const float fBPM );
void DrawBGChangeText( const float fBeat, const CString sNewBGName );
int GetWidth();
float m_fPercentFadeToFail; // -1 of not fading to fail
@@ -61,6 +63,7 @@ protected:
Quad m_rectMeasureBar;
BitmapText m_textMeasureNumber;
Quad m_rectMarkerBar;
Quad m_rectAreaHighlight;
};
#endif
+14 -12
View File
@@ -100,21 +100,23 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
if( !GAMESTATE->m_PlayerOptions[pn].m_bHoldNotes )
NoteDataUtil::RemoveHoldNotes(*this);
NoteDataUtil::Turn( *this, GAMESTATE->m_PlayerOptions[pn].m_TurnType );
switch( GAMESTATE->m_PlayerOptions[pn].m_TurnType )
{
case PlayerOptions::TURN_NONE: break;
case PlayerOptions::TURN_MIRROR: NoteDataUtil::Turn( *this, NoteDataUtil::mirror ); break;
case PlayerOptions::TURN_LEFT: NoteDataUtil::Turn( *this, NoteDataUtil::left ); break;
case PlayerOptions::TURN_RIGHT: NoteDataUtil::Turn( *this, NoteDataUtil::right ); break;
case PlayerOptions::TURN_SHUFFLE: NoteDataUtil::Turn( *this, NoteDataUtil::shuffle ); break;
case PlayerOptions::TURN_SUPER_SHUFFLE: NoteDataUtil::Turn( *this, NoteDataUtil::super_shuffle ); break;
default: ASSERT(0);
}
switch( GAMESTATE->m_PlayerOptions[pn].m_Transform )
{
case PlayerOptions::TRANSFORM_NONE:
break;
case PlayerOptions::TRANSFORM_LITTLE:
NoteDataUtil::MakeLittle(*this);
break;
case PlayerOptions::TRANSFORM_BIG:
NoteDataUtil::MakeBig(*this);
break;
default:
ASSERT(0); // invalid value
break;
case PlayerOptions::TRANSFORM_NONE: break;
case PlayerOptions::TRANSFORM_LITTLE: NoteDataUtil::Little(*this); break;
case PlayerOptions::TRANSFORM_BIG: NoteDataUtil::Big(*this); break;
default: ASSERT(0);
}
int iPixelsToDrawBefore = -60;
File diff suppressed because it is too large Load Diff
+75 -10
View File
@@ -36,8 +36,6 @@ public:
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
void InputEdit( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
void InputActionMenu( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
void InputNamingMenu( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI, bool forceShiftPressed = false );
void InputRecord( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
void InputPlay( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
@@ -52,7 +50,7 @@ protected:
void MenuItemLoseFocus( BitmapText* menuitem );
enum EditMode { MODE_EDITING, MODE_ACTION_MENU, MODE_NAMING_MENU, MODE_RECORDING, MODE_PLAYING };
enum EditMode { MODE_EDITING, MODE_RECORDING, MODE_PLAYING };
EditMode m_EditMode;
Song* m_pSong;
@@ -64,10 +62,10 @@ protected:
SnapDisplay m_SnapDisplay;
GrayArrowRow m_GrayArrowRowEdit;
BitmapText m_textInfo; // status information that changes
Sprite m_sprHelp;
BitmapText m_textHelp;
Quad m_rectShortcutsBack;
BitmapText m_textShortcuts;
Sprite m_sprInfo;
BitmapText m_textInfo; // status information that changes
// keep track of where we are and what we're doing
float m_fTrailingBeat; // this approaches GAMESTATE->m_fSongBeat, which is the actual beat
@@ -75,6 +73,8 @@ protected:
* -1 when shift isn't pressed: */
float shiftAnchor;
float m_fDestinationScrollSpeed;
NoteData m_Clipboard;
RageSound m_soundChangeLine;
@@ -99,13 +99,78 @@ protected:
Quad m_rectRecordBack;
RageSound m_soundMusic;
int m_iMenuSelection;
BitmapText m_textActionMenu[NUM_ACTION_MENU_ITEMS];
BitmapText m_textNamingMenu[NUM_NAMING_MENU_ITEMS];
int m_iRowLastCrossed;
RageSound m_soundAssistTick;
public:
enum MainMenuChoice {
edit_notes_statistics,
play_whole_song,
save,
editor_options,
player_options,
song_options,
edit_song_info,
edit_bpm,
edit_stop,
edit_bg_change,
play_preview_music,
exit,
NUM_MAIN_MENU_CHOICES
};
void HandleMainMenuChoice( MainMenuChoice c, int* iAnswers );
enum AreaMenuChoice {
cut,
copy,
paste,
clear,
quantize,
transform,
play,
record,
insert_and_shift,
delete_and_shift,
NUM_AREA_MENU_CHOICES
};
void HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers );
enum TransformType { little, big, left, right, mirror, shuffle, super_shuffle, backwards, swap_sides, NUM_TRANSFORM_TYPES };
enum EditNotesStatisticsChoice {
difficulty,
meter,
description,
tap_notes,
hold_notes,
stream,
voltage,
air,
freeze,
chaos,
NUM_EDIT_NOTES_STATISTICS_CHOICES
};
void HandleEditNotesStatisticsChoice( EditNotesStatisticsChoice c, int* iAnswers );
enum EditOptionsChoice {
zoom,
max_notes_per_row,
after_note_add,
NUM_EDIT_OPTIONS_CHOICES
};
void HandleEditOptionsChoice( EditOptionsChoice c, int* iAnswers );
enum EditSongInfoChoice {
main_title,
sub_title,
artist,
main_title_transliteration,
sub_title_transliteration,
artist_transliteration,
NUM_EDIT_SONG_INFO_CHOICES
};
void HandleEditSongInfoChoice( EditSongInfoChoice c, int* iAnswers );
};
+6 -6
View File
@@ -330,7 +330,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_textOniPercentLarge[p].SetXY( PERCENT_BASE_X(p), PERCENT_BASE_Y );
m_textOniPercentLarge[p].SetHorizAlign( Actor::align_right );
m_textOniPercentLarge[p].SetVertAlign( Actor::align_bottom );
m_textOniPercentLarge[p].SetEffectGlowCamelion( 2.5f );
m_textOniPercentLarge[p].SetEffectGlowShift( 2.5f );
this->AddChild( &m_textOniPercentLarge[p] );
m_textOniPercentSmall[p].LoadFromNumbers( THEME->GetPathTo("Numbers","evaluation percent numbers") );
@@ -339,7 +339,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_textOniPercentSmall[p].SetXY( PERCENT_BASE_X(p), PERCENT_BASE_Y );
m_textOniPercentSmall[p].SetHorizAlign( Actor::align_left );
m_textOniPercentSmall[p].SetVertAlign( Actor::align_bottom );
m_textOniPercentSmall[p].SetEffectGlowCamelion( 2.5f );
m_textOniPercentSmall[p].SetEffectGlowShift( 2.5f );
this->AddChild( &m_textOniPercentSmall[p] );
stageStats.iPossibleDancePoints[p] = max( 1, stageStats.iPossibleDancePoints[p] );
@@ -381,7 +381,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_Grades[p].SetXY( GRADE_X(p), GRADE_Y );
m_Grades[p].SetZ( 2 );
m_Grades[p].SetZoom( 1.0f );
m_Grades[p].SetEffectGlowCamelion( 1.0f, GRADES_GLOW_COLOR_1, GRADES_GLOW_COLOR_2 );
m_Grades[p].SetEffectGlowShift( 1.0f, GRADES_GLOW_COLOR_1, GRADES_GLOW_COLOR_2 );
if( SPIN_GRADES )
m_Grades[p].SpinAndSettleOn( grade[p] );
else
@@ -424,7 +424,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
m_sprActualBar[p][r].BeginTweening( 1.0f ); // tween
m_sprActualBar[p][r].SetTweenZoomToWidth( BAR_WIDTH*stageStats.fRadarActual[p][r] );
if( stageStats.fRadarActual[p][r] == stageStats.fRadarPossible[p][r] )
m_sprActualBar[p][r].SetEffectGlowCamelion();
m_sprActualBar[p][r].SetEffectGlowShift();
this->AddChild( &m_sprActualBar[p][r] );
}
break;
@@ -435,7 +435,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
{
m_sprNewRecord[p].Load( THEME->GetPathTo("Graphics","evaluation new record") );
m_sprNewRecord[p].SetXY( NEW_RECORD_X(p), NEW_RECORD_Y );
m_sprNewRecord[p].SetEffectGlowCamelion( 2.5f );
m_sprNewRecord[p].SetEffectGlowShift( 2.5f );
this->AddChild( &m_sprNewRecord[p] );
}
}
@@ -507,7 +507,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
{
m_sprTryExtraStage.Load( THEME->GetPathTo("Graphics",GAMESTATE->IsExtraStage()?"evaluation try extra stage2":"evaluation try extra stage1") );
m_sprTryExtraStage.SetXY( TRY_EXTRA_STAGE_X, TRY_EXTRA_STAGE_Y );
m_sprTryExtraStage.SetEffectGlowCamelion( 2.5f );
m_sprTryExtraStage.SetEffectGlowShift( 2.5f );
this->AddChild( &m_sprTryExtraStage );
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","evaluation extra stage") );
+1 -1
View File
@@ -34,7 +34,7 @@ ScreenLogo::ScreenLogo() : ScreenAttract("ScreenLogo","logo")
m_sprLogo.StopTweening();
m_sprLogo.BeginTweening( 0.5f ); // sleep
m_sprLogo.BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
m_sprLogo.SetEffectGlowCamelion(2.5f, RageColor(1,1,1,0.1f), RageColor(1,1,1,0.3f) );
m_sprLogo.SetEffectGlowShift(2.5f, RageColor(1,1,1,0.1f), RageColor(1,1,1,0.3f) );
m_sprLogo.SetTweenZoom( 1 );
this->AddChild( &m_sprLogo );
+7
View File
@@ -210,6 +210,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type
#include "ScreenPrompt.h"
#include "ScreenTextEntry.h"
#include "ScreenMiniMenu.h"
Screen* ScreenManager::MakeNewScreen( CString sClassName )
{
@@ -351,6 +352,12 @@ void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion,
m_ScreenStack.push_back( new ScreenTextEntry(SM_SendWhenDone, sQuestion, sInitialAnswer, OnOK, OnCanel) );
}
void ScreenManager::MiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel )
{
// add the new state onto the back of the array
m_ScreenStack.push_back( new ScreenMiniMenu(pDef, SM_SendOnOK, SM_SendOnCancel) );
}
void ScreenManager::PopTopScreen( ScreenMessage SM )
{
Screen* pScreenToPop = m_ScreenStack.back(); // top menu
+3
View File
@@ -20,6 +20,8 @@
#include "Quad.h"
struct MiniMenuDefinition;
class ScreenManager
{
public:
@@ -38,6 +40,7 @@ public:
void SetNewScreen( CString sClassName );
void Prompt( ScreenMessage SM_SendWhenDone, CString sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)() = NULL, void(*OnNo)() = NULL );
void TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL );
void MiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None );
void PopTopScreen( ScreenMessage SM );
void SystemMessage( CString sMessage );
+243
View File
@@ -0,0 +1,243 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: ScreenMiniMenu
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenMiniMenu.h"
#include "PrefsManager.h"
#include "ScreenManager.h"
#include "RageSoundManager.h"
#include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "ThemeManager.h"
const float LABEL_X = 200;
const float ANSWER_X = 440;
const float SPACING_Y = 26;
const ScreenMessage SM_GoToOK = (ScreenMessage)(SM_User+1);
const ScreenMessage SM_GoToCancel = (ScreenMessage)(SM_User+2);
int ScreenMiniMenu::s_iLastLine;
int ScreenMiniMenu::s_iLastAnswers[MAX_MINI_MENU_LINES];
ScreenMiniMenu::ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel )
{
m_SMSendOnOK = SM_SendOnOK;
m_SMSendOnCancel = SM_SendOnCancel;
m_Def = *pDef;
ASSERT( m_Def.iNumLines <= MAX_MINI_MENU_LINES );
m_Fade.SetTransitionTime( 0.5f );
m_Fade.SetDiffuse( RageColor(0,0,0,0.7f) );
m_Fade.SetOpened();
m_Fade.CloseWipingRight();
this->AddChild( &m_Fade );
float fHeightOfAll = (m_Def.iNumLines-1)*SPACING_Y;
m_textTitle.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textTitle.SetText( m_Def.szTitle );
m_textTitle.SetXY( CENTER_X, CENTER_Y - fHeightOfAll/2 - 30 );
m_textTitle.SetZoom( 0.8f );
this->AddChild( &m_textTitle );
bool bMarkedFirstEnabledLine = false;
for( int i=0; i<m_Def.iNumLines; i++ )
{
MiniMenuDefinition::MiniMenuLine& line = m_Def.lines[i];
m_iCurAnswers[i] = 0;
float fY = SCALE( i, 0.f, m_Def.iNumLines-1.f, CENTER_Y-fHeightOfAll/2, CENTER_Y+fHeightOfAll/2 );
m_textLabel[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textLabel[i].SetText( line.szLabel );
m_textLabel[i].SetXY( LABEL_X, fY );
m_textLabel[i].SetZoom( 0.5f );
m_textLabel[i].SetHorizAlign( Actor::align_left );
m_textLabel[i].SetDiffuse( line.bEnabled ? RageColor(1,1,1,1) : RageColor(0.5f,0.5f,0.5f,1) );
this->AddChild( &m_textLabel[i] );
m_textAnswer[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textAnswer[i].SetText( line.szOptionsText[0] );
m_textAnswer[i].SetXY( ANSWER_X, fY );
m_textAnswer[i].SetZoom( 0.5f );
m_textAnswer[i].SetHorizAlign( Actor::align_right );
m_textAnswer[i].SetDiffuse( line.bEnabled ? RageColor(1,1,1,1) : RageColor(0.5f,0.5f,0.5f,1) );
this->AddChild( &m_textAnswer[i] );
if( !bMarkedFirstEnabledLine && line.bEnabled )
{
m_iCurLine = i;
AfterLineChanged();
bMarkedFirstEnabledLine = true;
}
m_iCurAnswers[i] = line.iDefaultOption;
}
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu prompt") );
}
void ScreenMiniMenu::Update( float fDeltaTime )
{
Screen::Update( fDeltaTime );
}
void ScreenMiniMenu::DrawPrimitives()
{
Screen::DrawPrimitives();
}
void ScreenMiniMenu::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( m_Fade.IsOpening() )
return;
if( DeviceI.device==DEVICE_KEYBOARD && type==IET_FIRST_PRESS )
{
switch( DeviceI.button )
{
case SDLK_LEFT:
this->MenuLeft( StyleI.player );
return;
case SDLK_RIGHT:
this->MenuRight( StyleI.player );
return;
}
}
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
}
void ScreenMiniMenu::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
case SM_GoToOK:
SCREENMAN->PopTopScreen( m_SMSendOnOK );
break;
case SM_GoToCancel:
SCREENMAN->PopTopScreen( m_SMSendOnCancel );
break;
}
}
void ScreenMiniMenu::MenuUp( PlayerNumber pn )
{
if( GetGoUpSpot() != -1 )
{
BeforeLineChanged();
m_iCurLine = GetGoUpSpot();
AfterLineChanged();
}
}
void ScreenMiniMenu::MenuDown( PlayerNumber pn )
{
if( GetGoDownSpot() != -1 )
{
BeforeLineChanged();
m_iCurLine = GetGoDownSpot();
AfterLineChanged();
}
}
void ScreenMiniMenu::MenuLeft( PlayerNumber pn )
{
if( CanGoLeft() )
{
m_iCurAnswers[m_iCurLine]--;
AfterAnswerChanged();
}
}
void ScreenMiniMenu::MenuRight( PlayerNumber pn )
{
if( CanGoRight() )
{
m_iCurAnswers[m_iCurLine]++;
AfterAnswerChanged();
}
}
void ScreenMiniMenu::MenuStart( PlayerNumber pn )
{
m_Fade.OpenWipingRight( SM_GoToOK );
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") );
s_iLastLine = m_iCurLine;
COPY( s_iLastAnswers, m_iCurAnswers );
}
void ScreenMiniMenu::MenuBack( PlayerNumber pn )
{
m_Fade.OpenWipingRight( SM_GoToCancel );
}
void ScreenMiniMenu::BeforeLineChanged()
{
m_textLabel[m_iCurLine].SetEffectNone();
m_textAnswer[m_iCurLine].SetEffectNone();
m_textLabel[m_iCurLine].SetZoom( 0.5f );
m_textAnswer[m_iCurLine].SetZoom( 0.5f );
}
void ScreenMiniMenu::AfterLineChanged()
{
m_textLabel[m_iCurLine].SetEffectGlowShift( 1.0f, RageColor(0,0.5f,0,1), RageColor(0,1,0,1) );
m_textAnswer[m_iCurLine].SetEffectGlowShift( 1.0f, RageColor(0,0.5f,0,1), RageColor(0,1,0,1) );
m_textLabel[m_iCurLine].SetZoom( 0.7f );
m_textAnswer[m_iCurLine].SetZoom( 0.7f );
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","mini menu row") );
}
void ScreenMiniMenu::AfterAnswerChanged()
{
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","mini menu row") );
int iAnswerInRow = m_iCurAnswers[m_iCurLine];
CString sAnswerText = m_Def.lines[m_iCurLine].szOptionsText[iAnswerInRow];
m_textAnswer[m_iCurLine].SetText( sAnswerText );
}
int ScreenMiniMenu::GetGoUpSpot()
{
for( int i=m_iCurLine-1; i>=0; i-- )
if( m_Def.lines[i].bEnabled )
return i;
return -1;
}
int ScreenMiniMenu::GetGoDownSpot()
{
for( int i=m_iCurLine+1; i<m_Def.iNumLines; i++ )
if( m_Def.lines[i].bEnabled )
return i;
return -1;
}
bool ScreenMiniMenu::CanGoLeft()
{
return m_iCurAnswers[m_iCurLine] != 0;
}
bool ScreenMiniMenu::CanGoRight()
{
int iNumInCurRow = m_Def.lines[m_iCurLine].iNumOptions;
return m_iCurAnswers[m_iCurLine] != iNumInCurRow-1;
}
+80
View File
@@ -0,0 +1,80 @@
/*
-----------------------------------------------------------------------------
Class: ScreenMiniMenu
Desc: Displays a prompt over the top of another screen. Must use by calling
SCREENMAN->AddScreenToTop( new ScreenMiniMenu(...) );
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Screen.h"
#include "BitmapText.h"
#include "TransitionFade.h"
#include "Quad.h"
#include "RandomSample.h"
#define MAX_MINI_MENU_LINES 40
#define MAX_OPTIONS_PER_LINE 20
struct MiniMenuDefinition
{
char szTitle[64];
int iNumLines;
struct MiniMenuLine
{
char szLabel[40];
bool bEnabled;
int iNumOptions;
int iDefaultOption;
char szOptionsText[MAX_OPTIONS_PER_LINE][256];
} lines[MAX_MINI_MENU_LINES];
};
class ScreenMiniMenu : public Screen
{
public:
ScreenMiniMenu();
ScreenMiniMenu( MiniMenuDefinition* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel );
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
void MenuUp( PlayerNumber pn );
void MenuDown( PlayerNumber pn );
void MenuLeft( PlayerNumber pn );
void MenuRight( PlayerNumber pn );
void MenuBack( PlayerNumber pn );
void MenuStart( PlayerNumber pn );
int GetGoUpSpot(); // return -1 if can't go up
int GetGoDownSpot(); // return -1 if can't go down
bool CanGoLeft();
bool CanGoRight();
void BeforeLineChanged();
void AfterLineChanged();
void AfterAnswerChanged();
MiniMenuDefinition m_Def;
TransitionFade m_Fade;
BitmapText m_textTitle;
BitmapText m_textLabel[MAX_MINI_MENU_LINES];
BitmapText m_textAnswer[MAX_MINI_MENU_LINES];
int m_iCurLine;
int m_iCurAnswers[MAX_MINI_MENU_LINES];
ScreenMessage m_SMSendOnOK, m_SMSendOnCancel;
public:
static int s_iLastLine;
static int s_iLastAnswers[MAX_MINI_MENU_LINES];
};
+1 -1
View File
@@ -379,7 +379,7 @@ void ScreenOptions::UpdateEnabledDisabled()
bThisRowIsSelectedByBoth = false;
m_textOptions[i][0].SetDiffuse( bThisRowIsSelectedByBoth ? colorNotSelected : colorSelected );
if( bThisRowIsSelectedByBoth )
m_textOptions[i][0].SetEffectDiffuseCamelion( 1.0f, colorSelected, colorNotSelected );
m_textOptions[i][0].SetEffectDiffuseShift( 1.0f, colorSelected, colorNotSelected );
else
m_textOptions[i][0].SetEffectNone();
}
+2 -2
View File
@@ -75,7 +75,7 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, bool b
m_rectAnswerBox.SetZoomX( m_textAnswer[m_bAnswer].GetWidestLineWidthInSourcePixels()+10.0f );
m_rectAnswerBox.SetZoomY( 30 );
m_textAnswer[m_bAnswer].SetEffectGlowCamelion();
m_textAnswer[m_bAnswer].SetEffectGlowShift();
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu prompt") );
}
@@ -142,7 +142,7 @@ void ScreenPrompt::MenuRight( PlayerNumber pn )
m_textAnswer[m_bAnswer].SetEffectNone();
m_bAnswer = !m_bAnswer;
m_textAnswer[m_bAnswer].SetEffectGlowCamelion();
m_textAnswer[m_bAnswer].SetEffectGlowShift();
m_rectAnswerBox.StopTweening();
m_rectAnswerBox.BeginTweening( 0.2f );
+2 -2
View File
@@ -218,8 +218,8 @@ void ScreenRanking::SetPage( PageToShow pts )
if( bRecentHighScore )
{
m_textNames[l].SetEffectDiffuseBlinking( 10, TEXT_COLOR, RageColor(1,1,1,1) );
m_textScores[l].SetEffectDiffuseBlinking( 10, TEXT_COLOR, RageColor(1,1,1,1) );
m_textNames[l].SetEffectDiffuseBlinking( 0.1f, TEXT_COLOR, RageColor(1,1,1,1) );
m_textScores[l].SetEffectDiffuseBlinking( 0.1f, TEXT_COLOR, RageColor(1,1,1,1) );
}
else
{
+1 -1
View File
@@ -170,7 +170,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
m_sprCursor[p].StopAnimating();
m_sprCursor[p].SetState( p );
m_sprCursor[p].TurnShadowOff();
m_sprCursor[p].SetEffectGlowCamelion();
m_sprCursor[p].SetEffectGlowShift();
m_framePages.AddChild( &m_sprCursor[p] );
m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ok 2x1") );
+2 -2
View File
@@ -152,7 +152,7 @@ ScreenSelectMusic::ScreenSelectMusic()
m_textSongOptions.SetXY( SONG_OPTIONS_X, SONG_OPTIONS_Y );
m_textSongOptions.SetZoom( 0.5f );
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
m_textSongOptions.SetEffectDiffuseCamelion( 2.5f, RageColor(1,0,0,1), RageColor(1,1,1,1) ); // blink red
m_textSongOptions.SetEffectDiffuseShift( 2.5f, RageColor(1,0,0,1), RageColor(1,1,1,1) ); // blink red
m_textSongOptions.SetDiffuse( RageColor(1,1,1,1) ); // white
this->AddChild( &m_textSongOptions );
@@ -777,7 +777,7 @@ void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
m_DifficultyIcon[pn].SetFromNotes( pn, pNotes );
if( pNotes && pNotes->IsAutogen() )
{
m_AutoGenIcon[pn].SetEffectDiffuseCamelion();
m_AutoGenIcon[pn].SetEffectDiffuseShift();
}
else
{
+1 -1
View File
@@ -184,7 +184,7 @@ void ScreenSelectStyle::BeforeChange()
void ScreenSelectStyle::AfterChange()
{
m_sprIcon[m_iSelection]->SetEffectGlowCamelion();
m_sprIcon[m_iSelection]->SetEffectGlowShift();
const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
const StyleDef* pStyleDef = GAMEMAN->GetStyleDefForStyle( m_aPossibleStyles[m_iSelection] );
+1 -1
View File
@@ -357,6 +357,6 @@ void ScreenTitleMenu::GainFocus( int iChoiceIndex )
color1 = COLOR_SELECTED;
color2 = color1 * 0.5f;
color2.a = 1;
m_textChoice[iChoiceIndex].SetEffectDiffuseCamelion( 0.5f, color1, color2 );
m_textChoice[iChoiceIndex].SetEffectDiffuseShift( 0.5f, color1, color2 );
}
+8 -2
View File
@@ -51,8 +51,14 @@ public:
virtual void DrawPrimitives();
virtual void Update( float fDeltaTime );
virtual void StartAnimating() { m_bIsAnimating = true; if(m_pTexture) m_pTexture->Play(); };
virtual void StopAnimating() { m_bIsAnimating = false; if(m_pTexture) m_pTexture->Pause(); };
virtual void EnableAnimation( bool bEnable )
{
m_bIsAnimating = bEnable;
if(m_pTexture)
bEnable ? m_pTexture->Play() : m_pTexture->Pause();
};
virtual void StartAnimating() { EnableAnimation(true); };
virtual void StopAnimating() { EnableAnimation(false); };
virtual void SetState( int iNewState );
int GetNumStates() { return m_iNumStates; };
+6
View File
@@ -321,6 +321,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
<File
RelativePath="ScreenMessage.h">
</File>
<File
RelativePath="ScreenMiniMenu.cpp">
</File>
<File
RelativePath="ScreenMiniMenu.h">
</File>
<File
RelativePath="ScreenMusicScroll.cpp">
</File>
+8 -10
View File
@@ -46,18 +46,16 @@ RageSoundDriver *MakeRageSoundDriver(CString drivers)
Driver = DriversToTry[i];
LOG->Trace("Initializing driver: %s", DriversToTry[i].GetString());
#if defined(WIN32)
#ifdef WIN32
if(!DriversToTry[i].CompareNoCase("DirectSound")) ret = new RageSound_DSound;
else if(!DriversToTry[i].CompareNoCase("DirectSound-sw")) ret = new RageSound_DSound_Software;
else if(!DriversToTry[i].CompareNoCase("WaveOut")) ret = new RageSound_WaveOut;
else if(!DriversToTry[i].CompareNoCase("Linux")) ret = new RageSound_Linux;
#else
#warning No sound drivers defined!
if(1) ret = new RageSound_Null;
if(!DriversToTry[i].CompareNoCase("DirectSound-sw")) ret = new RageSound_DSound_Software;
if(!DriversToTry[i].CompareNoCase("WaveOut")) ret = new RageSound_WaveOut;
#endif
else if(!DriversToTry[i].CompareNoCase("Null")) ret = new RageSound_Null;
else
#ifndef WIN32 // FIXME: change to a define for -nix platforms?
if(!DriversToTry[i].CompareNoCase("Linux")) ret = new RageSound_Linux;
#endif
if(!DriversToTry[i].CompareNoCase("Null")) ret = new RageSound_Null;
if( !ret )
LOG->Warn("Unknown sound driver name: %s", DriversToTry[i].GetString());
}
catch(const RageException &e) {