Actor tween cleanup
Actor scipting with Command() modularizing menu widgets into "ModeSelector"s move animations into metrics
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Possible NextScreen Codes:
|
||||
// Possible NextScreen names:
|
||||
// - ScreenCaution
|
||||
// - ScreenEz2SelectPlayer
|
||||
// - ScreenSelectMode
|
||||
@@ -10,6 +10,9 @@
|
||||
// - ScreenSelectMusic
|
||||
// - ScreenSelectStyle5th
|
||||
// - ScreenSelectStyle
|
||||
// Possible Selector names:
|
||||
// - ModeSelectorMaxType1 (Max's Select Style)
|
||||
// - ModeSelectorMaxType2 (Max's Select Difficulty)
|
||||
|
||||
[Common]
|
||||
ColorP1=0.4,1.0,0.8,1 // sea green
|
||||
@@ -58,18 +61,7 @@ BounceJoinMessage=1
|
||||
FoldOnJoin=1
|
||||
|
||||
[ScreenSelectStyle]
|
||||
JointPremiumBannerX=550
|
||||
JointPremiumBannerY=400
|
||||
IconsStartX=60
|
||||
IconsSpacingX=76
|
||||
IconsStartY=100
|
||||
IconsSpacingY=0
|
||||
ExplanationX=480
|
||||
ExplanationY=170
|
||||
InfoX=480
|
||||
InfoY=280
|
||||
PreviewX=160
|
||||
PreviewY=240
|
||||
Selector=ModeSelectorMaxType1
|
||||
HelpText=Use &LEFT; &RIGHT; to select, then press START
|
||||
TimerSeconds=40
|
||||
NextScreen=ScreenSelectDifficulty
|
||||
@@ -104,39 +96,8 @@ FoldOnJoin=1
|
||||
NextScreen=ScreenSelectGroup
|
||||
|
||||
[ScreenSelectDifficulty]
|
||||
MorePage1X=580
|
||||
MorePage1Y=90
|
||||
MorePage2X=700
|
||||
MorePage2Y=90
|
||||
ExplanationPage1X=170
|
||||
ExplanationPage1Y=70
|
||||
ExplanationPage2X=1100
|
||||
ExplanationPage2Y=70
|
||||
ChoicesOnPage1=Beginner,Easy,Medium,Hard
|
||||
ChoicesOnPage2=Nonstop,Oni,Endless
|
||||
Page1Choice1X=98
|
||||
Page1Choice1Y=180
|
||||
Page1Choice2X=246
|
||||
Page1Choice2Y=220
|
||||
Page1Choice3X=394
|
||||
Page1Choice3Y=180
|
||||
Page1Choice4X=542
|
||||
Page1Choice4Y=220
|
||||
Page1Choice5X=542
|
||||
Page1Choice5Y=220
|
||||
Page2Choice1X=760
|
||||
Page2Choice1Y=200
|
||||
Page2Choice2X=960
|
||||
Page2Choice2Y=200
|
||||
Page2Choice3X=1160
|
||||
Page2Choice3Y=200
|
||||
CursorOffsetP1X=-40
|
||||
CursorOffsetP1Y=200
|
||||
CursorOffsetP2X=+40
|
||||
CursorOffsetP2Y=200
|
||||
CursorShadowLengthX=10
|
||||
CursorShadowLengthY=10
|
||||
InitialChoice=0
|
||||
Choices=Beginner,Easy,Medium,Hard,Nonstop,Oni,Endless
|
||||
Selector=ModeSelectorMaxType2
|
||||
HelpText=Use &LEFT; &RIGHT; to select, then press START
|
||||
TimerSeconds=40
|
||||
NextScreenArcade=ScreenSelectGroup
|
||||
@@ -1022,3 +983,77 @@ TextHorizAlignP1=0
|
||||
TextHorizAlignP2=0
|
||||
TextZoom=0
|
||||
SpacingY=0
|
||||
|
||||
[ModeSelectorMaxType1]
|
||||
JointPremiumBannerX=550
|
||||
JointPremiumBannerY=400
|
||||
IconsStartX=60
|
||||
IconsSpacingX=76
|
||||
IconsStartY=100
|
||||
IconsSpacingY=0
|
||||
IconsDisabledColor=0.2,0.2,0.2,1
|
||||
ExplanationX=480
|
||||
ExplanationY=170
|
||||
InfoX=480
|
||||
InfoY=280
|
||||
PreviewX=160
|
||||
PreviewY=240
|
||||
FadeSeconds=0.5
|
||||
|
||||
[ModeSelectorMaxType2]
|
||||
NumChoicesOnPage1=4
|
||||
LockInputSeconds=0.5
|
||||
SleepAfterChoiceSeconds=0.5
|
||||
SleepAfterTweenOffSeconds=1.3
|
||||
MorePage1OnCommand=diffuse,1,1,1,0;x,580;y,90;linear,0.5;diffuse,1,1,1,1
|
||||
MorePage1OffCommand=linear,0.5;diffuse,1,1,1,0
|
||||
MorePage2OnCommand=x,700;y,90
|
||||
MorePage2OffCommand=linear,0.5;diffuse,1,1,1,0
|
||||
ExplanationPage1OnCommand=x,170;y,70;xoffset,-400;bounceend,0.5;xoffset,400;
|
||||
ExplanationPage1OffCommand=bouncebegin,0.5;xoffset,-400
|
||||
ExplanationPage2OnCommand=x,1100;y,70
|
||||
ExplanationPage2OffCommand=bouncebegin,0.5;xoffset,400
|
||||
HeaderPage1Choice1OnCommand=vertalign,bottom;x,90;y,180;xoffset,-800;sleep,0.0;decelerate,0.4;xoffset,800
|
||||
HeaderPage1Choice1OffCommand=sleep,0.3;accelerate,0.4;xoffset,-800
|
||||
HeaderPage1Choice2OnCommand=vertalign,bottom;x,246;y,220;xoffset,-800;sleep,0.2;decelerate,0.4;xoffset,800
|
||||
HeaderPage1Choice2OffCommand=sleep,0.5;accelerate,0.4;xoffset,-800
|
||||
HeaderPage1Choice3OnCommand=vertalign,bottom;x,394;y,180;xoffset,-800;sleep,0.4;decelerate,0.4;xoffset,800
|
||||
HeaderPage1Choice3OffCommand=sleep,0.7;accelerate,0.4;xoffset,-800
|
||||
HeaderPage1Choice4OnCommand=vertalign,bottom;x,542;y,220;xoffset,-800;sleep,0.6;decelerate,0.4;xoffset,800
|
||||
HeaderPage1Choice4OffCommand=sleep,0.9;accelerate,0.4;xoffset,-800
|
||||
HeaderPage2Choice1OnCommand=vertalign,bottom;x,760;y,200
|
||||
HeaderPage2Choice1OffCommand=sleep,0.3;accelerate,0.4;xoffset,-800
|
||||
HeaderPage2Choice2OnCommand=vertalign,bottom;x,960;y,200
|
||||
HeaderPage2Choice2OffCommand=sleep,0.5;accelerate,0.4;xoffset,-800
|
||||
HeaderPage2Choice3OnCommand=vertalign,bottom;x,1160;y,200
|
||||
HeaderPage2Choice3OffCommand=sleep,0.7;accelerate,0.4;xoffset,-800
|
||||
PicturePage1Choice1OnCommand=vertalign,top;x,90;y,180;zoomy,0.0;sleep,0.4;bounceend,0.3;zoomy,1
|
||||
PicturePage1Choice1OffCommand=sleep,0.0;bouncebegin,0.3;zoomy,0
|
||||
PicturePage1Choice2OnCommand=vertalign,top;x,246;y,220;zoomy,0.0;sleep,0.6;bounceend,0.3;zoomy,1
|
||||
PicturePage1Choice2OffCommand=sleep,0.2;bouncebegin,0.3;zoomy,0
|
||||
PicturePage1Choice3OnCommand=vertalign,top;x,394;y,180;zoomy,0.0;sleep,0.8;bounceend,0.3;zoomy,1
|
||||
PicturePage1Choice3OffCommand=sleep,0.4;bouncebegin,0.3;zoomy,0
|
||||
PicturePage1Choice4OnCommand=vertalign,top;x,542;y,220;zoomy,0.0;sleep,1.0;bounceend,0.3;zoomy,1
|
||||
PicturePage1Choice4OffCommand=sleep,0.6;bouncebegin,0.3;zoomy,0
|
||||
PicturePage2Choice1OnCommand=vertalign,top;x,760;y,200;
|
||||
PicturePage2Choice1OffCommand=sleep,0.0;bouncebegin,0.3;zoomy,0
|
||||
PicturePage2Choice2OnCommand=vertalign,top;x,960;y,200
|
||||
PicturePage2Choice2OffCommand=sleep,0.2;bouncebegin,0.3;zoomy,0
|
||||
PicturePage2Choice3OnCommand=vertalign,top;x,1160;y,200
|
||||
PicturePage2Choice3OffCommand=sleep,0.4;bouncebegin,0.3;zoomy,0
|
||||
CursorOnCommand=diffuse,1,1,1,0;rotationz,6;zoom,4;linear,0.3;diffuse,1,1,1,1;rotationz,0;zoom,1;glowshift
|
||||
CursorChooseCommand=sleep,0.2;linear,0.2;xoffset,10;yoffset,10
|
||||
CursorOffCommand=sleep,0.2;linear,0.3;zoom,0
|
||||
CursorP1OffsetXFromPicture=-40
|
||||
CursorP1OffsetYFromPicture=188
|
||||
CursorP2OffsetXFromPicture=+40
|
||||
CursorP2OffsetYFromPicture=188
|
||||
ShadowOnCommand=diffuse,1,1,1,0;rotationz,6;zoom,4;linear,0.3;diffuse,1,1,1,1;rotationz,0;zoom,1
|
||||
ShadowChooseCommand=sleep,0.2;linear,0.2;diffuse,1,1,1,0
|
||||
ShadowOffCommand=sleep,0.2;linear,0.3;diffuse,1,1,1,0
|
||||
ShadowLengthX=10
|
||||
ShadowLengthY=10
|
||||
OKOnCommand=diffuse,1,1,1,1
|
||||
OKChooseCommand=diffuse,1,1,1,1;zoom,2;linear,0.2;diffuse,1,1,1,1;zoom,1
|
||||
OKOffCommand=sleep,0.2;linear,0.3;zoom,0
|
||||
DisabledColor=0.2,0.2,0.2,1
|
||||
|
||||
+186
-163
@@ -16,6 +16,7 @@
|
||||
#include "PrefsManager.h"
|
||||
#include "RageUtil.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
|
||||
Actor::Actor()
|
||||
@@ -35,16 +36,14 @@ Actor::Actor()
|
||||
m_Effect = no_effect;
|
||||
m_fSecsIntoEffect = 0;
|
||||
m_fEffectPeriodSeconds = 1;
|
||||
m_fWagRadians = 0.2f;
|
||||
m_vSpinVelocity = RageVector3(0,0,0);
|
||||
m_fVibrationDistance = 5.0f;
|
||||
m_bVisibleThisFrame = false;
|
||||
m_vEffectMagnitude = RageVector3(0,0,10);
|
||||
m_effectColor1 = RageColor(1,1,1,1);
|
||||
m_effectColor2 = RageColor(1,1,1,1);
|
||||
|
||||
m_bShadow = false;
|
||||
m_fShadowLength = 4;
|
||||
|
||||
m_bBlendAdd = false;
|
||||
|
||||
}
|
||||
|
||||
void Actor::Draw()
|
||||
@@ -67,9 +66,9 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
//
|
||||
// set temporary drawing properties based on Effects
|
||||
//
|
||||
|
||||
bool bBlinkOn = m_fSecsIntoEffect/m_fEffectPeriodSeconds > 0.5f;
|
||||
float fPercentBetweenColors = sinf( m_fSecsIntoEffect/m_fEffectPeriodSeconds * 2 * PI ) / 2 + 0.5f;
|
||||
float fPercentThroughEffect = m_fSecsIntoEffect / m_fEffectPeriodSeconds;
|
||||
bool bBlinkOn = fPercentThroughEffect > 0.5f;
|
||||
float fPercentBetweenColors = sinf( fPercentThroughEffect * 2 * PI ) / 2 + 0.5f;
|
||||
ASSERT( fPercentBetweenColors >= 0 && fPercentBetweenColors <= 1 );
|
||||
float fOriginalAlpha = m_temp.diffuse[0].a;
|
||||
|
||||
@@ -77,7 +76,7 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
{
|
||||
case no_effect:
|
||||
break;
|
||||
case diffuse_blinking:
|
||||
case diffuse_blink:
|
||||
for(i=0; i<4; i++)
|
||||
m_temp.diffuse[i] = bBlinkOn ? m_effectColor1 : m_effectColor2;
|
||||
break;
|
||||
@@ -85,7 +84,7 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
for(i=0; i<4; i++)
|
||||
m_temp.diffuse[i] = m_effectColor1*fPercentBetweenColors + m_effectColor2*(1.0f-fPercentBetweenColors);
|
||||
break;
|
||||
case glow_blinking:
|
||||
case glow_blink:
|
||||
m_temp.glow = bBlinkOn ? m_effectColor1 : m_effectColor2;
|
||||
m_temp.glow.a *= fOriginalAlpha; // don't glow if the Actor is transparent!
|
||||
break;
|
||||
@@ -93,39 +92,30 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
|
||||
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;
|
||||
case wagging:
|
||||
m_temp.rotation.z = m_fWagRadians * sinf(
|
||||
(m_fSecsIntoEffect / m_fEffectPeriodSeconds) // percent through wag
|
||||
* 2.0f * PI );
|
||||
case wag:
|
||||
m_temp.rotation = m_vEffectMagnitude * sinf( fPercentThroughEffect * 2.0f * PI );
|
||||
break;
|
||||
case spinning:
|
||||
case spin:
|
||||
// nothing needs to be here
|
||||
break;
|
||||
case vibrating:
|
||||
m_temp.pos.x += m_fVibrationDistance * randomf(-1.0f, 1.0f) * GetZoom();
|
||||
m_temp.pos.y += m_fVibrationDistance * randomf(-1.0f, 1.0f) * GetZoom();
|
||||
case vibrate:
|
||||
m_temp.pos.x += m_vEffectMagnitude.x * randomf(-1.0f, 1.0f) * GetZoom();
|
||||
m_temp.pos.y += m_vEffectMagnitude.y * randomf(-1.0f, 1.0f) * GetZoom();
|
||||
m_temp.pos.z += m_vEffectMagnitude.z * randomf(-1.0f, 1.0f) * GetZoom();
|
||||
break;
|
||||
case flickering:
|
||||
m_bVisibleThisFrame = !m_bVisibleThisFrame;
|
||||
if( !m_bVisibleThisFrame )
|
||||
for(int i=0; i<4; i++)
|
||||
m_temp.diffuse[i] = RageColor(0,0,0,0); // don't draw the frame
|
||||
break;
|
||||
case bouncing:
|
||||
case bounce:
|
||||
{
|
||||
float fPercentThroughBounce = m_fSecsIntoEffect / m_fEffectPeriodSeconds;
|
||||
float fPercentOffset = sinf( fPercentThroughBounce*PI );
|
||||
m_temp.pos += m_vectBounce * fPercentOffset;
|
||||
float fPercentOffset = sinf( fPercentThroughEffect*PI );
|
||||
m_temp.pos += m_vEffectMagnitude * fPercentOffset;
|
||||
m_temp.pos.x = roundf( m_temp.pos.x );
|
||||
m_temp.pos.y = roundf( m_temp.pos.y );
|
||||
m_temp.pos.z = roundf( m_temp.pos.z );
|
||||
}
|
||||
break;
|
||||
case bobbing:
|
||||
case bob:
|
||||
{
|
||||
float fPercentThroughBounce = m_fSecsIntoEffect / m_fEffectPeriodSeconds;
|
||||
float fPercentOffset = sinf( fPercentThroughBounce*PI*2 );
|
||||
m_temp.pos += m_vectBounce * fPercentOffset;
|
||||
float fPercentOffset = sinf( fPercentThroughEffect*PI*2 );
|
||||
m_temp.pos += m_vEffectMagnitude * fPercentOffset;
|
||||
m_temp.pos.x = roundf( m_temp.pos.x );
|
||||
m_temp.pos.y = roundf( m_temp.pos.y );
|
||||
m_temp.pos.z = roundf( m_temp.pos.z );
|
||||
@@ -196,20 +186,15 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
switch( TI.m_TweenType )
|
||||
{
|
||||
case TWEEN_LINEAR: fPercentAlongPath = fPercentThroughTween; break;
|
||||
case TWEEN_BIAS_BEGIN: fPercentAlongPath = 1 - (1-fPercentThroughTween) * (1-fPercentThroughTween); break;
|
||||
case TWEEN_BIAS_END: fPercentAlongPath = fPercentThroughTween * fPercentThroughTween; break;
|
||||
case TWEEN_ACCELERATE: fPercentAlongPath = fPercentThroughTween * fPercentThroughTween; break;
|
||||
case TWEEN_DECELERATE: fPercentAlongPath = 1 - (1-fPercentThroughTween) * (1-fPercentThroughTween); break;
|
||||
case TWEEN_BOUNCE_BEGIN:fPercentAlongPath = 1 - sinf( 1.1f + fPercentThroughTween*(PI-1.1f) ) / 0.89f; break;
|
||||
case TWEEN_BOUNCE_END: fPercentAlongPath = sinf( 1.1f + (1-fPercentThroughTween)*(PI-1.1f) ) / 0.89f; break;
|
||||
case TWEEN_SPRING: fPercentAlongPath = 1 - cosf( fPercentThroughTween*PI*2.5f )/(1+fPercentThroughTween*3); break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
|
||||
m_current.pos = m_start.pos + (TS.pos - m_start.pos )*fPercentAlongPath;
|
||||
m_current.scale = m_start.scale + (TS.scale - m_start.scale )*fPercentAlongPath;
|
||||
m_current.rotation = m_start.rotation+ (TS.rotation - m_start.rotation)*fPercentAlongPath;
|
||||
for(int i=0; i<4; i++)
|
||||
m_current.diffuse[i]= m_start.diffuse[i]*(1.0f-fPercentAlongPath) + TS.diffuse[i]*(fPercentAlongPath);
|
||||
m_current.glow = m_start.glow *(1.0f-fPercentAlongPath) + TS.glow *(fPercentAlongPath);
|
||||
TweenState::MakeWeightedAverage( m_current, m_start, TS, fPercentAlongPath );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,26 +212,27 @@ void Actor::Update( float fDeltaTime )
|
||||
{
|
||||
case no_effect:
|
||||
break;
|
||||
case diffuse_blinking:
|
||||
case diffuse_blink:
|
||||
case diffuse_shift:
|
||||
case glow_blinking:
|
||||
case glow_blink:
|
||||
case glow_shift:
|
||||
case wagging:
|
||||
case bouncing:
|
||||
case bobbing:
|
||||
case wag:
|
||||
case bounce:
|
||||
case bob:
|
||||
m_fSecsIntoEffect += fDeltaTime;
|
||||
while( m_fSecsIntoEffect >= m_fEffectPeriodSeconds )
|
||||
m_fSecsIntoEffect -= m_fEffectPeriodSeconds;
|
||||
break;
|
||||
case spinning:
|
||||
m_current.rotation += m_vSpinVelocity;
|
||||
if( m_current.rotation.x > 1000*PI*2 ) m_current.rotation.x -= 1000*PI*2;
|
||||
if( m_current.rotation.y > 1000*PI*2 ) m_current.rotation.y -= 1000*PI*2;
|
||||
if( m_current.rotation.z > 1000*PI*2 ) m_current.rotation.z -= 1000*PI*2;
|
||||
case spin:
|
||||
m_current.rotation += m_vEffectMagnitude;
|
||||
if( m_current.rotation.x > PI*2 ) m_current.rotation.x -= PI*2;
|
||||
if( m_current.rotation.y > PI*2 ) m_current.rotation.y -= PI*2;
|
||||
if( m_current.rotation.z > PI*2 ) m_current.rotation.z -= PI*2;
|
||||
if( m_current.rotation.x < -PI*2 ) m_current.rotation.x += PI*2;
|
||||
if( m_current.rotation.y < -PI*2 ) m_current.rotation.y += PI*2;
|
||||
if( m_current.rotation.z < -PI*2 ) m_current.rotation.z += PI*2;
|
||||
break;
|
||||
case vibrating:
|
||||
break;
|
||||
case flickering:
|
||||
case vibrate:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -292,44 +278,11 @@ void Actor::StopTweening()
|
||||
{
|
||||
m_TweenStates.clear();
|
||||
m_TweenInfo.clear();
|
||||
ASSERT( m_TweenStates.empty() );
|
||||
ASSERT( m_TweenInfo.empty() );
|
||||
}
|
||||
|
||||
|
||||
void Actor::SetTweenX( float x ) { LatestTween().pos.x = x; }
|
||||
void Actor::SetTweenY( float y ) { LatestTween().pos.y = y; }
|
||||
void Actor::SetTweenZ( float z ) { LatestTween().pos.z = z; }
|
||||
void Actor::SetTweenXY( float x, float y ) { LatestTween().pos.x = x; LatestTween().pos.y = y; }
|
||||
void Actor::SetTweenZoom( float zoom ) { LatestTween().scale.x = zoom; LatestTween().scale.y = zoom; }
|
||||
void Actor::SetTweenZoomX( float zoom ) { LatestTween().scale.x = zoom; }
|
||||
void Actor::SetTweenZoomY( float zoom ) { LatestTween().scale.y = zoom; }
|
||||
void Actor::SetTweenZoomToWidth( float zoom ) { SetTweenZoomX( zoom/GetUnzoomedWidth() ); }
|
||||
void Actor::SetTweenZoomToHeight( float zoom ) { SetTweenZoomX( zoom/GetUnzoomedHeight() ); }
|
||||
void Actor::SetTweenRotationX( float r ) { LatestTween().rotation.x = r; }
|
||||
void Actor::SetTweenRotationY( float r ) { LatestTween().rotation.y = r; }
|
||||
void Actor::SetTweenRotationZ( float r ) { LatestTween().rotation.z = r; }
|
||||
void Actor::SetTweenDiffuse( RageColor c ) { for(int i=0; i<4; i++) LatestTween().diffuse[i] = c; };
|
||||
void Actor::SetTweenDiffuseUpperLeft( RageColor c ) { LatestTween().diffuse[0] = c; };
|
||||
void Actor::SetTweenDiffuseUpperRight( RageColor c ) { LatestTween().diffuse[1] = c; };
|
||||
void Actor::SetTweenDiffuseLowerLeft( RageColor c ) { LatestTween().diffuse[2] = c; };
|
||||
void Actor::SetTweenDiffuseLowerRight( RageColor c ) { LatestTween().diffuse[3] = c; };
|
||||
void Actor::SetTweenDiffuseTopEdge( RageColor c ) { LatestTween().diffuse[0] = LatestTween().diffuse[1] = c; };
|
||||
void Actor::SetTweenDiffuseRightEdge( RageColor c ) { LatestTween().diffuse[1] = LatestTween().diffuse[3] = c; };
|
||||
void Actor::SetTweenDiffuseBottomEdge( RageColor c ) { LatestTween().diffuse[2] = LatestTween().diffuse[3] = c; };
|
||||
void Actor::SetTweenDiffuseLeftEdge( RageColor c ) { LatestTween().diffuse[0] = LatestTween().diffuse[2] = c; };
|
||||
void Actor::SetTweenGlow( RageColor c ) { LatestTween().glow = c; };
|
||||
|
||||
Actor::TweenState Actor::GetDestTweenState()
|
||||
{
|
||||
if( m_TweenStates.empty() ) // not tweening
|
||||
return m_current;
|
||||
else
|
||||
return LatestTween();
|
||||
}
|
||||
|
||||
void Actor::SetTweenState( const Actor::TweenState &ts )
|
||||
{
|
||||
LatestTween() = ts;
|
||||
}
|
||||
|
||||
void Actor::ScaleTo( const RectI &rect, StretchType st )
|
||||
{
|
||||
@@ -391,17 +344,11 @@ void Actor::StretchTo( const RectF &r )
|
||||
|
||||
|
||||
|
||||
// effects
|
||||
// effect "macros"
|
||||
|
||||
void Actor::SetEffectNone()
|
||||
void Actor::SetEffectDiffuseBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
{
|
||||
m_Effect = no_effect;
|
||||
//m_color = RageColor( 1.0,1.0,1.0,1.0 );
|
||||
}
|
||||
|
||||
void Actor::SetEffectDiffuseBlinking( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
{
|
||||
m_Effect = diffuse_blinking;
|
||||
m_Effect = diffuse_blink;
|
||||
m_effectColor1 = c1;
|
||||
m_effectColor2 = c2;
|
||||
m_fEffectPeriodSeconds = fEffectPeriodSeconds;
|
||||
@@ -417,9 +364,9 @@ void Actor::SetEffectDiffuseShift( float fEffectPeriodSeconds, RageColor c1, Rag
|
||||
m_fSecsIntoEffect = 0;
|
||||
}
|
||||
|
||||
void Actor::SetEffectGlowBlinking( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
void Actor::SetEffectGlowBlink( float fEffectPeriodSeconds, RageColor c1, RageColor c2 )
|
||||
{
|
||||
m_Effect = glow_blinking;
|
||||
m_Effect = glow_blink;
|
||||
m_effectColor1 = c1;
|
||||
m_effectColor2 = c2;
|
||||
m_fEffectPeriodSeconds = fEffectPeriodSeconds;
|
||||
@@ -435,93 +382,59 @@ void Actor::SetEffectGlowShift( float fEffectPeriodSeconds, RageColor c1, RageCo
|
||||
m_fSecsIntoEffect = 0;
|
||||
}
|
||||
|
||||
void Actor::SetEffectWagging( float fWagRadians, float fWagPeriod )
|
||||
void Actor::SetEffectWag( float fPeriod, RageVector3 vect )
|
||||
{
|
||||
m_Effect = wagging;
|
||||
m_fWagRadians = fWagRadians;
|
||||
m_fEffectPeriodSeconds = fWagPeriod;
|
||||
}
|
||||
|
||||
void Actor::SetEffectSpinning( RageVector3 vectRotationVelocity )
|
||||
{
|
||||
m_Effect = spinning;
|
||||
m_vSpinVelocity = vectRotationVelocity;
|
||||
}
|
||||
|
||||
void Actor::SetEffectVibrating( float fVibrationDistance )
|
||||
{
|
||||
m_Effect = vibrating;
|
||||
m_fVibrationDistance = fVibrationDistance;
|
||||
}
|
||||
|
||||
void Actor::SetEffectFlickering()
|
||||
{
|
||||
m_Effect = flickering;
|
||||
}
|
||||
|
||||
void Actor::SetEffectBouncing( RageVector3 vectBounce, float fPeriod )
|
||||
{
|
||||
m_Effect = bouncing;
|
||||
|
||||
m_vectBounce = vectBounce;
|
||||
m_Effect = wag;
|
||||
m_fEffectPeriodSeconds = fPeriod;
|
||||
m_vEffectMagnitude = vect;
|
||||
m_fSecsIntoEffect = 0;
|
||||
|
||||
}
|
||||
|
||||
void Actor::SetEffectBobbing( RageVector3 vectBob, float fPeriod )
|
||||
void Actor::SetEffectBounce( float fPeriod, RageVector3 vect )
|
||||
{
|
||||
m_Effect = bobbing;
|
||||
|
||||
m_vectBounce = vectBob;
|
||||
m_Effect = bounce;
|
||||
m_fEffectPeriodSeconds = fPeriod;
|
||||
m_vEffectMagnitude = vect;
|
||||
m_fSecsIntoEffect = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void GetFadeFlagsFromString( CString sFadeString,
|
||||
bool& linear, bool& accelerate, bool& bounce, bool& spring,
|
||||
bool& foldx, bool& foldy, bool& fade, bool& zoombig, bool& zoomsmall, bool& spinx, bool& spiny, bool& spinz, bool& ghost,
|
||||
bool& left, bool& right, bool& top, bool& bottom )
|
||||
void Actor::SetEffectBob( float fPeriod, RageVector3 vect )
|
||||
{
|
||||
sFadeString.MakeLower();
|
||||
foldx = -1!=sFadeString.Find("foldx");
|
||||
foldy = -1!=sFadeString.Find("foldy");
|
||||
fade = -1!=sFadeString.Find("fade");
|
||||
zoombig = -1!=sFadeString.Find("zoombig");
|
||||
zoomsmall = -1!=sFadeString.Find("zoomsmall");
|
||||
spinx = -1!=sFadeString.Find("spinx");
|
||||
spiny = -1!=sFadeString.Find("spiny");
|
||||
spinz = -1!=sFadeString.Find("spinz");
|
||||
ghost = -1!=sFadeString.Find("ghost");
|
||||
linear = -1!=sFadeString.Find("linear");
|
||||
accelerate = -1!=sFadeString.Find("accelerate");
|
||||
bounce = -1!=sFadeString.Find("bounce");
|
||||
spring = -1!=sFadeString.Find("spring");
|
||||
left = -1!=sFadeString.Find("left");
|
||||
right = -1!=sFadeString.Find("right");
|
||||
top = -1!=sFadeString.Find("top");
|
||||
bottom = -1!=sFadeString.Find("bottom");
|
||||
m_Effect = bob;
|
||||
m_fEffectPeriodSeconds = fPeriod;
|
||||
m_vEffectMagnitude = vect;
|
||||
m_fSecsIntoEffect = 0;
|
||||
}
|
||||
|
||||
void Actor::SetEffectSpin( RageVector3 vect )
|
||||
{
|
||||
m_Effect = spin;
|
||||
m_vEffectMagnitude = vect;
|
||||
}
|
||||
|
||||
void Actor::SetEffectVibrate( RageVector3 vect )
|
||||
{
|
||||
m_Effect = vibrate;
|
||||
m_vEffectMagnitude = vect;
|
||||
}
|
||||
|
||||
|
||||
void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff )
|
||||
{
|
||||
sFadeString.MakeLower();
|
||||
sFadeString.Replace( ' ', ',' );
|
||||
|
||||
TweenState original = m_current;
|
||||
TweenState mod = m_current;
|
||||
|
||||
CStringArray asBits;
|
||||
split( sFadeString, " ", asBits );
|
||||
split( sFadeString, ",", asBits );
|
||||
|
||||
#define CONTAINS(needle) (find( asBits.begin(), asBits.end(), needle ) != asBits.end())
|
||||
|
||||
TweenType tt;
|
||||
if( CONTAINS("linear") ) tt = TWEEN_LINEAR;
|
||||
else if( CONTAINS("accelerate") ) tt = bFadingOff ? TWEEN_BIAS_END : TWEEN_BIAS_BEGIN;
|
||||
else if( CONTAINS("accelerate") ) tt = bFadingOff ? TWEEN_ACCELERATE : TWEEN_DECELERATE;
|
||||
else if( CONTAINS("bounce") ) tt = bFadingOff ? TWEEN_BOUNCE_BEGIN : TWEEN_BOUNCE_END;
|
||||
else if( CONTAINS("spring") ) tt = TWEEN_SPRING;
|
||||
else tt = TWEEN_LINEAR;
|
||||
@@ -553,14 +466,124 @@ void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds,
|
||||
mod.glow.a *= CONTAINS("glow")?1:0;
|
||||
|
||||
|
||||
|
||||
TweenState& start = bFadingOff ? original : mod;
|
||||
TweenState& end = bFadingOff ? mod : original;
|
||||
|
||||
// apply tweens
|
||||
StopTweening();
|
||||
m_current = bFadingOff ? original : mod;
|
||||
BeginTweening( fSleepSeconds );
|
||||
BeginTweening( fFadeSeconds, tt );
|
||||
LatestTween() = bFadingOff ? mod : original;
|
||||
|
||||
if( CONTAINS("ghost") )
|
||||
{
|
||||
// start with no glow, no alpha
|
||||
start.glow.a = 0;
|
||||
for( int i=0; i<4; i++ )
|
||||
start.diffuse[i].a = 0;
|
||||
|
||||
m_current = start;
|
||||
|
||||
|
||||
TweenState mid;
|
||||
TweenState::MakeWeightedAverage( mid, start, end, 0.5 );
|
||||
|
||||
// tween to full glow, no alpha
|
||||
mid.glow.a = 1;
|
||||
for( i=0; i<4; i++ )
|
||||
mid.diffuse[i].a = 0;
|
||||
BeginTweening( fFadeSeconds/2, tt );
|
||||
LatestTween() = mid;
|
||||
|
||||
// snap to full alpha
|
||||
for( i=0; i<4; i++ )
|
||||
mid.diffuse[i].a = 1;
|
||||
BeginTweening( 0.0001f, tt );
|
||||
LatestTween() = mid;
|
||||
|
||||
// tween to no glow
|
||||
mid.glow.a = 0;
|
||||
BeginTweening( fFadeSeconds/2, tt );
|
||||
LatestTween() = mid;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_current = start;
|
||||
BeginTweening( fSleepSeconds );
|
||||
BeginTweening( fFadeSeconds, tt );
|
||||
LatestTween() = end;
|
||||
}
|
||||
}
|
||||
|
||||
float Actor::TweenTime() const
|
||||
void Actor::Command( CString sCommandString )
|
||||
{
|
||||
// add a snap tween in case the user forgets to use a tween as the first command
|
||||
// BeginTweening( 0.0001f, TWEEN_LINEAR );
|
||||
|
||||
CStringArray asCommands;
|
||||
split( sCommandString, ";", asCommands, true );
|
||||
|
||||
for( unsigned c=0; c<asCommands.size(); c++ )
|
||||
{
|
||||
CStringArray asTokens;
|
||||
split( asCommands[c], ",", asTokens, true );
|
||||
asTokens.resize(5); // make this big so we don't go out of bounds below
|
||||
// if the user doesn't provide enough parameters, tough.
|
||||
|
||||
CString& sName = asTokens[0];
|
||||
sName.MakeLower();
|
||||
|
||||
#define sParam(i) (asTokens[(unsigned)i+1])
|
||||
#define fParam(i) ((float)atof(sParam(i)))
|
||||
#define iParam(i) (atoi(sParam(i)))
|
||||
#define bParam(i) (iParam(i)!=0)
|
||||
|
||||
// Act on command
|
||||
if ( sName=="sleep" ) BeginTweening( fParam(0), TWEEN_LINEAR );
|
||||
else if( sName=="linear" ) BeginTweening( fParam(0), TWEEN_LINEAR );
|
||||
else if( sName=="accelerate" ) BeginTweening( fParam(0), TWEEN_ACCELERATE );
|
||||
else if( sName=="decelerate" ) BeginTweening( fParam(0), TWEEN_DECELERATE );
|
||||
else if( sName=="bouncebegin" ) BeginTweening( fParam(0), TWEEN_BOUNCE_BEGIN );
|
||||
else if( sName=="bounceend" ) BeginTweening( fParam(0), TWEEN_BOUNCE_END );
|
||||
else if( sName=="spring" ) BeginTweening( fParam(0), TWEEN_SPRING );
|
||||
else if( sName=="stoptweening" ) { StopTweening(); BeginTweening( 0.0001f, TWEEN_LINEAR ); }
|
||||
else if( sName=="x" ) SetX( fParam(0) );
|
||||
else if( sName=="y" ) SetY( fParam(0) );
|
||||
else if( sName=="xoffset" ) SetX( GetX()+fParam(0) );
|
||||
else if( sName=="yoffset" ) SetY( GetY()+fParam(0) );
|
||||
else if( sName=="zoom" ) SetZoom( fParam(0) );
|
||||
else if( sName=="zoomx" ) SetZoomY( fParam(0) );
|
||||
else if( sName=="zoomy" ) SetZoomY( fParam(0) );
|
||||
else if( sName=="diffuse" ) SetDiffuse( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) );
|
||||
else if( sName=="glow" ) SetGlow( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) );
|
||||
else if( sName=="rotationx" ) SetRotationX( fParam(0) );
|
||||
else if( sName=="rotationy" ) SetRotationY( fParam(0) );
|
||||
else if( sName=="rotationz" ) SetRotationZ( fParam(0) );
|
||||
else if( sName=="shadowlength" ) SetShadowLength( fParam(0) );
|
||||
else if( sName=="horizalign" ) SetHorizAlign( sParam(0) );
|
||||
else if( sName=="vertalign" ) SetVertAlign( sParam(0) );
|
||||
else if( sName=="diffuseblink" ) SetEffectDiffuseBlink();
|
||||
else if( sName=="diffuseshift" ) SetEffectDiffuseShift();
|
||||
else if( sName=="glowblink" ) SetEffectGlowBlink();
|
||||
else if( sName=="glowshift" ) SetEffectGlowShift();
|
||||
else if( sName=="wag" ) SetEffectWag();
|
||||
else if( sName=="bounce" ) SetEffectBounce();
|
||||
else if( sName=="bob" ) SetEffectBob();
|
||||
else if( sName=="spin" ) SetEffectSpin();
|
||||
else if( sName=="vibrate" ) SetEffectVibrate();
|
||||
else if( sName=="stopeffect" ) SetEffectNone();
|
||||
else if( sName=="effectcolor1" ) SetEffectColor1( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) );
|
||||
else if( sName=="effectcolor2" ) SetEffectColor2( RageColor(fParam(0),fParam(1),fParam(2),fParam(3)) );
|
||||
else if( sName=="effectperiod" ) SetEffectPeriod( fParam(0) );
|
||||
else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fParam(0),fParam(1),fParam(2)) );
|
||||
else if( sName=="additiveblend" ) EnableAdditiveBlend( iParam(0)!=0 );
|
||||
else
|
||||
{
|
||||
LOG->Warn( "Unrecognized command name '%s' in command string '%s'.", sName.GetString(), sCommandString.GetString() );
|
||||
ASSERT(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float Actor::GetTweenTimeLeft() const
|
||||
{
|
||||
float tot = 0;
|
||||
|
||||
|
||||
+219
-190
@@ -22,180 +22,19 @@ public:
|
||||
|
||||
enum TweenType {
|
||||
TWEEN_LINEAR,
|
||||
TWEEN_BIAS_BEGIN,
|
||||
TWEEN_BIAS_END,
|
||||
TWEEN_ACCELERATE,
|
||||
TWEEN_DECELERATE,
|
||||
TWEEN_BOUNCE_BEGIN,
|
||||
TWEEN_BOUNCE_END,
|
||||
TWEEN_SPRING,
|
||||
};
|
||||
enum Effect { no_effect,
|
||||
diffuse_blinking, diffuse_shift,
|
||||
glow_blinking, glow_shift,
|
||||
wagging, spinning,
|
||||
vibrating, flickering,
|
||||
bouncing, bobbing
|
||||
diffuse_blink, diffuse_shift,
|
||||
glow_blink, glow_shift,
|
||||
wag, bounce, bob,
|
||||
spin, vibrate,
|
||||
};
|
||||
|
||||
|
||||
// let subclasses override
|
||||
|
||||
/* Do subclasses really need to override tweening? Tween data should
|
||||
* probably be private ... - glenn */
|
||||
virtual void Restore() {};
|
||||
virtual void Invalidate() {};
|
||||
|
||||
virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
|
||||
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
||||
virtual void DrawPrimitives() = 0; // override with Actor specific action
|
||||
virtual void EndDraw(); // pops transform from world matrix stack
|
||||
bool IsFirstUpdate();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void UpdateTweening( float fDeltaTime );
|
||||
|
||||
virtual float GetX() { return m_current.pos.x; };
|
||||
virtual float GetY() { return m_current.pos.y; };
|
||||
virtual float GetZ() { return m_current.pos.z; };
|
||||
virtual void SetX( float x ) { m_current.pos.x = x; };
|
||||
virtual void SetY( float y ) { m_current.pos.y = y; };
|
||||
virtual void SetZ( float z ) { m_current.pos.z = z; };
|
||||
virtual void SetXY( float x, float y ) { m_current.pos.x = x; m_current.pos.y = y; };
|
||||
|
||||
// height and width vary depending on zoom
|
||||
virtual float GetUnzoomedWidth() { return m_size.x; }
|
||||
virtual float GetUnzoomedHeight() { return m_size.y; }
|
||||
virtual float GetZoomedWidth() { return m_size.x * m_current.scale.x; }
|
||||
virtual float GetZoomedHeight() { return m_size.y * m_current.scale.y; }
|
||||
// virtual void SetWidth( float width ) { m_current.size.x = width; }
|
||||
// virtual void SetHeight( float height ) { m_current.size.y = height; }
|
||||
|
||||
virtual float GetZoom() { return m_current.scale.x; } // not accurate in some cases
|
||||
virtual float GetZoomX() { return m_current.scale.x; }
|
||||
virtual float GetZoomY() { return m_current.scale.y; }
|
||||
virtual void SetZoom( float zoom ) { m_current.scale.x = zoom; m_current.scale.y = zoom; }
|
||||
virtual void SetZoomX( float zoom ) { m_current.scale.x = zoom; }
|
||||
virtual void SetZoomY( float zoom ) { m_current.scale.y = zoom; }
|
||||
virtual void ZoomToWidth( float zoom ) { SetZoomX( zoom / GetUnzoomedWidth() ); }
|
||||
virtual void ZoomToHeight( float zoom ){ SetZoomY( zoom / GetUnzoomedHeight() ); }
|
||||
|
||||
virtual float GetRotation() { return m_current.rotation.z; }
|
||||
virtual float GetRotationX() { return m_current.rotation.x; }
|
||||
virtual float GetRotationY() { return m_current.rotation.y; }
|
||||
virtual float GetRotationZ() { return m_current.rotation.z; }
|
||||
virtual void SetRotation( float rot ) { m_current.rotation.z = rot; }
|
||||
virtual void SetRotationX( float rot ) { m_current.rotation.x = rot; }
|
||||
virtual void SetRotationY( float rot ) { m_current.rotation.y = rot; }
|
||||
virtual void SetRotationZ( float rot ) { m_current.rotation.z = rot; }
|
||||
|
||||
virtual void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) m_current.diffuse[i] = c; };
|
||||
virtual void SetDiffuses( int i, RageColor c ) { m_current.diffuse[i] = c; };
|
||||
virtual void SetDiffuseUpperLeft( RageColor c ) { m_current.diffuse[0] = c; };
|
||||
virtual void SetDiffuseUpperRight( RageColor c ) { m_current.diffuse[1] = c; };
|
||||
virtual void SetDiffuseLowerLeft( RageColor c ) { m_current.diffuse[2] = c; };
|
||||
virtual void SetDiffuseLowerRight( RageColor c ) { m_current.diffuse[3] = c; };
|
||||
virtual void SetDiffuseTopEdge( RageColor c ) { m_current.diffuse[0] = m_current.diffuse[1] = c; };
|
||||
virtual void SetDiffuseRightEdge( RageColor c ) { m_current.diffuse[1] = m_current.diffuse[3] = c; };
|
||||
virtual void SetDiffuseBottomEdge( RageColor c ) { m_current.diffuse[2] = m_current.diffuse[3] = c; };
|
||||
virtual void SetDiffuseLeftEdge( RageColor c ) { m_current.diffuse[0] = m_current.diffuse[2] = c; };
|
||||
virtual RageColor GetDiffuse() { return m_current.diffuse[0]; };
|
||||
virtual RageColor GetDiffuses( int i ) { return m_current.diffuse[i]; };
|
||||
virtual void SetGlow( RageColor c ) { m_current.glow = c; };
|
||||
virtual RageColor GetGlow() { return m_current.glow; };
|
||||
|
||||
|
||||
|
||||
virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
||||
virtual void StopTweening();
|
||||
/* Amount of time until all tweens have stopped: */
|
||||
virtual float TweenTime() const;
|
||||
virtual void SetTweenX( float x );
|
||||
virtual void SetTweenY( float y );
|
||||
virtual void SetTweenZ( float z );
|
||||
virtual void SetTweenXY( float x, float y );
|
||||
virtual void SetTweenZoom( float zoom );
|
||||
virtual void SetTweenZoomX( float zoom );
|
||||
virtual void SetTweenZoomY( float zoom );
|
||||
virtual void SetTweenZoomToWidth( float zoom );
|
||||
virtual void SetTweenZoomToHeight( float zoom );
|
||||
virtual void SetTweenRotationX( float r );
|
||||
virtual void SetTweenRotationY( float r );
|
||||
virtual void SetTweenRotationZ( float r );
|
||||
virtual void SetTweenDiffuse( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseUpperLeft( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseUpperRight( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseLowerLeft( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseLowerRight( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseTopEdge( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseRightEdge( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseBottomEdge( RageColor colorDiffuse );
|
||||
virtual void SetTweenDiffuseLeftEdge( RageColor colorDiffuse );
|
||||
virtual void SetTweenGlow( RageColor c );
|
||||
|
||||
enum StretchType { fit_inside, cover };
|
||||
|
||||
void ScaleToCover( const RectI &rect ) { ScaleTo( rect, cover ); }
|
||||
void ScaleToFitInside( const RectI &rect ) { ScaleTo( rect, fit_inside); };
|
||||
void ScaleTo( const RectI &rect, StretchType st );
|
||||
|
||||
void StretchTo( const RectI &rect );
|
||||
void StretchTo( const RectF &rect );
|
||||
|
||||
|
||||
|
||||
|
||||
enum HorizAlign { align_left, align_center, align_right };
|
||||
virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; }
|
||||
|
||||
enum VertAlign { align_top, align_middle, align_bottom };
|
||||
virtual void SetVertAlign( VertAlign va ) { m_VertAlign = va; }
|
||||
|
||||
|
||||
|
||||
// effects
|
||||
void SetEffectNone();
|
||||
void SetEffectDiffuseBlinking( float fEffectPeriodSeconds = 1.0f,
|
||||
RageColor c1 = RageColor(0.5f,0.5f,0.5f,1),
|
||||
RageColor c2 = RageColor(1,1,1,1) );
|
||||
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 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,
|
||||
float fWagPeriod = 2.0 );
|
||||
void SetEffectSpinning( RageVector3 vectRotationVelocity );
|
||||
void SetEffectVibrating( float fVibrationDistance = 5.0 );
|
||||
void SetEffectFlickering();
|
||||
void SetEffectBouncing( RageVector3 vectBounceDir, float fPeriod );
|
||||
void SetEffectBobbing( RageVector3 vectBobDir, float fPeriod );
|
||||
Effect GetEffect() { return m_Effect; };
|
||||
|
||||
|
||||
//
|
||||
// other properties
|
||||
//
|
||||
void TurnShadowOn() { m_bShadow = true; };
|
||||
void TurnShadowOff() { m_bShadow = false; };
|
||||
void SetShadowLength( float fLength ) { m_fShadowLength = fLength; };
|
||||
|
||||
void SetBlendModeAdd() { m_bBlendAdd = true; };
|
||||
void SetBlendModeNormal() { m_bBlendAdd = false; };
|
||||
|
||||
|
||||
//
|
||||
// fade command
|
||||
//
|
||||
void Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff );
|
||||
void FadeOn( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,false); };
|
||||
void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); };
|
||||
|
||||
|
||||
//
|
||||
// Stuff for tweening
|
||||
//
|
||||
struct TweenState
|
||||
{
|
||||
// start and end position for tweening
|
||||
@@ -214,14 +53,220 @@ public:
|
||||
diffuse[i] = RageColor( 1, 1, 1, 1 );
|
||||
glow = RageColor( 1, 1, 1, 0 );
|
||||
};
|
||||
|
||||
static void MakeWeightedAverage( TweenState& average_out, const TweenState& ts1, const TweenState& ts2, float fPercentBetween )
|
||||
{
|
||||
average_out.pos = ts1.pos + (ts2.pos - ts1.pos )*fPercentBetween;
|
||||
average_out.scale = ts1.scale + (ts2.scale - ts1.scale )*fPercentBetween;
|
||||
average_out.rotation = ts1.rotation+ (ts2.rotation - ts1.rotation)*fPercentBetween;
|
||||
for(int i=0; i<4; i++)
|
||||
average_out.diffuse[i] = ts1.diffuse[i]+ (ts2.diffuse[i] - ts1.diffuse[i])*fPercentBetween;
|
||||
average_out.glow = ts1.glow + (ts2.glow - ts1.glow )*fPercentBetween;
|
||||
}
|
||||
};
|
||||
|
||||
/* Intended for a very limited use: you can query the destination
|
||||
* state (that is, where the actor would end up if its tween finished),
|
||||
* stop tweening (possibly leaving it partially tweened), do something,
|
||||
* then tween to the original destination. */
|
||||
virtual TweenState GetDestTweenState();
|
||||
virtual void SetTweenState( const TweenState &ts );
|
||||
// let subclasses override
|
||||
|
||||
/* Do subclasses really need to override tweening? Tween data should
|
||||
* probably be private ... - glenn */
|
||||
virtual void Restore() {};
|
||||
virtual void Invalidate() {};
|
||||
|
||||
virtual void Draw(); // calls, BeginDraw, DrawPrimitives, EndDraw
|
||||
virtual void BeginDraw(); // pushes transform onto world matrix stack
|
||||
virtual void DrawPrimitives() = 0; // override with Actor specific action
|
||||
virtual void EndDraw(); // pops transform from world matrix stack
|
||||
bool IsFirstUpdate();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual void UpdateTweening( float fDeltaTime );
|
||||
|
||||
virtual float GetX() { return DestTweenState().pos.x; };
|
||||
virtual float GetY() { return DestTweenState().pos.y; };
|
||||
virtual float GetZ() { return DestTweenState().pos.z; };
|
||||
virtual void SetX( float x ) { DestTweenState().pos.x = x; };
|
||||
virtual void SetY( float y ) { DestTweenState().pos.y = y; };
|
||||
virtual void SetZ( float z ) { DestTweenState().pos.z = z; };
|
||||
virtual void SetXY( float x, float y ) { DestTweenState().pos.x = x; DestTweenState().pos.y = y; };
|
||||
|
||||
// height and width vary depending on zoom
|
||||
virtual float GetUnzoomedWidth() { return m_size.x; }
|
||||
virtual float GetUnzoomedHeight() { return m_size.y; }
|
||||
virtual float GetZoomedWidth() { return m_size.x * DestTweenState().scale.x; }
|
||||
virtual float GetZoomedHeight() { return m_size.y * DestTweenState().scale.y; }
|
||||
// virtual void SetWidth( float width ) { DestTweenState().size.x = width; }
|
||||
// virtual void SetHeight( float height ) { DestTweenState().size.y = height; }
|
||||
|
||||
virtual float GetZoom() { return DestTweenState().scale.x; } // not accurate in some cases
|
||||
virtual float GetZoomX() { return DestTweenState().scale.x; }
|
||||
virtual float GetZoomY() { return DestTweenState().scale.y; }
|
||||
virtual void SetZoom( float zoom ) { DestTweenState().scale.x = zoom; DestTweenState().scale.y = zoom; }
|
||||
virtual void SetZoomX( float zoom ) { DestTweenState().scale.x = zoom; }
|
||||
virtual void SetZoomY( float zoom ) { DestTweenState().scale.y = zoom; }
|
||||
virtual void ZoomToWidth( float zoom ) { SetZoomX( zoom / GetUnzoomedWidth() ); }
|
||||
virtual void ZoomToHeight( float zoom ){ SetZoomY( zoom / GetUnzoomedHeight() ); }
|
||||
|
||||
virtual float GetRotationX() { return DestTweenState().rotation.x; }
|
||||
virtual float GetRotationY() { return DestTweenState().rotation.y; }
|
||||
virtual float GetRotationZ() { return DestTweenState().rotation.z; }
|
||||
virtual void SetRotationX( float rot ) { DestTweenState().rotation.x = rot; }
|
||||
virtual void SetRotationY( float rot ) { DestTweenState().rotation.y = rot; }
|
||||
virtual void SetRotationZ( float rot ) { DestTweenState().rotation.z = rot; }
|
||||
|
||||
virtual void SetDiffuse( RageColor c ) { for(int i=0; i<4; i++) DestTweenState().diffuse[i] = c; };
|
||||
virtual void SetDiffuses( int i, RageColor c ) { DestTweenState().diffuse[i] = c; };
|
||||
virtual void SetDiffuseUpperLeft( RageColor c ) { DestTweenState().diffuse[0] = c; };
|
||||
virtual void SetDiffuseUpperRight( RageColor c ) { DestTweenState().diffuse[1] = c; };
|
||||
virtual void SetDiffuseLowerLeft( RageColor c ) { DestTweenState().diffuse[2] = c; };
|
||||
virtual void SetDiffuseLowerRight( RageColor c ) { DestTweenState().diffuse[3] = c; };
|
||||
virtual void SetDiffuseTopEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[1] = c; };
|
||||
virtual void SetDiffuseRightEdge( RageColor c ) { DestTweenState().diffuse[1] = DestTweenState().diffuse[3] = c; };
|
||||
virtual void SetDiffuseBottomEdge( RageColor c ) { DestTweenState().diffuse[2] = DestTweenState().diffuse[3] = c; };
|
||||
virtual void SetDiffuseLeftEdge( RageColor c ) { DestTweenState().diffuse[0] = DestTweenState().diffuse[2] = c; };
|
||||
virtual RageColor GetDiffuse() { return DestTweenState().diffuse[0]; };
|
||||
virtual RageColor GetDiffuses( int i ) { return DestTweenState().diffuse[i]; };
|
||||
virtual void SetGlow( RageColor c ) { DestTweenState().glow = c; };
|
||||
virtual RageColor GetGlow() { return DestTweenState().glow; };
|
||||
|
||||
|
||||
// TODO: Get rid of these once we're sure everything is working
|
||||
virtual void SetTweenX( float x ) { SetX(x); }
|
||||
virtual void SetTweenY( float y ) { SetY(y); }
|
||||
virtual void SetTweenZ( float z ) { SetZ(z); }
|
||||
virtual void SetTweenXY( float x, float y ) { SetXY(x,y); }
|
||||
virtual void SetTweenZoom( float zoom ) { SetZoom(zoom); }
|
||||
virtual void SetTweenZoomX( float zoom ) { SetZoomX(zoom); }
|
||||
virtual void SetTweenZoomY( float zoom ) { SetZoomY(zoom); }
|
||||
virtual void SetTweenZoomToWidth( float zoom ) { ZoomToWidth(zoom); }
|
||||
virtual void SetTweenZoomToHeight( float zoom ) { ZoomToHeight(zoom); }
|
||||
virtual void SetTweenRotationX( float r ) { SetRotationX(r); }
|
||||
virtual void SetTweenRotationY( float r ) { SetRotationY(r); }
|
||||
virtual void SetTweenRotationZ( float r ) { SetRotationZ(r); }
|
||||
virtual void SetTweenDiffuse( RageColor c ) { SetDiffuse(c); }
|
||||
virtual void SetTweenDiffuseUpperLeft( RageColor c ) { SetDiffuseUpperLeft(c); }
|
||||
virtual void SetTweenDiffuseUpperRight( RageColor c ) { SetDiffuseUpperRight(c); }
|
||||
virtual void SetTweenDiffuseLowerLeft( RageColor c ) { SetDiffuseLowerLeft(c); }
|
||||
virtual void SetTweenDiffuseLowerRight( RageColor c ) { SetDiffuseLowerRight(c); }
|
||||
virtual void SetTweenDiffuseTopEdge( RageColor c ) { SetDiffuseTopEdge(c); }
|
||||
virtual void SetTweenDiffuseRightEdge( RageColor c ) { SetDiffuseRightEdge(c); }
|
||||
virtual void SetTweenDiffuseBottomEdge( RageColor c ) { SetDiffuseBottomEdge(c); }
|
||||
virtual void SetTweenDiffuseLeftEdge( RageColor c ) { SetDiffuseLeftEdge(c); }
|
||||
virtual void SetTweenGlow( RageColor c ) { SetGlow(c); }
|
||||
|
||||
|
||||
virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
|
||||
virtual void StopTweening();
|
||||
virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped
|
||||
virtual TweenState& DestTweenState() // where Actor will end when its tween finish
|
||||
{
|
||||
if( m_TweenStates.empty() ) // not tweening
|
||||
return m_current;
|
||||
else
|
||||
return LatestTween();
|
||||
}
|
||||
virtual void SetLatestTween( TweenState ts ) { LatestTween() = ts; }
|
||||
|
||||
|
||||
enum StretchType { fit_inside, cover };
|
||||
|
||||
void ScaleToCover( const RectI &rect ) { ScaleTo( rect, cover ); }
|
||||
void ScaleToFitInside( const RectI &rect ) { ScaleTo( rect, fit_inside); };
|
||||
void ScaleTo( const RectI &rect, StretchType st );
|
||||
|
||||
void StretchTo( const RectI &rect );
|
||||
void StretchTo( const RectF &rect );
|
||||
|
||||
|
||||
|
||||
|
||||
enum HorizAlign { align_left, align_center, align_right };
|
||||
virtual void SetHorizAlign( HorizAlign ha ) { m_HorizAlign = ha; }
|
||||
virtual void SetHorizAlign( CString s )
|
||||
{
|
||||
s.MakeLower();
|
||||
if (s=="left") m_HorizAlign = align_left;
|
||||
else if(s=="center") m_HorizAlign = align_center;
|
||||
else if(s=="right") m_HorizAlign = align_right;
|
||||
else ASSERT(0);
|
||||
}
|
||||
|
||||
enum VertAlign { align_top, align_middle, align_bottom };
|
||||
virtual void SetVertAlign( VertAlign va ) { m_VertAlign = va; }
|
||||
virtual void SetVertAlign( CString s )
|
||||
{
|
||||
s.MakeLower();
|
||||
if (s=="top") m_VertAlign = align_top;
|
||||
else if(s=="middle") m_VertAlign = align_middle;
|
||||
else if(s=="bottom") m_VertAlign = align_bottom;
|
||||
else ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// effects
|
||||
void SetEffectNone() { m_Effect = no_effect; }
|
||||
Effect GetEffect() { return m_Effect; }
|
||||
void SetEffectColor1( RageColor c ) { m_effectColor1 = c; }
|
||||
void SetEffectColor2( RageColor c ) { m_effectColor2 = c; }
|
||||
void SetEffectPeriod( float fSecs ) { m_fEffectPeriodSeconds = fSecs; }
|
||||
void SetEffectMagnitude( RageVector3 vec ) { m_vEffectMagnitude = vec; }
|
||||
|
||||
void SetEffectDiffuseBlink(
|
||||
float fEffectPeriodSeconds = 1.0f,
|
||||
RageColor c1 = RageColor(0.5f,0.5f,0.5f,1),
|
||||
RageColor c2 = RageColor(1,1,1,1) );
|
||||
void SetEffectDiffuseShift( float fEffectPeriodSeconds = 1.f,
|
||||
RageColor c1 = RageColor(0,0,0,1),
|
||||
RageColor c2 = RageColor(1,1,1,1) );
|
||||
void SetEffectGlowBlink( float fEffectPeriodSeconds = 1.f,
|
||||
RageColor c1 = RageColor(1,1,1,0.2f),
|
||||
RageColor c2 = RageColor(1,1,1,0.8f) );
|
||||
void SetEffectGlowShift(
|
||||
float fEffectPeriodSeconds = 1.0f,
|
||||
RageColor c1 = RageColor(1,1,1,0.2f),
|
||||
RageColor c2 = RageColor(1,1,1,0.8f) );
|
||||
void SetEffectWag(
|
||||
float fPeriod = 2.f,
|
||||
RageVector3 vect = RageVector3(0,0,0.2f) );
|
||||
void SetEffectBounce(
|
||||
float fPeriod = 2.f,
|
||||
RageVector3 vect = RageVector3(0,0,20) );
|
||||
void SetEffectBob(
|
||||
float fPeriod = 2.f,
|
||||
RageVector3 vect = RageVector3(0,0,20) );
|
||||
void SetEffectSpin(
|
||||
RageVector3 vect = RageVector3(0,0,1) );
|
||||
void SetEffectVibrate(
|
||||
RageVector3 vect = RageVector3(10,10,10) );
|
||||
|
||||
|
||||
//
|
||||
// other properties
|
||||
//
|
||||
void SetShadowLength( float fLength )
|
||||
{
|
||||
if( fLength==0 )
|
||||
m_bShadow = false;
|
||||
else
|
||||
{
|
||||
m_fShadowLength = fLength;
|
||||
m_bShadow = true;
|
||||
}
|
||||
}
|
||||
void EnableShadow( bool b ) { m_bShadow = b; };
|
||||
|
||||
|
||||
void EnableAdditiveBlend( bool b ) { m_bBlendAdd = b; };
|
||||
|
||||
|
||||
//
|
||||
// fade command
|
||||
//
|
||||
void Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, bool bFadingOff );
|
||||
void FadeOn( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,false); };
|
||||
void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); };
|
||||
|
||||
void Command( CString sCommandString );
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -275,25 +320,9 @@ protected:
|
||||
Effect m_Effect;
|
||||
float m_fSecsIntoEffect;
|
||||
float m_fEffectPeriodSeconds;
|
||||
|
||||
// Counting variables for shift and glowing:
|
||||
RageColor m_effectColor1;
|
||||
RageColor m_effectColor2;
|
||||
|
||||
// wagging:
|
||||
float m_fWagRadians;
|
||||
|
||||
// spinning:
|
||||
RageVector3 m_vSpinVelocity; // delta per second
|
||||
|
||||
// vibrating:
|
||||
float m_fVibrationDistance;
|
||||
|
||||
// flickering:
|
||||
bool m_bVisibleThisFrame;
|
||||
|
||||
// bouncing:
|
||||
RageVector3 m_vectBounce;
|
||||
RageVector3 m_vEffectMagnitude;
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -77,12 +77,12 @@ void ActorFrame::SetDiffuse( RageColor c )
|
||||
m_SubActors[i]->SetDiffuse(c );
|
||||
}
|
||||
|
||||
float ActorFrame::TweenTime() const
|
||||
float ActorFrame::GetTweenTimeLeft() const
|
||||
{
|
||||
float m = Actor::TweenTime();
|
||||
float m = Actor::GetTweenTimeLeft();
|
||||
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m = max(m, m_SubActors[i]->TweenTime());
|
||||
m = max(m, m_SubActors[i]->GetTweenTimeLeft());
|
||||
|
||||
return m;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
virtual void SetDiffuse( RageColor c );
|
||||
|
||||
/* Amount of time until all tweens (and all children's tweens) have stopped: */
|
||||
virtual float TweenTime() const;
|
||||
virtual float GetTweenTimeLeft() const;
|
||||
|
||||
protected:
|
||||
vector<Actor*> m_SubActors;
|
||||
|
||||
@@ -101,7 +101,7 @@ void BGAnimationLayer::LoadFromVisualization( CString sMoviePath )
|
||||
m_iNumSprites = 1;
|
||||
m_Sprites[0].LoadBG( sMoviePath );
|
||||
m_Sprites[0].StretchTo( RectI(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
|
||||
m_Sprites[0].SetBlendModeAdd();
|
||||
m_Sprites[0].EnableAdditiveBlend( true );
|
||||
}
|
||||
|
||||
void BGAnimationLayer::LoadFromAniLayerFile( CString sPath, CString sSongBGPath )
|
||||
@@ -231,7 +231,7 @@ found_effect:
|
||||
{
|
||||
m_Sprites[i].LoadBG( sPath );
|
||||
m_Sprites[i].SetZoom( randomf(0.2f,2) );
|
||||
m_Sprites[i].SetRotation( randomf(0,PI*2) );
|
||||
m_Sprites[i].SetRotationZ( randomf(0,PI*2) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -317,7 +317,7 @@ found_effect:
|
||||
|
||||
if( sPath.Find("add") != -1 )
|
||||
for( int i=0; i<m_iNumSprites; i++ )
|
||||
m_Sprites[i].SetBlendModeAdd();
|
||||
m_Sprites[i].EnableAdditiveBlend( true );
|
||||
|
||||
CString sDir, sFName, sExt;
|
||||
splitrelpath( sPath, sDir, sFName, sExt );
|
||||
@@ -360,7 +360,7 @@ found_effect:
|
||||
}
|
||||
if(m_Rot != 0)
|
||||
{
|
||||
m_Sprites[0].SetRotation(m_Rot);
|
||||
m_Sprites[0].SetRotationZ(m_Rot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
|
||||
break;
|
||||
case EFFECT_STRETCH_SPIN:
|
||||
m_Sprites[0].SetRotation( m_Sprites[0].GetRotation() + fDeltaTime*m_fRotationalVelocity );
|
||||
m_Sprites[0].SetRotationZ( m_Sprites[0].GetRotationZ() + fDeltaTime*m_fRotationalVelocity );
|
||||
case EFFECT_STRETCH_WATER:
|
||||
case EFFECT_STRETCH_BUBBLE:
|
||||
case EFFECT_STRETCH_TWIST:
|
||||
@@ -437,13 +437,13 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
if( m_Sprites[i].GetZoom() > SPIRAL_MAX_ZOOM )
|
||||
m_Sprites[i].SetZoom( SPIRAL_MIN_ZOOM );
|
||||
|
||||
m_Sprites[i].SetRotation( m_Sprites[i].GetRotation() + fDeltaTime );
|
||||
m_Sprites[i].SetRotationZ( m_Sprites[i].GetRotationZ() + fDeltaTime );
|
||||
|
||||
float fRadius = (m_Sprites[i].GetZoom()-SPIRAL_MIN_ZOOM);
|
||||
fRadius *= fRadius;
|
||||
fRadius *= 200;
|
||||
m_Sprites[i].SetX( CENTER_X + cosf(m_Sprites[i].GetRotation())*fRadius );
|
||||
m_Sprites[i].SetY( CENTER_Y + sinf(m_Sprites[i].GetRotation())*fRadius );
|
||||
m_Sprites[i].SetX( CENTER_X + cosf(m_Sprites[i].GetRotationZ())*fRadius );
|
||||
m_Sprites[i].SetY( CENTER_Y + sinf(m_Sprites[i].GetRotationZ())*fRadius );
|
||||
}
|
||||
break;
|
||||
case EFFECT_PARTICLES_SPIRAL_IN:
|
||||
@@ -453,13 +453,13 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
||||
if( m_Sprites[i].GetZoom() < SPIRAL_MIN_ZOOM )
|
||||
m_Sprites[i].SetZoom( SPIRAL_MAX_ZOOM );
|
||||
|
||||
m_Sprites[i].SetRotation( m_Sprites[i].GetRotation() - fDeltaTime );
|
||||
m_Sprites[i].SetRotationZ( m_Sprites[i].GetRotationZ() - fDeltaTime );
|
||||
|
||||
float fRadius = (m_Sprites[i].GetZoom()-SPIRAL_MIN_ZOOM);
|
||||
fRadius *= fRadius;
|
||||
fRadius *= 200;
|
||||
m_Sprites[i].SetX( CENTER_X + cosf(m_Sprites[i].GetRotation())*fRadius );
|
||||
m_Sprites[i].SetY( CENTER_Y + sinf(m_Sprites[i].GetRotation())*fRadius );
|
||||
m_Sprites[i].SetX( CENTER_X + cosf(m_Sprites[i].GetRotationZ())*fRadius );
|
||||
m_Sprites[i].SetY( CENTER_Y + sinf(m_Sprites[i].GetRotationZ())*fRadius );
|
||||
}
|
||||
break;
|
||||
case EFFECT_PARTICLES_FLOAT_UP:
|
||||
|
||||
@@ -30,13 +30,13 @@ BPMDisplay::BPMDisplay()
|
||||
m_bExtraStage = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2();
|
||||
|
||||
m_textBPM.LoadFromNumbers( THEME->GetPathTo("Numbers","select music bpm numbers") );
|
||||
m_textBPM.TurnShadowOff();
|
||||
m_textBPM.EnableShadow( false );
|
||||
m_textBPM.SetHorizAlign( Actor::align_right );
|
||||
m_textBPM.SetDiffuse( NORMAL_COLOR );
|
||||
m_textBPM.SetXY( 0, 0 );
|
||||
|
||||
m_sprLabel.Load( THEME->GetPathTo("Graphics","select music bpm label") );
|
||||
m_sprLabel.TurnShadowOff();
|
||||
m_sprLabel.EnableShadow( false );
|
||||
m_sprLabel.SetDiffuse( NORMAL_COLOR );
|
||||
m_sprLabel.SetHorizAlign( Actor::align_left );
|
||||
m_sprLabel.SetXY( 0, 0 );
|
||||
|
||||
@@ -66,7 +66,7 @@ void Banner::SetScrolling( bool bScroll, float Percent)
|
||||
|
||||
void Banner::LoadFromSong( Song* pSong ) // NULL means no song
|
||||
{
|
||||
Sprite::TurnShadowOff();
|
||||
Sprite::EnableShadow( false );
|
||||
|
||||
if( pSong == NULL ) LoadFallback();
|
||||
else if( pSong->HasBanner() ) Load( pSong->GetBannerPath() );
|
||||
@@ -92,7 +92,7 @@ void Banner::LoadFromGroup( CString sGroupName )
|
||||
|
||||
void Banner::LoadFromCourse( Course* pCourse ) // NULL means no course
|
||||
{
|
||||
Sprite::TurnShadowOff();
|
||||
Sprite::EnableShadow( false );
|
||||
|
||||
if( pCourse == NULL ) LoadFallback();
|
||||
else if( pCourse->m_sBannerPath != "" ) Load( pCourse->m_sBannerPath );
|
||||
|
||||
@@ -54,7 +54,7 @@ Combo::Combo()
|
||||
Reset();
|
||||
|
||||
m_sprCombo.Load( THEME->GetPathTo("Graphics", "gameplay combo label") );
|
||||
m_sprCombo.TurnShadowOn();
|
||||
m_sprCombo.EnableShadow( true );
|
||||
m_sprCombo.StopAnimating();
|
||||
m_sprCombo.SetXY( LABEL_X, LABEL_Y );
|
||||
m_sprCombo.SetHorizAlign( (Actor::HorizAlign)(int)LABEL_HORIZ_ALIGN );
|
||||
@@ -62,7 +62,7 @@ Combo::Combo()
|
||||
this->AddChild( &m_sprCombo );
|
||||
|
||||
m_textComboNumber.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay combo numbers") );
|
||||
m_textComboNumber.TurnShadowOn();
|
||||
m_textComboNumber.EnableShadow( true );
|
||||
m_textComboNumber.SetXY( NUMBER_X, NUMBER_Y );
|
||||
m_textComboNumber.SetHorizAlign( (Actor::HorizAlign)(int)NUMBER_HORIZ_ALIGN );
|
||||
m_textComboNumber.SetVertAlign( (Actor::VertAlign)(int)NUMBER_VERT_ALIGN );
|
||||
|
||||
@@ -51,7 +51,7 @@ CourseEntryDisplay::CourseEntryDisplay()
|
||||
|
||||
m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textNumber.SetXY( NUMBER_X, NUMBER_Y );
|
||||
m_textNumber.TurnShadowOff();
|
||||
m_textNumber.EnableShadow( false );
|
||||
this->AddChild( &m_textNumber );
|
||||
|
||||
m_TextBanner.SetXY( TEXT_BANNER_X, TEXT_BANNER_Y );
|
||||
@@ -59,20 +59,20 @@ CourseEntryDisplay::CourseEntryDisplay()
|
||||
|
||||
m_textFoot.LoadFromTextureAndChars( THEME->GetPathTo("Graphics","select music meter 2x1"),"10" );
|
||||
m_textFoot.SetXY( FOOT_X, FOOT_Y );
|
||||
m_textFoot.TurnShadowOff();
|
||||
m_textFoot.EnableShadow( false );
|
||||
this->AddChild( &m_textFoot );
|
||||
|
||||
m_textDifficultyNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textDifficultyNumber.SetXY( DIFFICULTY_X, DIFFICULTY_Y );
|
||||
m_textDifficultyNumber.SetZoom( DIFFICULTY_ZOOM );
|
||||
m_textDifficultyNumber.TurnShadowOff();
|
||||
m_textDifficultyNumber.EnableShadow( false );
|
||||
this->AddChild( &m_textDifficultyNumber );
|
||||
|
||||
m_textModifiers.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textModifiers.SetXY( MODIFIERS_X, MODIFIERS_Y );
|
||||
m_textModifiers.SetZoom( MODIFIERS_ZOOM );
|
||||
m_textModifiers.SetHorizAlign( (Actor::HorizAlign)MODIFIERS_HORIZ_ALIGN );
|
||||
m_textModifiers.TurnShadowOff();
|
||||
m_textModifiers.EnableShadow( false );
|
||||
this->AddChild( &m_textModifiers );
|
||||
}
|
||||
|
||||
|
||||
@@ -15,20 +15,20 @@
|
||||
|
||||
void FadingBanner::SetCroppedSize( float fWidth, float fHeight )
|
||||
{
|
||||
m_BackBanner.SetCroppedSize( fWidth, fHeight );
|
||||
m_FrontBanner.SetCroppedSize( fWidth, fHeight );
|
||||
Banner::SetCroppedSize( fWidth, fHeight );
|
||||
}
|
||||
|
||||
void FadingBanner::Update( float fDeltaTime )
|
||||
{
|
||||
m_BackBanner.Update(fDeltaTime);
|
||||
m_FrontBanner.Update(fDeltaTime);
|
||||
Banner::Update( fDeltaTime );
|
||||
}
|
||||
|
||||
void FadingBanner::DrawPrimitives()
|
||||
{
|
||||
Banner::DrawPrimitives();
|
||||
m_BackBanner.Draw();
|
||||
m_FrontBanner.Draw();
|
||||
}
|
||||
|
||||
bool FadingBanner::Load( RageTextureID ID )
|
||||
@@ -42,13 +42,13 @@ void FadingBanner::BeforeChange()
|
||||
// move the back banner to the front in preparation for a cross fade
|
||||
if( this->GetTexturePath() != "" )
|
||||
{
|
||||
m_BackBanner.Load( this->GetTexturePath() );
|
||||
m_BackBanner.SetScrolling( this->IsScrolling(), this->ScrollingPercent() );
|
||||
m_FrontBanner.Load( this->GetTexturePath() );
|
||||
m_FrontBanner.SetScrolling( this->IsScrolling(), this->ScrollingPercent() );
|
||||
}
|
||||
|
||||
m_BackBanner.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_BackBanner.StopTweening();
|
||||
m_BackBanner.BeginTweening( 0.25f ); // fade out
|
||||
m_BackBanner.SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
m_FrontBanner.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_FrontBanner.StopTweening();
|
||||
m_FrontBanner.BeginTweening( 0.25f ); // fade out
|
||||
m_FrontBanner.SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
protected:
|
||||
void BeforeChange();
|
||||
|
||||
Banner m_BackBanner;
|
||||
Banner m_FrontBanner;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "SongManager.h"
|
||||
#include "Notes.h"
|
||||
#include "NoteSkinManager.h"
|
||||
#include "ModeChoice.h"
|
||||
|
||||
|
||||
GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program
|
||||
@@ -240,6 +241,18 @@ const StyleDef* GameState::GetCurrentStyleDef()
|
||||
return GAMEMAN->GetStyleDefForStyle( m_CurStyle );
|
||||
}
|
||||
|
||||
void GameState::ApplyModeChoice( const ModeChoice* pModeChoice, PlayerNumber pn )
|
||||
{
|
||||
if( pModeChoice->game != GAME_INVALID )
|
||||
m_CurGame = pModeChoice->game;
|
||||
if( pModeChoice->pm != PLAY_MODE_INVALID )
|
||||
m_PlayMode = pModeChoice->pm;
|
||||
if( pModeChoice->style != STYLE_INVALID )
|
||||
m_CurStyle = pModeChoice->style;
|
||||
if( pModeChoice->dc != DIFFICULTY_INVALID && pn != PLAYER_INVALID )
|
||||
m_PreferredDifficulty[pn] = pModeChoice->dc;
|
||||
}
|
||||
|
||||
bool GameState::IsPlayerEnabled( PlayerNumber pn )
|
||||
{
|
||||
if( m_CurStyle == STYLE_INVALID ) // if no style set (we're in TitleMenu, ConfigInstruments or something)
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "Grade.h"
|
||||
#include "StageStats.h"
|
||||
|
||||
|
||||
class Song;
|
||||
struct Notes;
|
||||
class Course;
|
||||
class GameDef;
|
||||
class StyleDef;
|
||||
struct ModeChoice;
|
||||
|
||||
|
||||
class GameState
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
Style m_CurStyle;
|
||||
bool m_bPlayersCanJoin; // true if it's not too late for a player to join - this only has an effect on the credits message
|
||||
bool m_bSideIsJoined[NUM_PLAYERS]; // left side, right side
|
||||
PlayMode m_PlayMode; // many screens display different info depending on this value
|
||||
int m_iCoins; // not "credits"
|
||||
PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides
|
||||
bool m_bIsOnSystemMenu; // system screens will not be effected by the operator key -- Miryokuteki
|
||||
@@ -56,10 +57,11 @@ public:
|
||||
return iNumSidesJoined;
|
||||
};
|
||||
|
||||
|
||||
GameDef* GetCurrentGameDef();
|
||||
const StyleDef* GetCurrentStyleDef();
|
||||
|
||||
void ApplyModeChoice( const ModeChoice* pModeChoice, PlayerNumber pn );
|
||||
|
||||
bool IsPlayerEnabled( PlayerNumber pn );
|
||||
bool IsPlayerEnabled( int p ) { return IsPlayerEnabled( (PlayerNumber)p ); }; // for those too lasy to cast all those p's to a PlayerNumber
|
||||
bool IsCourseMode() const;
|
||||
@@ -68,7 +70,6 @@ public:
|
||||
CString m_sPreferredGroup; // GROUP_ALL_MUSIC denotes no preferred group
|
||||
Difficulty m_PreferredDifficulty[NUM_PLAYERS];
|
||||
SongSortOrder m_SongSortOrder; // used by MusicWheel
|
||||
PlayMode m_PlayMode; // many screen display different info depending on this value
|
||||
bool m_bEditing; // NoteField does special stuff when this is true
|
||||
bool m_bDemonstration; // ScreenGameplay does special stuff when this is true
|
||||
bool m_bJukeboxUsesModifiers;
|
||||
|
||||
@@ -58,7 +58,7 @@ void GrooveRadar::TweenOnScreen()
|
||||
m_sprRadarLabels[c].BeginTweening( 0.1f ); // begin fading on screen
|
||||
m_sprRadarLabels[c].SetTweenGlow( RageColor(1,1,1,1) );
|
||||
|
||||
m_sprRadarLabels[c].BeginTweening( 0.3f, Actor::TWEEN_BIAS_BEGIN ); // fly to the right
|
||||
m_sprRadarLabels[c].BeginTweening( 0.3f, Actor::TWEEN_ACCELERATE ); // fly to the right
|
||||
m_sprRadarLabels[c].SetTweenX( fOriginalX );
|
||||
m_sprRadarLabels[c].SetTweenZoom( 1 );
|
||||
m_sprRadarLabels[c].SetTweenGlow( RageColor(1,1,1,0) );
|
||||
@@ -204,7 +204,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives()
|
||||
void GrooveRadar::GrooveRadarValueMap::TweenOnScreen()
|
||||
{
|
||||
SetZoom( 0.5f );
|
||||
SetRotation( PI*4 );
|
||||
SetRotationZ( PI*4 );
|
||||
BeginTweening( 0.6f );
|
||||
SetTweenZoom( 1 );
|
||||
SetTweenRotationZ( 0 );
|
||||
|
||||
@@ -33,7 +33,7 @@ HoldJudgment::HoldJudgment()
|
||||
m_fShowCountdown = 0;
|
||||
m_sprJudgment.Load( THEME->GetPathTo("Graphics","gameplay hold Judgment 1x2") );
|
||||
m_sprJudgment.StopAnimating();
|
||||
m_sprJudgment.TurnShadowOn();
|
||||
m_sprJudgment.EnableShadow( true );
|
||||
this->AddChild( &m_sprJudgment );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ Judgment::Judgment()
|
||||
m_sprJudgment.Load( THEME->GetPathTo("Graphics","gameplay Judgment 1x6") );
|
||||
m_sprJudgment.SetXY( WORD_X, WORD_Y );
|
||||
m_sprJudgment.StopAnimating();
|
||||
m_sprJudgment.TurnShadowOn();
|
||||
m_sprJudgment.EnableShadow( true );
|
||||
this->AddChild( &m_sprJudgment );
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void Judgment::SetJudgment( TapNoteScore score )
|
||||
// vibrate
|
||||
m_sprJudgment.SetY( 0 );
|
||||
m_sprJudgment.SetZoom( 1.0f );
|
||||
m_sprJudgment.SetEffectVibrating();
|
||||
m_sprJudgment.SetEffectVibrate();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,7 +120,7 @@ void Judgment::SetJudgment( TapNoteScore score )
|
||||
}
|
||||
|
||||
if( score == TNS_MARVELOUS )
|
||||
m_sprJudgment.SetEffectGlowBlinking(0.05f, RageColor(1,1,1,0), RageColor(1,1,1,0.5f));
|
||||
m_sprJudgment.SetEffectGlowBlink(0.05f, RageColor(1,1,1,0), RageColor(1,1,1,0.5f));
|
||||
else
|
||||
m_sprJudgment.SetEffectNone();
|
||||
}
|
||||
|
||||
@@ -59,21 +59,21 @@ void LifeMeterBattery::Load( PlayerNumber pn )
|
||||
|
||||
m_textNumLives.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay battery life numbers") );
|
||||
m_textNumLives.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_textNumLives.TurnShadowOff();
|
||||
m_textNumLives.EnableShadow( false );
|
||||
if( bPlayerEnabled )
|
||||
this->AddChild( &m_textNumLives );
|
||||
|
||||
if(PREFSMAN->m_bDancePointsForOni)
|
||||
{
|
||||
m_textPercent.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay battery dance point numbers") );
|
||||
m_textPercent.TurnShadowOff();
|
||||
m_textPercent.EnableShadow( false );
|
||||
m_textPercent.SetZoom( 0.7f );
|
||||
m_textPercent.SetText( " " );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_textPercent.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay battery percent numbers") );
|
||||
m_textPercent.TurnShadowOff();
|
||||
m_textPercent.EnableShadow( false );
|
||||
m_textPercent.SetZoom( 0.7f );
|
||||
m_textPercent.SetText( "00.0%" );
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ MenuTimer::MenuTimer()
|
||||
m_textDigit1.LoadFromNumbers( THEME->GetPathTo("Numbers","menu timer numbers") );
|
||||
m_textDigit2.LoadFromNumbers( THEME->GetPathTo("Numbers","menu timer numbers") );
|
||||
|
||||
m_textDigit1.TurnShadowOff();
|
||||
m_textDigit2.TurnShadowOff();
|
||||
m_textDigit1.EnableShadow( false );
|
||||
m_textDigit2.EnableShadow( false );
|
||||
|
||||
const glyph &g = m_textDigit1.m_pFont->GetGlyph('0');
|
||||
float fCharWidth = (float)g.Texture->GetSourceFrameWidth();
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "Game.h"
|
||||
#include "Style.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
struct ModeChoice // used in SelectMode
|
||||
{
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "global.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelector
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ModeSelector.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "GameState.h"
|
||||
#include "ModeChoice.h"
|
||||
|
||||
|
||||
|
||||
bool ModeSelector::IsSelectable( const ModeChoice& choice )
|
||||
{
|
||||
return choice.numSidesJoinedToPlay == GAMESTATE->GetNumSidesJoined();
|
||||
}
|
||||
|
||||
|
||||
#include "ModeSelectorMaxType1.h"
|
||||
#include "ModeSelectorMaxType2.h"
|
||||
|
||||
ModeSelector* ModeSelector::Create( CString sClassName )
|
||||
{
|
||||
if( sClassName.CompareNoCase("ModeSelectorMaxType1") == 0 ) return new ModeSelectorMaxType1;
|
||||
if( sClassName.CompareNoCase("ModeSelectorMaxType2") == 0 ) return new ModeSelectorMaxType2;
|
||||
|
||||
RageException::Throw( "Invalid ModeSelector class name '%s'.", sClassName.GetString() );
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef ModeSelector_H
|
||||
#define ModeSelector_H
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelector
|
||||
|
||||
Desc: Abstract class for a widget that selects a ModeChoice
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "Screen.h"
|
||||
#include "PlayerNumber.h"
|
||||
struct ModeChoice;
|
||||
|
||||
// send SM_BeginFadingOut when all players have confirmed choice
|
||||
|
||||
|
||||
class ModeSelector : public Screen // instead of ActorFrame so we can use ScreenMessages
|
||||
{
|
||||
public:
|
||||
ModeSelector() {};
|
||||
virtual ~ModeSelector() {};
|
||||
|
||||
virtual void Init( const vector<ModeChoice>& choices, CString sClassName, CString sThemeElementPrefix ) = 0;
|
||||
|
||||
virtual void MenuLeft( PlayerNumber pn ) = 0;
|
||||
virtual void MenuRight( PlayerNumber pn ) = 0;
|
||||
virtual void MenuUp( PlayerNumber pn ) = 0;
|
||||
virtual void MenuDown( PlayerNumber pn ) = 0;
|
||||
virtual void MenuStart( PlayerNumber pn ) = 0;
|
||||
virtual void MenuBack( PlayerNumber pn ) = 0;
|
||||
virtual void TweenOffScreen() = 0;
|
||||
virtual void TweenOnScreen() = 0;
|
||||
|
||||
virtual void GetSelectedModeChoice( PlayerNumber pn, ModeChoice* pModeChoiceOut ) = 0;
|
||||
bool IsSelectable( const ModeChoice& choice );
|
||||
virtual void UpdateSelectableChoices() = 0;
|
||||
|
||||
static ModeSelector* Create( CString sClassName );
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,276 @@
|
||||
#include "global.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelectorMaxType1
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ModeSelectorMaxType1.h"
|
||||
#include "GameManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ScreenManager.h"
|
||||
|
||||
|
||||
#define JOINT_PREMIUM_BANNER_X THEME->GetMetricF("ModeSelectorMaxType1","JointPremiumBannerX")
|
||||
#define JOINT_PREMIUM_BANNER_Y THEME->GetMetricF("ModeSelectorMaxType1","JointPremiumBannerY")
|
||||
#define ICONS_START_X THEME->GetMetricF("ModeSelectorMaxType1","IconsStartX")
|
||||
#define ICONS_SPACING_X THEME->GetMetricF("ModeSelectorMaxType1","IconsSpacingX")
|
||||
#define ICONS_START_Y THEME->GetMetricF("ModeSelectorMaxType1","IconsStartY")
|
||||
#define ICONS_SPACING_Y THEME->GetMetricF("ModeSelectorMaxType1","IconsSpacingY")
|
||||
#define ICONS_DISABLED_COLOR THEME->GetMetricC("ModeSelectorMaxType1","IconsDisabledColor")
|
||||
#define EXPLANATION_X THEME->GetMetricF("ModeSelectorMaxType1","ExplanationX")
|
||||
#define EXPLANATION_Y THEME->GetMetricF("ModeSelectorMaxType1","ExplanationY")
|
||||
#define INFO_X THEME->GetMetricF("ModeSelectorMaxType1","InfoX")
|
||||
#define INFO_Y THEME->GetMetricF("ModeSelectorMaxType1","InfoY")
|
||||
#define PREVIEW_X THEME->GetMetricF("ModeSelectorMaxType1","PreviewX")
|
||||
#define PREVIEW_Y THEME->GetMetricF("ModeSelectorMaxType1","PreviewY")
|
||||
#define FADE_SECONDS THEME->GetMetricF("ModeSelectorMaxType1","FadeSeconds")
|
||||
|
||||
|
||||
ModeSelectorMaxType1::ModeSelectorMaxType1()
|
||||
{
|
||||
m_iSelection = 0;
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::Init( const vector<ModeChoice>& choices, CString sClassName, CString sThemeElementPrefix )
|
||||
{
|
||||
m_aModeChoices = choices;
|
||||
|
||||
unsigned i;
|
||||
for( i=0; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[i];
|
||||
CString sGameName = GAMEMAN->GetGameDefForGame(mc.game)->m_szName;
|
||||
|
||||
|
||||
//
|
||||
// Load icon
|
||||
//
|
||||
float fIconX = ICONS_START_X + i*ICONS_SPACING_X;
|
||||
float fIconY = ICONS_START_Y + i*ICONS_SPACING_Y;
|
||||
CString sIconElementName = ssprintf("%s icon %s %s", sThemeElementPrefix.GetString(), sGameName.GetString(), mc.name );
|
||||
CString sIconPath = THEME->GetPathTo("Graphics",sIconElementName);
|
||||
if( sIconPath.empty() ) // element doesn't exist
|
||||
{
|
||||
m_textIcon[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textIcon[i].SetXY( fIconX, fIconY );
|
||||
m_textIcon[i].SetText( mc.name );
|
||||
m_textIcon[i].SetZoom(0.5f);
|
||||
this->AddChild( &m_textIcon[i] );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sprIcon[i].Load( sIconPath );
|
||||
m_sprIcon[i].SetXY( fIconX, fIconY );
|
||||
this->AddChild( &m_sprIcon[i] );
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Load preview
|
||||
//
|
||||
CString sPreviewElementName = ssprintf("%s preview %s %s", sThemeElementPrefix.GetString(), sGameName.GetString(), mc.name );
|
||||
CString sPreviewPath = THEME->GetPathTo("Graphics",sPreviewElementName);
|
||||
if( sPreviewPath != "" )
|
||||
{
|
||||
m_sprPreview[i].Load( sPreviewPath );
|
||||
m_sprPreview[i].SetXY( PREVIEW_X, PREVIEW_Y );
|
||||
m_sprPreview[i].SetDiffuse( RageColor(1,1,1,0) );
|
||||
this->AddChild( &m_sprPreview[i] );
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Load info
|
||||
//
|
||||
CString sInfoElementName = ssprintf("%s info %s %s", sThemeElementPrefix.GetString(), sGameName.GetString(), mc.name );
|
||||
CString sInfoPath = THEME->GetPathTo("Graphics",sInfoElementName);
|
||||
if( sInfoPath != "" )
|
||||
{
|
||||
m_sprInfo[i].Load( sInfoPath );
|
||||
m_sprInfo[i].SetXY( INFO_X, INFO_Y );
|
||||
m_sprInfo[i].SetDiffuse( RageColor(1,1,1,0) );
|
||||
this->AddChild( &m_sprInfo[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// fix Z ordering of Preview and Info so that they draw on top
|
||||
for( i=0; i<this->m_aModeChoices.size(); i++ )
|
||||
this->MoveToTail( &m_sprPreview[i] );
|
||||
for( i=0; i<this->m_aModeChoices.size(); i++ )
|
||||
this->MoveToTail( &m_sprInfo[i] );
|
||||
|
||||
|
||||
this->UpdateSelectableChoices();
|
||||
|
||||
m_sprExplanation.Load( THEME->GetPathTo("Graphics","select style explanation") );
|
||||
m_sprExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
|
||||
this->AddChild( &m_sprExplanation );
|
||||
|
||||
if( PREFSMAN->m_bJointPremium )
|
||||
{
|
||||
m_sprJointPremium.Load( THEME->GetPathTo("Graphics","select style joint premium banner") );
|
||||
m_sprJointPremium.SetXY( JOINT_PREMIUM_BANNER_X, JOINT_PREMIUM_BANNER_Y );
|
||||
this->AddChild( &m_sprJointPremium );
|
||||
}
|
||||
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds",sThemeElementPrefix + " change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
|
||||
TweenOnScreen();
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::MenuLeft( PlayerNumber pn )
|
||||
{
|
||||
int iSwitchToIndex = -1; // -1 means none found
|
||||
for( int i=m_iSelection-1; i>=0; i-- )
|
||||
{
|
||||
if( IsSelectable(m_aModeChoices[i]) )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( iSwitchToIndex == -1 )
|
||||
return;
|
||||
|
||||
BeforeChange();
|
||||
m_iSelection = iSwitchToIndex;
|
||||
m_soundChange.Play();
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
int iSwitchToIndex = -1; // -1 means none found
|
||||
for( unsigned i=m_iSelection+1; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
if( IsSelectable(m_aModeChoices[i]) )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( iSwitchToIndex == -1 )
|
||||
return;
|
||||
|
||||
BeforeChange();
|
||||
m_iSelection = iSwitchToIndex;
|
||||
m_soundChange.Play();
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::MenuStart( PlayerNumber pn )
|
||||
{
|
||||
m_soundSelect.Play();
|
||||
SCREENMAN->SendMessageToTopScreen( SM_BeginFadingOut, 0 );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::MenuBack( PlayerNumber pn )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::TweenOffScreen()
|
||||
{
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
m_sprIcon[i].FadeOff( 0, "FoldY", FADE_SECONDS );
|
||||
m_textIcon[i].FadeOff( 0, "FoldY", FADE_SECONDS );
|
||||
}
|
||||
m_sprExplanation.FadeOff( 0, "FoldY", FADE_SECONDS );
|
||||
m_sprPreview[m_iSelection].FadeOff( 0, "FoldY", FADE_SECONDS );
|
||||
m_sprInfo[m_iSelection].FadeOff( 0, "FoldY", FADE_SECONDS );
|
||||
m_sprJointPremium.FadeOff( 0, "fade", FADE_SECONDS );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::TweenOnScreen()
|
||||
{
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
m_sprIcon[i].FadeOn( (m_aModeChoices.size()-i)*0.05f, "Left Accelerate", FADE_SECONDS );
|
||||
m_textIcon[i].FadeOn( (m_aModeChoices.size()-i)*0.05f, "Left Accelerate", FADE_SECONDS );
|
||||
}
|
||||
m_sprExplanation.FadeOn( 0, "Right Accelerate", FADE_SECONDS );
|
||||
m_sprJointPremium.FadeOn( 0, "fade", FADE_SECONDS );
|
||||
|
||||
// let AfterChange tween Preview and Info
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::GetSelectedModeChoice( PlayerNumber pn, ModeChoice* pModeChoiceOut )
|
||||
{
|
||||
*pModeChoiceOut = m_aModeChoices[m_iSelection]; // doesn't depend on pn
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::UpdateSelectableChoices()
|
||||
{
|
||||
unsigned i;
|
||||
/* XXX: If a player joins during the tween-in, this diffuse change
|
||||
* will be undone by the tween. Hmm. */
|
||||
for( i=0; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
/* If the icon is text, use a dimmer diffuse, or we won't be
|
||||
* able to see the glow. */
|
||||
if( IsSelectable(m_aModeChoices[i]) )
|
||||
{
|
||||
m_sprIcon[i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_textIcon[i].SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); // gray so glow is visible
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sprIcon[i].SetDiffuse( ICONS_DISABLED_COLOR );
|
||||
m_textIcon[i].SetDiffuse( ICONS_DISABLED_COLOR );
|
||||
}
|
||||
}
|
||||
|
||||
// Select first enabled choie
|
||||
BeforeChange();
|
||||
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( i=0; i<m_aModeChoices.size(); i++ )
|
||||
{
|
||||
if( IsSelectable(m_aModeChoices[i]) )
|
||||
{
|
||||
iSwitchToStyleIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ASSERT( iSwitchToStyleIndex != -1 ); // no styles are enabled. We're stuck! This should never happen
|
||||
|
||||
m_iSelection = iSwitchToStyleIndex;
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::BeforeChange()
|
||||
{
|
||||
// dim/hide old selection
|
||||
m_sprIcon[m_iSelection].SetEffectNone();
|
||||
m_textIcon[m_iSelection].SetEffectNone();
|
||||
m_sprPreview[m_iSelection].StopTweening();
|
||||
m_sprInfo[m_iSelection].StopTweening();
|
||||
m_sprPreview[m_iSelection].SetDiffuse( RageColor(1,1,1,0) );
|
||||
m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,0) );
|
||||
m_sprPreview[m_iSelection].SetGlow( RageColor(1,1,1,0) );
|
||||
m_sprInfo[m_iSelection].SetGlow( RageColor(1,1,1,0) );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType1::AfterChange()
|
||||
{
|
||||
m_sprIcon[m_iSelection].SetEffectGlowShift();
|
||||
m_textIcon[m_iSelection].SetEffectGlowShift();
|
||||
m_sprPreview[m_iSelection].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprPreview[m_iSelection].SetZoom( 1 );
|
||||
m_sprInfo[m_iSelection].SetZoom( 1 );
|
||||
m_sprPreview[m_iSelection].FadeOn( 0, "ghost", FADE_SECONDS );
|
||||
m_sprInfo[m_iSelection].FadeOn( 0, "FoldY bounce", FADE_SECONDS );
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef ModeSelectorMaxType1_H
|
||||
#define ModeSelectorMaxType1_H
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelectorMaxType1
|
||||
|
||||
Desc: Abstract class for a widget that selects a ModeChoice
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "ModeSelector.h"
|
||||
#include "Sprite.h"
|
||||
#include "BitmapText.h"
|
||||
#include "RageSound.h"
|
||||
|
||||
|
||||
#define MAX_MODE_CHOICES 30
|
||||
|
||||
|
||||
class ModeSelectorMaxType1 : public ModeSelector
|
||||
{
|
||||
public:
|
||||
ModeSelectorMaxType1();
|
||||
virtual ~ModeSelectorMaxType1() {};
|
||||
|
||||
virtual void Init( const vector<ModeChoice>& choices, CString sClassName, CString sThemeElementPrefix );
|
||||
|
||||
virtual void MenuLeft( PlayerNumber pn );
|
||||
virtual void MenuRight( PlayerNumber pn );
|
||||
virtual void MenuUp( PlayerNumber pn ) {};
|
||||
virtual void MenuDown( PlayerNumber pn ) {};
|
||||
virtual void MenuStart( PlayerNumber pn );
|
||||
virtual void MenuBack( PlayerNumber pn );
|
||||
virtual void TweenOffScreen();
|
||||
virtual void TweenOnScreen();
|
||||
|
||||
virtual void GetSelectedModeChoice( PlayerNumber pn, ModeChoice* pModeChoiceOut );
|
||||
virtual void UpdateSelectableChoices();
|
||||
|
||||
protected:
|
||||
void BeforeChange();
|
||||
void AfterChange();
|
||||
|
||||
vector<ModeChoice> m_aModeChoices;
|
||||
int m_iSelection;
|
||||
|
||||
Sprite m_sprIcon[MAX_MODE_CHOICES];
|
||||
// Artists don't make graphics for every single Game, so
|
||||
// have a text representation if textures are missing.
|
||||
BitmapText m_textIcon[MAX_MODE_CHOICES];
|
||||
Sprite m_sprPreview[MAX_MODE_CHOICES];
|
||||
Sprite m_sprInfo[MAX_MODE_CHOICES];
|
||||
Sprite m_sprExplanation;
|
||||
Sprite m_sprJointPremium;
|
||||
|
||||
RageSound m_soundChange;
|
||||
RageSound m_soundSelect;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,407 @@
|
||||
#include "global.h"
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelectorMaxType2
|
||||
|
||||
Desc: See header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ModeSelectorMaxType2.h"
|
||||
#include "GameManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "GameState.h"
|
||||
#include "AnnouncerManager.h"
|
||||
|
||||
|
||||
#define NUM_CHOICES_ON_PAGE_1 THEME->GetMetricI("ModeSelectorMaxType2","NumChoicesOnPage1")
|
||||
#define LOCK_INPUT_SECONDS THEME->GetMetricF("ModeSelectorMaxType2","LockInputSeconds")
|
||||
#define SLEEP_AFTER_CHOICE_SECONDS THEME->GetMetricF("ModeSelectorMaxType2","SleepAfterChoiceSeconds")
|
||||
#define SLEEP_AFTER_TWEEN_OFF_SECONDS THEME->GetMetricF("ModeSelectorMaxType2","SleepAfterTweenOffSeconds")
|
||||
#define MORE_ON_COMMAND( page ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("MorePage%dOnCommand",page+1))
|
||||
#define MORE_OFF_COMMAND( page ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("MorePage%dOffCommand",page+1))
|
||||
#define EXPLANATION_ON_COMMAND( page ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("ExplanationPage%dOnCommand",page+1))
|
||||
#define EXPLANATION_OFF_COMMAND( page ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("ExplanationPage%dOffCommand",page+1))
|
||||
#define HEADER_ON_COMMAND( page, choice ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("HeaderPage%dChoice%dOnCommand",page+1,choice+1))
|
||||
#define HEADER_OFF_COMMAND( page, choice ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("HeaderPage%dChoice%dOffCommand",page+1,choice+1))
|
||||
#define PICTURE_ON_COMMAND( page, choice ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("PicturePage%dChoice%dOnCommand",page+1,choice+1))
|
||||
#define PICTURE_OFF_COMMAND( page, choice ) THEME->GetMetric ("ModeSelectorMaxType2",ssprintf("PicturePage%dChoice%dOffCommand",page+1,choice+1))
|
||||
#define CURSOR_ON_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","CursorOnCommand")
|
||||
#define CURSOR_CHOOSE_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","CursorChooseCommand")
|
||||
#define CURSOR_OFF_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","CursorOffCommand")
|
||||
#define CURSOR_OFFSET_X_FROM_PICTURE( p ) THEME->GetMetricF("ModeSelectorMaxType2",ssprintf("CursorP%dOffsetXFromPicture",p+1))
|
||||
#define CURSOR_OFFSET_Y_FROM_PICTURE( p ) THEME->GetMetricF("ModeSelectorMaxType2",ssprintf("CursorP%dOffsetYFromPicture",p+1))
|
||||
#define SHADOW_ON_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","ShadowOnCommand")
|
||||
#define SHADOW_CHOOSE_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","ShadowChooseCommand")
|
||||
#define SHADOW_OFF_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","ShadowOffCommand")
|
||||
#define SHADOW_LENGTH_X THEME->GetMetricF("ModeSelectorMaxType2","ShadowLengthX")
|
||||
#define SHADOW_LENGTH_Y THEME->GetMetricF("ModeSelectorMaxType2","ShadowLengthY")
|
||||
#define OK_ON_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","OKOnCommand")
|
||||
#define OK_CHOOSE_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","OKChooseCommand")
|
||||
#define OK_OFF_COMMAND THEME->GetMetric ("ModeSelectorMaxType2","OKOffCommand")
|
||||
#define DISABLED_COLOR THEME->GetMetricC("ModeSelectorMaxType2","DisabledColor")
|
||||
|
||||
|
||||
|
||||
ModeSelectorMaxType2::ModeSelectorMaxType2()
|
||||
{
|
||||
m_CurrentPage = PAGE_1;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_iChoiceOnPage[p] = 0;
|
||||
m_bChosen[p] = false;
|
||||
}
|
||||
}
|
||||
|
||||
ModeSelectorMaxType2::~ModeSelectorMaxType2()
|
||||
{
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::Init( const vector<ModeChoice>& choices, CString sClassName, CString sThemeElementPrefix )
|
||||
{
|
||||
for( int c=0; c<choices.size(); c++ )
|
||||
if( c < NUM_CHOICES_ON_PAGE_1 )
|
||||
m_ModeChoices[PAGE_1].push_back( choices[c] );
|
||||
else
|
||||
m_ModeChoices[PAGE_2].push_back( choices[c] );
|
||||
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
{
|
||||
|
||||
for( int choice=0; choice<m_ModeChoices[page].size(); choice++ )
|
||||
{
|
||||
CString sHeaderFile = ssprintf( "%s header %s", sThemeElementPrefix.GetString(), m_ModeChoices[page][choice].name );
|
||||
CString sPictureFile = ssprintf( "%s picture %s", sThemeElementPrefix.GetString(), m_ModeChoices[page][choice].name );
|
||||
|
||||
m_sprPicture[page][choice].Load( THEME->GetPathTo("Graphics",sPictureFile) );
|
||||
m_framePages.AddChild( &m_sprPicture[page][choice] );
|
||||
|
||||
m_sprHeader[page][choice].Load( THEME->GetPathTo("Graphics",sHeaderFile) );
|
||||
m_framePages.AddChild( &m_sprHeader[page][choice] );
|
||||
}
|
||||
|
||||
|
||||
m_sprMore[page].Load( THEME->GetPathTo("Graphics", ssprintf("%s more page%d",sThemeElementPrefix.GetString(),page+1) ) );
|
||||
m_framePages.AddChild( &m_sprMore[page] );
|
||||
|
||||
m_sprExplanation[page].Load( THEME->GetPathTo("Graphics", ssprintf("%s explanation",sThemeElementPrefix.GetString())) );
|
||||
m_sprExplanation[page].StopAnimating();
|
||||
m_sprExplanation[page].SetState( page );
|
||||
m_framePages.AddChild( &m_sprExplanation[page] );
|
||||
}
|
||||
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
CLAMP( m_iChoiceOnPage[p], 0, (int)m_ModeChoices[0].size()-1 );
|
||||
m_bChosen[p] = false;
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
m_sprShadow[p].Load( THEME->GetPathTo("Graphics", "select difficulty shadow 2x1") );
|
||||
m_sprShadow[p].StopAnimating();
|
||||
m_sprShadow[p].SetState( p );
|
||||
m_sprShadow[p].SetDiffuse( RageColor(0,0,0,0.6f) );
|
||||
m_framePages.AddChild( &m_sprShadow[p] );
|
||||
|
||||
m_sprCursor[p].Load( THEME->GetPathTo("Graphics", "select difficulty cursor 2x1") );
|
||||
m_sprCursor[p].StopAnimating();
|
||||
m_sprCursor[p].SetState( p );
|
||||
m_framePages.AddChild( &m_sprCursor[p] );
|
||||
|
||||
m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ok 2x1") );
|
||||
m_sprOK[p].SetState( p );
|
||||
m_sprOK[p].StopAnimating();
|
||||
m_sprOK[p].SetDiffuse( RageColor(1,1,1,0) );
|
||||
m_framePages.AddChild( &m_sprOK[p] );
|
||||
}
|
||||
|
||||
this->AddChild( &m_framePages );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") );
|
||||
m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") );
|
||||
|
||||
m_fLockInputTime = LOCK_INPUT_SECONDS;
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::Update( float fDelta )
|
||||
{
|
||||
ModeSelector::Update( fDelta );
|
||||
m_fLockInputTime = max( 0, m_fLockInputTime-fDelta );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
{
|
||||
case SM_BeginFadingOut:
|
||||
TweenOffScreen();
|
||||
SCREENMAN->SendMessageToTopScreen( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // nofify parent that we're finished
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::GetSelectedModeChoice( PlayerNumber pn, ModeChoice* pModeChoiceOut )
|
||||
{
|
||||
*pModeChoiceOut = m_ModeChoices[m_CurrentPage][ m_iChoiceOnPage[pn] ]; // doesn't depend on pn
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::UpdateSelectableChoices()
|
||||
{
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
{
|
||||
/* XXX: If a player joins during the tween-in, this diffuse change
|
||||
* will be undone by the tween. Hmm. */
|
||||
for( unsigned i=0; i<m_ModeChoices[page].size(); i++ )
|
||||
{
|
||||
/* If the icon is text, use a dimmer diffuse, or we won't be
|
||||
* able to see the glow. */
|
||||
if( IsSelectable(m_ModeChoices[page][i]) )
|
||||
{
|
||||
m_sprHeader[page][i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprPicture[page][i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sprHeader[page][i].SetDiffuse( DISABLED_COLOR );
|
||||
m_sprPicture[page][i].SetDiffuse( DISABLED_COLOR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
{
|
||||
MenuRight( (PlayerNumber)p );
|
||||
MenuLeft( (PlayerNumber)p );
|
||||
}
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::MenuLeft( PlayerNumber pn )
|
||||
{
|
||||
if( m_fLockInputTime > 0 )
|
||||
return;
|
||||
if( m_bChosen[pn] )
|
||||
return;
|
||||
if( m_iChoiceOnPage[pn] == 0 ) // can't go left any more
|
||||
{
|
||||
if( m_CurrentPage > 0 )
|
||||
ChangePage( (Page)(m_CurrentPage-1) );
|
||||
}
|
||||
else
|
||||
ChangeWithinPage( pn, m_iChoiceOnPage[pn]-1, false );
|
||||
}
|
||||
|
||||
|
||||
void ModeSelectorMaxType2::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
if( m_fLockInputTime > 0 )
|
||||
return;
|
||||
if( m_bChosen[pn] )
|
||||
return;
|
||||
if( m_iChoiceOnPage[pn] == (int)m_ModeChoices[m_CurrentPage].size()-1 ) // can't go left any more
|
||||
{
|
||||
if( m_CurrentPage < NUM_PAGES-1 )
|
||||
ChangePage( (Page)(m_CurrentPage+1) );
|
||||
}
|
||||
else
|
||||
ChangeWithinPage( pn, m_iChoiceOnPage[pn]+1, false );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::ChangePage( Page newPage )
|
||||
{
|
||||
int p;
|
||||
|
||||
// If anyone has already chosen, don't allow changing of pages
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) && m_bChosen[p] )
|
||||
return;
|
||||
|
||||
bool bPageIncreasing = newPage > m_CurrentPage;
|
||||
m_CurrentPage = newPage;
|
||||
|
||||
if( newPage == PAGE_2 )
|
||||
{
|
||||
m_soundDifficult.Stop();
|
||||
m_soundDifficult.PlayRandom();
|
||||
}
|
||||
|
||||
// change both players
|
||||
int iNewChoice = bPageIncreasing ? 0 : m_ModeChoices[m_CurrentPage].size()-1;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
ChangeWithinPage( (PlayerNumber)p, iNewChoice, true );
|
||||
|
||||
// move frame with choices
|
||||
m_framePages.StopTweening();
|
||||
m_framePages.BeginTweening( 0.2f );
|
||||
m_framePages.SetTweenX( (float)newPage*-SCREEN_WIDTH );
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::ChangeWithinPage( PlayerNumber pn, int iNewChoice, bool bChangingPages )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
|
||||
if( p!=pn && m_CurrentPage==PAGE_1 )
|
||||
continue; // skip
|
||||
|
||||
m_iChoiceOnPage[p] = iNewChoice;
|
||||
|
||||
float fCursorX = GetCursorX( (PlayerNumber)p );
|
||||
float fCursorY = GetCursorY( (PlayerNumber)p );
|
||||
|
||||
m_sprCursor[p].StopTweening();
|
||||
m_sprCursor[p].BeginTweening( 0.2f, bChangingPages ? TWEEN_LINEAR : TWEEN_DECELERATE );
|
||||
m_sprCursor[p].SetTweenX( fCursorX );
|
||||
m_sprCursor[p].SetTweenY( fCursorY );
|
||||
|
||||
m_sprShadow[p].StopTweening();
|
||||
m_sprShadow[p].BeginTweening( 0.2f, bChangingPages ? TWEEN_LINEAR : TWEEN_DECELERATE );
|
||||
m_sprShadow[p].SetTweenX( fCursorX + SHADOW_LENGTH_X );
|
||||
m_sprShadow[p].SetTweenY( fCursorY + SHADOW_LENGTH_Y );
|
||||
}
|
||||
|
||||
m_soundChange.Play();
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::MenuStart( PlayerNumber pn )
|
||||
{
|
||||
if( m_fLockInputTime > 0 )
|
||||
return;
|
||||
if( m_bChosen[pn] == true )
|
||||
return;
|
||||
m_bChosen[pn] = true;
|
||||
|
||||
for( unsigned page=0; page<NUM_PAGES; page++ )
|
||||
m_sprMore[page].FadeOff( 0, "fade", 0.5f );
|
||||
|
||||
const ModeChoice& mc = m_ModeChoices[m_CurrentPage][m_iChoiceOnPage[pn]];
|
||||
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("select difficulty comment %s",mc.name)) );
|
||||
|
||||
/* XXX: This will play the same announcer twice at the same time; that'll probably
|
||||
* result in an echo effect. */
|
||||
if( m_CurrentPage == PAGE_2 )
|
||||
{
|
||||
// choose this for all the other players too
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( m_bChosen[p] )
|
||||
continue;
|
||||
|
||||
MenuStart( (PlayerNumber)p );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_sprCursor[pn].Command( CURSOR_CHOOSE_COMMAND );
|
||||
m_sprOK[pn].SetXY( m_sprShadow[pn].GetX(), m_sprShadow[pn].GetY() );
|
||||
m_sprOK[pn].Command( OK_CHOOSE_COMMAND );
|
||||
m_sprShadow[pn].Command( SHADOW_CHOOSE_COMMAND );
|
||||
|
||||
|
||||
m_soundSelect.Play();
|
||||
|
||||
// check to see if everyone has chosen
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false )
|
||||
return;
|
||||
}
|
||||
this->SendScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_CHOICE_SECONDS ); // tell our owner it's time to move on
|
||||
}
|
||||
|
||||
|
||||
void ModeSelectorMaxType2::MenuBack( PlayerNumber pn )
|
||||
{
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::TweenOnScreen()
|
||||
{
|
||||
unsigned p;
|
||||
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
{
|
||||
// m_sprExplanation[PAGE_1].Command( "x,-300;y,70;sleep,0.7;bounceend,0.5f;x,170" );
|
||||
// m_sprMore[PAGE_1].Command( "x,580;y,90;diffuse,1,1,1,0;linear,0.5;diffuse,1,1,1,1" );
|
||||
m_sprExplanation[page].Command( EXPLANATION_ON_COMMAND(page) );
|
||||
m_sprMore[page].Command( MORE_ON_COMMAND(page) );
|
||||
|
||||
for( unsigned c=0; c<m_ModeChoices[page].size(); c++ )
|
||||
{
|
||||
// fly on
|
||||
// m_sprHeader[p][c].FadeOn( fPause, "left far accelerate", 0.4f );
|
||||
m_sprHeader[page][c].Command( HEADER_ON_COMMAND(page,c) );
|
||||
|
||||
// roll down
|
||||
// m_sprPicture[p][c].FadeOn( fPause+0.4f, "foldy bounce", 0.3f );
|
||||
m_sprPicture[page][c].Command( PICTURE_ON_COMMAND(page,c) );
|
||||
}
|
||||
}
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
float fCursorX = GetCursorX( (PlayerNumber)p );
|
||||
float fCursorY = GetCursorY( (PlayerNumber)p );
|
||||
|
||||
m_sprCursor[p].SetXY( fCursorX, fCursorY );
|
||||
m_sprCursor[p].Command( CURSOR_ON_COMMAND );
|
||||
|
||||
m_sprShadow[p].SetXY( fCursorX + SHADOW_LENGTH_X, fCursorY + SHADOW_LENGTH_Y );
|
||||
m_sprShadow[p].Command( SHADOW_ON_COMMAND );
|
||||
}
|
||||
}
|
||||
|
||||
void ModeSelectorMaxType2::TweenOffScreen()
|
||||
{
|
||||
const int page = m_CurrentPage;
|
||||
|
||||
m_sprExplanation[page].Command( "sleep,0.7;bouncebegin,0.5f;x,-300" );
|
||||
m_sprMore[page].FadeOff( 0.7f, "fade", 0.5f );
|
||||
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
m_sprCursor[p].Command( CURSOR_OFF_COMMAND );
|
||||
m_sprOK[p].Command( OK_OFF_COMMAND );
|
||||
m_sprShadow[p].Command( SHADOW_OFF_COMMAND );
|
||||
}
|
||||
|
||||
for( unsigned c=0; c<m_ModeChoices[page].size(); c++ )
|
||||
{
|
||||
const float fPause = c*0.2f;
|
||||
|
||||
// roll up
|
||||
//m_sprPicture[page][c].FadeOff( fPause, "foldy bounce", 0.3f );
|
||||
m_sprPicture[page][c].Command( PICTURE_OFF_COMMAND(page,c) );
|
||||
|
||||
// fly off
|
||||
//m_sprHeader[page][c].FadeOff( fPause+0.3f, "left far accelerate", 0.4f );
|
||||
m_sprHeader[page][c].Command( HEADER_OFF_COMMAND(page,c) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float ModeSelectorMaxType2::GetCursorX( PlayerNumber pn )
|
||||
{
|
||||
return m_sprPicture[m_CurrentPage][m_iChoiceOnPage[pn]].GetX() + CURSOR_OFFSET_X_FROM_PICTURE(pn);
|
||||
}
|
||||
|
||||
float ModeSelectorMaxType2::GetCursorY( PlayerNumber pn )
|
||||
{
|
||||
return m_sprPicture[m_CurrentPage][m_iChoiceOnPage[pn]].GetY() + CURSOR_OFFSET_Y_FROM_PICTURE(pn);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef ModeSelectorMaxType2_H
|
||||
#define ModeSelectorMaxType2_H
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ModeSelectorMaxType2
|
||||
|
||||
Desc: Abstract class for a widget that selects a ModeChoice
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "ModeSelector.h"
|
||||
#include "Sprite.h"
|
||||
#include "BitmapText.h"
|
||||
#include "RageSound.h"
|
||||
#include "RandomSample.h"
|
||||
|
||||
|
||||
#define MAX_CHOICES_PER_PAGE 10
|
||||
|
||||
|
||||
class ModeSelectorMaxType2 : public ModeSelector
|
||||
{
|
||||
public:
|
||||
enum Page { PAGE_1, PAGE_2, NUM_PAGES };
|
||||
|
||||
ModeSelectorMaxType2();
|
||||
virtual ~ModeSelectorMaxType2();
|
||||
|
||||
virtual void Init( const vector<ModeChoice>& choices, CString sClassName, CString sThemeElementPrefix );
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
|
||||
virtual void MenuLeft( PlayerNumber pn );
|
||||
virtual void MenuRight( PlayerNumber pn );
|
||||
virtual void MenuUp( PlayerNumber pn ) {};
|
||||
virtual void MenuDown( PlayerNumber pn ) {};
|
||||
virtual void MenuStart( PlayerNumber pn );
|
||||
virtual void MenuBack( PlayerNumber pn );
|
||||
virtual void TweenOffScreen();
|
||||
virtual void TweenOnScreen();
|
||||
|
||||
virtual void GetSelectedModeChoice( PlayerNumber pn, ModeChoice* pModeChoiceOut );
|
||||
virtual void UpdateSelectableChoices();
|
||||
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
protected:
|
||||
float GetCursorX( PlayerNumber pn );
|
||||
float GetCursorY( PlayerNumber pn );
|
||||
void ChangeWithinPage( PlayerNumber pn, int iNewChoice, bool bChangingPages );
|
||||
void ChangePage( Page newPage );
|
||||
|
||||
ActorFrame m_framePages; // to hold the 2 pages
|
||||
|
||||
Sprite m_sprHeader[NUM_PAGES][MAX_CHOICES_PER_PAGE];
|
||||
Sprite m_sprPicture[NUM_PAGES][MAX_CHOICES_PER_PAGE];
|
||||
Sprite m_sprExplanation[NUM_PAGES];
|
||||
Sprite m_sprMore[NUM_PAGES];
|
||||
|
||||
Sprite m_sprCursor[NUM_PLAYERS];
|
||||
Sprite m_sprShadow[NUM_PLAYERS];
|
||||
Sprite m_sprOK[NUM_PLAYERS];
|
||||
|
||||
RageSound m_soundChange;
|
||||
RageSound m_soundSelect;
|
||||
RandomSample m_soundDifficult;
|
||||
|
||||
vector<ModeChoice> m_ModeChoices[NUM_PAGES];
|
||||
|
||||
Page m_CurrentPage;
|
||||
int m_iChoiceOnPage[NUM_PLAYERS];
|
||||
bool m_bChosen[NUM_PLAYERS];
|
||||
|
||||
float m_fLockInputTime;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -50,12 +50,12 @@ public:
|
||||
virtual void SetZoomX( float zoom ){ for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetZoomX(zoom); }
|
||||
virtual void SetZoomY( float zoom ){ for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetZoomY(zoom); }
|
||||
|
||||
virtual float GetRotation() { return m_sprites[0].GetRotation(); }
|
||||
virtual float GetRotationX() { return m_sprites[0].GetRotationX(); }
|
||||
virtual float GetRotationY() { return m_sprites[0].GetRotationY(); }
|
||||
virtual void SetRotation( float rot ) { for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetRotation(rot); }
|
||||
virtual float GetRotationZ() { return m_sprites[0].GetRotationZ(); }
|
||||
virtual void SetRotationX( float rot ) { for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetRotationX(rot); }
|
||||
virtual void SetRotationY( float rot ) { for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetRotationY(rot); }
|
||||
virtual void SetRotationZ( float rot ) { for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetRotationZ(rot); }
|
||||
|
||||
virtual void SetDiffuse( RageColor c ) { for(int i=0; i<NUM_BLUR_GHOSTS; i++) m_sprites[i].SetDiffuse(c); };
|
||||
virtual RageColor GetDiffuse() { return m_sprites[0].GetDiffuse(); };
|
||||
|
||||
@@ -1037,10 +1037,10 @@ void MusicWheel::TweenOnScreen(bool changing_sort)
|
||||
|
||||
if(changing_sort) {
|
||||
m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS_TO_DRAW/2 * factor ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE );
|
||||
} else {
|
||||
m_sprSelectionOverlay.BeginTweening( 0.05f * factor ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweening( 0.4f * factor, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprSelectionOverlay.BeginTweening( 0.4f * factor, Actor::TWEEN_ACCELERATE );
|
||||
}
|
||||
m_sprSelectionOverlay.SetTweenX( fX );
|
||||
|
||||
@@ -1049,7 +1049,7 @@ void MusicWheel::TweenOnScreen(bool changing_sort)
|
||||
m_ScrollBar.BeginTweening( 0.2f * factor ); // sleep
|
||||
else
|
||||
m_ScrollBar.BeginTweening( 0.7f * factor ); // sleep
|
||||
m_ScrollBar.BeginTweening( 0.2f * factor , Actor::TWEEN_BIAS_BEGIN );
|
||||
m_ScrollBar.BeginTweening( 0.2f * factor , Actor::TWEEN_ACCELERATE );
|
||||
m_ScrollBar.SetTweenX( SCROLL_BAR_X );
|
||||
|
||||
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
|
||||
@@ -1061,11 +1061,11 @@ void MusicWheel::TweenOnScreen(bool changing_sort)
|
||||
float fY = GetBannerY(fThisBannerPositionOffsetFromSelection);
|
||||
display.SetXY( fX+320, fY );
|
||||
display.BeginTweening( 0.04f*i * factor ); // sleep
|
||||
display.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_BEGIN );
|
||||
display.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE );
|
||||
display.SetTweenX( fX );
|
||||
}
|
||||
|
||||
m_fTimeLeftInState = TweenTime() + 0.100f;
|
||||
m_fTimeLeftInState = GetTweenTimeLeft() + 0.100f;
|
||||
}
|
||||
|
||||
void MusicWheel::TweenOffScreen(bool changing_sort)
|
||||
@@ -1084,15 +1084,15 @@ void MusicWheel::TweenOffScreen(bool changing_sort)
|
||||
/* When changing sort, tween the overlay with the item in the center;
|
||||
* having it separate looks messy when we're moving fast. */
|
||||
m_sprSelectionOverlay.BeginTweening( 0.04f * NUM_WHEEL_ITEMS_TO_DRAW/2 * factor ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_END );
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_DECELERATE );
|
||||
} else {
|
||||
m_sprSelectionOverlay.BeginTweening( 0 ); // sleep
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_END );
|
||||
m_sprSelectionOverlay.BeginTweening( 0.2f * factor, Actor::TWEEN_DECELERATE );
|
||||
}
|
||||
m_sprSelectionOverlay.SetTweenX( fX+320 );
|
||||
|
||||
m_ScrollBar.BeginTweening( 0 );
|
||||
m_ScrollBar.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_ScrollBar.BeginTweening( 0.2f * factor, Actor::TWEEN_ACCELERATE );
|
||||
m_ScrollBar.SetTweenX( SCROLL_BAR_X+30 );
|
||||
|
||||
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
|
||||
@@ -1104,11 +1104,11 @@ void MusicWheel::TweenOffScreen(bool changing_sort)
|
||||
float fY = GetBannerY(fThisBannerPositionOffsetFromSelection);
|
||||
display.SetXY( fX, fY );
|
||||
display.BeginTweening( 0.04f*i * factor ); // sleep
|
||||
display.BeginTweening( 0.2f * factor, Actor::TWEEN_BIAS_END );
|
||||
display.BeginTweening( 0.2f * factor, Actor::TWEEN_DECELERATE );
|
||||
display.SetTweenX( fX+320 );
|
||||
}
|
||||
|
||||
m_fTimeLeftInState = TweenTime() + 0.100f;
|
||||
m_fTimeLeftInState = GetTweenTimeLeft() + 0.100f;
|
||||
}
|
||||
|
||||
CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOrder so )
|
||||
|
||||
@@ -69,14 +69,14 @@ WheelItemDisplay::WheelItemDisplay()
|
||||
m_sprSectionBar.SetXY( 0, 0 );
|
||||
|
||||
m_textSectionName.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel section") );
|
||||
m_textSectionName.TurnShadowOff();
|
||||
m_textSectionName.EnableShadow( false );
|
||||
m_textSectionName.SetVertAlign( align_middle );
|
||||
m_textSectionName.SetXY( SECTION_NAME_X, 0 );
|
||||
m_textSectionName.SetZoom( SECTION_ZOOM );
|
||||
|
||||
|
||||
m_textRoulette.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel roulette") );
|
||||
m_textRoulette.TurnShadowOff();
|
||||
m_textRoulette.EnableShadow( false );
|
||||
m_textRoulette.TurnRainbowOn();
|
||||
m_textRoulette.SetZoom( ROULETTE_ZOOM );
|
||||
m_textRoulette.SetXY( ROULETTE_X, 0 );
|
||||
@@ -88,7 +88,7 @@ WheelItemDisplay::WheelItemDisplay()
|
||||
}
|
||||
|
||||
m_textCourse.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel course") );
|
||||
m_textCourse.TurnShadowOff();
|
||||
m_textCourse.EnableShadow( false );
|
||||
m_textCourse.SetZoom( COURSE_ZOOM );
|
||||
m_textCourse.SetHorizAlign( align_left );
|
||||
m_textCourse.SetXY( COURSE_X, 0 );
|
||||
|
||||
@@ -665,7 +665,7 @@ void NoteDisplay::DrawTap( const int iCol, const float fBeat, const bool bOnSame
|
||||
{
|
||||
// draw tap
|
||||
pSprite = GetTapNoteSprite( fBeat );
|
||||
pSprite->SetRotation( fRotation );
|
||||
pSprite->SetRotationZ( fRotation );
|
||||
}
|
||||
|
||||
pSprite->SetXY( fXPos, fYPos );
|
||||
|
||||
@@ -35,7 +35,7 @@ NoteField::NoteField()
|
||||
m_textMeasureNumber.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textMeasureNumber.SetZoom( 1.0f );
|
||||
|
||||
m_rectMarkerBar.TurnShadowOff();
|
||||
m_rectMarkerBar.EnableShadow( false );
|
||||
m_rectMarkerBar.SetEffectDiffuseShift( 2, RageColor(1,1,1,0.5f), RageColor(0.5f,0.5f,0.5f,0.5f) );
|
||||
|
||||
m_sprBars.Load( THEME->GetPathTo("Graphics","edit bars") );
|
||||
|
||||
@@ -30,7 +30,7 @@ OptionIcon::OptionIcon()
|
||||
this->AddChild( &m_spr );
|
||||
|
||||
m_text.LoadFromFont( THEME->GetPathTo("Fonts","option icons") );
|
||||
m_text.TurnShadowOff();
|
||||
m_text.EnableShadow( false );
|
||||
m_text.SetZoom( TEXT_ZOOM );
|
||||
m_text.SetXY( TEXT_OFFSET_X, TEXT_OFFSET_Y );
|
||||
m_text.SetHorizAlign( (Actor::HorizAlign)TEXT_H_ALIGN );
|
||||
|
||||
@@ -29,7 +29,7 @@ ScoreDisplayNormal::ScoreDisplayNormal()
|
||||
|
||||
// init the text
|
||||
m_text.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay score numbers") );
|
||||
m_text.TurnShadowOff();
|
||||
m_text.EnableShadow( false );
|
||||
|
||||
m_fScore = 0;
|
||||
m_fTrailingScore = 0;
|
||||
|
||||
@@ -25,7 +25,7 @@ ScoreDisplayOni::ScoreDisplayOni()
|
||||
|
||||
// init the text
|
||||
m_text.LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay score numbers") );
|
||||
m_text.TurnShadowOff();
|
||||
m_text.EnableShadow( false );
|
||||
this->AddChild( &m_text );
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ ScreenDemonstration::ScreenDemonstration() : ScreenGameplay(SetUpSongOptions())
|
||||
|
||||
m_sprDemonstrationBlink.Load( THEME->GetPathTo("Graphics","demonstration blink") );
|
||||
m_sprDemonstrationBlink.SetXY( CENTER_X, CENTER_Y );
|
||||
m_sprDemonstrationBlink.SetEffectDiffuseBlinking();
|
||||
m_sprDemonstrationBlink.SetEffectDiffuseBlink();
|
||||
this->AddChild( &m_sprDemonstrationBlink );
|
||||
|
||||
this->MoveToTail( &m_Fade );
|
||||
|
||||
@@ -167,7 +167,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
this->AddChild( &m_BannerWithFrame[0] );
|
||||
|
||||
m_textStage.LoadFromFont( THEME->GetPathTo("Fonts","evaluation stage") );
|
||||
m_textStage.TurnShadowOff();
|
||||
m_textStage.EnableShadow( false );
|
||||
m_textStage.SetXY( STAGE_X, STAGE_Y );
|
||||
m_textStage.SetZoom( 0.5f );
|
||||
m_textStage.SetText( GAMESTATE->GetStageText() + " Stage" );
|
||||
@@ -328,7 +328,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
this->AddChild( &m_sprPercentFrame[p] );
|
||||
|
||||
m_textOniPercentLarge[p].LoadFromNumbers( THEME->GetPathTo("Numbers","evaluation percent numbers") );
|
||||
m_textOniPercentLarge[p].TurnShadowOff();
|
||||
m_textOniPercentLarge[p].EnableShadow( false );
|
||||
m_textOniPercentLarge[p].SetXY( (PREFSMAN->m_bDancePointsForOni ? DANCE_POINT_X(p) : PERCENT_BASE_X(p) ), PERCENT_BASE_Y );
|
||||
m_textOniPercentLarge[p].SetHorizAlign( Actor::align_right );
|
||||
m_textOniPercentLarge[p].SetVertAlign( Actor::align_bottom );
|
||||
@@ -338,7 +338,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
if(!PREFSMAN->m_bDancePointsForOni)
|
||||
{
|
||||
m_textOniPercentSmall[p].LoadFromNumbers( THEME->GetPathTo("Numbers","evaluation percent numbers") );
|
||||
m_textOniPercentSmall[p].TurnShadowOff();
|
||||
m_textOniPercentSmall[p].EnableShadow( false );
|
||||
m_textOniPercentSmall[p].SetZoom( 0.5f );
|
||||
m_textOniPercentSmall[p].SetXY( PERCENT_BASE_X(p), PERCENT_BASE_Y );
|
||||
m_textOniPercentSmall[p].SetHorizAlign( Actor::align_left );
|
||||
@@ -375,7 +375,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
this->AddChild( &m_sprCourseFrame[p] );
|
||||
|
||||
m_textSongsSurvived[p].LoadFromNumbers( THEME->GetPathTo("Numbers","evaluation stage numbers") );
|
||||
m_textSongsSurvived[p].TurnShadowOff();
|
||||
m_textSongsSurvived[p].EnableShadow( false );
|
||||
m_textSongsSurvived[p].SetXY( SONGS_SURVIVED_X(p), SONGS_SURVIVED_Y );
|
||||
m_textSongsSurvived[p].SetText( ssprintf("%02d", stageStats.iSongsPlayed[p]) );
|
||||
this->AddChild( &m_textSongsSurvived[p] );
|
||||
@@ -416,7 +416,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_sprPossibleBar[p][r].SetHorizAlign( Actor::align_left );
|
||||
m_sprPossibleBar[p][r].SetX( BAR_BASE_X(p) );
|
||||
m_sprPossibleBar[p][r].SetY( BAR_START_Y + BAR_SPACING_Y*r );
|
||||
m_sprPossibleBar[p][r].SetRotation( BAR_ROTATION(p) );
|
||||
m_sprPossibleBar[p][r].SetRotationZ( BAR_ROTATION(p) );
|
||||
m_sprPossibleBar[p][r].SetZoomX( 0 );
|
||||
m_sprPossibleBar[p][r].ZoomToHeight( BAR_HEIGHT );
|
||||
m_sprPossibleBar[p][r].BeginTweening( 0.2f + r*0.1f ); // sleep
|
||||
@@ -430,7 +430,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
m_sprActualBar[p][r].SetHorizAlign( Actor::align_left );
|
||||
m_sprActualBar[p][r].SetX( BAR_BASE_X(p) );
|
||||
m_sprActualBar[p][r].SetY( BAR_START_Y + BAR_SPACING_Y*r );
|
||||
m_sprActualBar[p][r].SetRotation( BAR_ROTATION(p) );
|
||||
m_sprActualBar[p][r].SetRotationZ( BAR_ROTATION(p) );
|
||||
m_sprActualBar[p][r].SetZoomX( 0 );
|
||||
m_sprActualBar[p][r].ZoomToHeight( BAR_HEIGHT );
|
||||
m_sprActualBar[p][r].BeginTweening( 1.0f + r*0.2f ); // sleep
|
||||
@@ -486,7 +486,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary )
|
||||
for( l=0; l<NUM_JUDGE_LINES; l++ )
|
||||
{
|
||||
m_textJudgeNumbers[l][p].LoadFromNumbers( THEME->GetPathTo("Numbers","evaluation judge numbers") );
|
||||
m_textJudgeNumbers[l][p].TurnShadowOff();
|
||||
m_textJudgeNumbers[l][p].EnableShadow( false );
|
||||
m_textJudgeNumbers[l][p].SetXY( JUDGE_X(m_ResultMode==RM_COURSE,p,l), JUDGE_Y(l) );
|
||||
m_textJudgeNumbers[l][p].SetZoom( 1.0f );
|
||||
m_textJudgeNumbers[l][p].SetDiffuse( PlayerToColor(p) );
|
||||
@@ -577,12 +577,12 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalY = m_BannerWithFrame[i].GetY();
|
||||
m_BannerWithFrame[i].SetY( fOriginalY + SCREEN_HEIGHT );
|
||||
m_BannerWithFrame[i].BeginTweening( 0.0f );
|
||||
m_BannerWithFrame[i].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_BannerWithFrame[i].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_BannerWithFrame[i].SetTweenY( fOriginalY );
|
||||
}
|
||||
|
||||
fOriginalY = m_textStage.GetY();
|
||||
m_textStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_textStage.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_textStage.SetTweenY( fOriginalY );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -593,7 +593,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalY = m_sprJudgeLabels[i].GetY();
|
||||
m_sprJudgeLabels[i].SetY( fOriginalY + SCREEN_HEIGHT );
|
||||
m_sprJudgeLabels[i].BeginTweening( 0.2f + 0.1f*i );
|
||||
m_sprJudgeLabels[i].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprJudgeLabels[i].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_sprJudgeLabels[i].SetTweenY( fOriginalY );
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -601,7 +601,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalX = m_textJudgeNumbers[i][p].GetX();
|
||||
m_textJudgeNumbers[i][p].SetX( fOriginalX + SCREEN_WIDTH/2*(p==PLAYER_1 ? 1 : -1) );
|
||||
m_textJudgeNumbers[i][p].BeginTweening( 0.2f + 0.1f*i );
|
||||
m_textJudgeNumbers[i][p].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_textJudgeNumbers[i][p].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_textJudgeNumbers[i][p].SetTweenX( fOriginalX );
|
||||
}
|
||||
}
|
||||
@@ -611,7 +611,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalY = m_sprScoreLabel.GetY();
|
||||
m_sprScoreLabel.SetY( fOriginalY + SCREEN_HEIGHT );
|
||||
m_sprScoreLabel.BeginTweening( 0.8f + 0.1f*i );
|
||||
m_sprScoreLabel.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprScoreLabel.BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_sprScoreLabel.SetTweenY( fOriginalY );
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -619,7 +619,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalX = m_ScoreDisplay[p].GetX();
|
||||
m_ScoreDisplay[p].SetX( fOriginalX + SCREEN_WIDTH/2*(p==PLAYER_1 ? 1 : -1) );
|
||||
m_ScoreDisplay[p].BeginTweening( 0.8f + 0.1f*i );
|
||||
m_ScoreDisplay[p].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_ScoreDisplay[p].BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
m_ScoreDisplay[p].SetTweenX( fOriginalX );
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ void ScreenEvaluation::TweenOnScreen()
|
||||
fOriginalX = apActorsInBonusOrStageInfo[i]->GetX();
|
||||
apActorsInBonusOrStageInfo[i]->SetX( fOriginalX + SCREEN_WIDTH/2*(p==PLAYER_1 ? 1 : -1) );
|
||||
apActorsInBonusOrStageInfo[i]->BeginTweening( 0.2f );
|
||||
apActorsInBonusOrStageInfo[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_BIAS_BEGIN );
|
||||
apActorsInBonusOrStageInfo[i]->BeginTweening( MENU_ELEMENTS_TWEEN_TIME, Actor::TWEEN_ACCELERATE );
|
||||
apActorsInBonusOrStageInfo[i]->SetTweenX( fOriginalX );
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
|
||||
m_sprJoinMessage[p].SetState( p );
|
||||
m_sprJoinMessage[p].SetXY( JOIN_MESSAGE_X(p), JOIN_MESSAGE_Y(p) );
|
||||
if( BOUNCE_JOIN_MESSAGE )
|
||||
m_sprJoinMessage[p].SetEffectBouncing( RageVector3(0,10,0), 0.5f );
|
||||
m_sprJoinMessage[p].SetEffectBounce( 0.5f, RageVector3(0,10,0) );
|
||||
this->AddChild( &m_sprJoinMessage[p] );
|
||||
|
||||
if( GAMESTATE->m_bSideIsJoined[p] )
|
||||
@@ -275,9 +275,9 @@ void ScreenEz2SelectPlayer::TweenOffScreen()
|
||||
{
|
||||
float fOffScreenOffset = float( (p==PLAYER_1) ? -SCREEN_WIDTH : +SCREEN_WIDTH );
|
||||
|
||||
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_BIAS_END );
|
||||
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
||||
m_sprJoinMessage[p].SetTweenX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
||||
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_BIAS_END );
|
||||
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
||||
m_sprJoinFrame[p].SetTweenX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
|
||||
|
||||
m_textStageNumber.LoadFromFont( THEME->GetPathTo("Fonts","gameplay stage") );
|
||||
m_textStageNumber.TurnShadowOff();
|
||||
m_textStageNumber.EnableShadow( false );
|
||||
m_textStageNumber.SetXY( STAGE_X, STAGE_Y(bExtra) );
|
||||
m_textStageNumber.SetText( GAMESTATE->GetStageText() );
|
||||
m_textStageNumber.SetDiffuse( GAMESTATE->GetStageColor() );
|
||||
@@ -273,7 +273,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_textCourseSongNumber[p].LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textCourseSongNumber[p].TurnShadowOff();
|
||||
m_textCourseSongNumber[p].EnableShadow( false );
|
||||
m_textCourseSongNumber[p].SetXY( SONG_NUMBER_X(p), SONG_NUMBER_Y(p,bExtra) );
|
||||
m_textCourseSongNumber[p].SetText( "" );
|
||||
m_textCourseSongNumber[p].SetDiffuse( GAMESTATE->GetStageColor() ); // light blue
|
||||
@@ -312,7 +312,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
this->AddChild( &m_sprScoreFrame );
|
||||
|
||||
m_StageName.LoadFromFont( THEME->GetPathTo("Fonts","musicwheel text banner") );
|
||||
m_StageName.TurnShadowOff();
|
||||
m_StageName.EnableShadow( false );
|
||||
m_StageName.SetXY( STAGENAME_X, STAGENAME_Y );
|
||||
m_StageName.SetZoom( STAGENAME_ZOOM );
|
||||
this->AddChild( &m_StageName );
|
||||
@@ -351,7 +351,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
this->AddChild( m_pScoreDisplay[p] );
|
||||
|
||||
m_textPlayerOptions[p].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textPlayerOptions[p].TurnShadowOff();
|
||||
m_textPlayerOptions[p].EnableShadow( false );
|
||||
m_textPlayerOptions[p].SetXY( PLAYER_OPTIONS_X(p), PLAYER_OPTIONS_Y(p,bExtra) );
|
||||
m_textPlayerOptions[p].SetZoom( 0.5f );
|
||||
m_textPlayerOptions[p].SetDiffuse( RageColor(1,1,1,1) );
|
||||
@@ -359,7 +359,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
}
|
||||
|
||||
m_textSongOptions.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textSongOptions.TurnShadowOff();
|
||||
m_textSongOptions.EnableShadow( false );
|
||||
m_textSongOptions.SetXY( SONG_OPTIONS_X, SONG_OPTIONS_Y(bExtra) );
|
||||
m_textSongOptions.SetZoom( 0.5f );
|
||||
m_textSongOptions.SetDiffuse( RageColor(1,1,1,1) );
|
||||
@@ -430,7 +430,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
||||
this->AddChild( &m_Fade );
|
||||
|
||||
m_textSurviveTime.LoadFromFont( THEME->GetPathTo("Fonts","survive time") );
|
||||
m_textSurviveTime.TurnShadowOff();
|
||||
m_textSurviveTime.EnableShadow( false );
|
||||
m_textSurviveTime.SetXY( SURVIVE_TIME_X, SURVIVE_TIME_Y );
|
||||
m_textSurviveTime.SetText( "" );
|
||||
m_textSurviveTime.SetDiffuse( RageColor(1,1,1,0) );
|
||||
@@ -1357,10 +1357,10 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_sprToasty.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprToasty.SetX( SCREEN_RIGHT+m_sprToasty.GetUnzoomedWidth()/2 );
|
||||
m_sprToasty.SetY( SCREEN_BOTTOM-m_sprToasty.GetUnzoomedHeight()/2 );
|
||||
m_sprToasty.BeginTweening( 0.2f, Actor::TWEEN_BIAS_BEGIN ); // slide on
|
||||
m_sprToasty.BeginTweening( 0.2f, Actor::TWEEN_ACCELERATE ); // slide on
|
||||
m_sprToasty.SetTweenX( SCREEN_RIGHT-m_sprToasty.GetUnzoomedWidth()/2 );
|
||||
m_sprToasty.BeginTweening( 0.6f ); // sleep
|
||||
m_sprToasty.BeginTweening( 0.3f, Actor::TWEEN_BIAS_END ); // slide off
|
||||
m_sprToasty.BeginTweening( 0.3f, Actor::TWEEN_DECELERATE ); // slide off
|
||||
m_sprToasty.SetTweenX( SCREEN_RIGHT+m_sprToasty.GetUnzoomedWidth()/2 );
|
||||
m_sprToasty.BeginTweening( 0.001f ); // fade out
|
||||
m_sprToasty.SetDiffuse( RageColor(1,1,1,0) );
|
||||
@@ -1468,7 +1468,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
colorStage.a *= 0.7f;
|
||||
|
||||
m_sprTryExtraStage.SetZoom( 4 );
|
||||
m_sprTryExtraStage.BeginBlurredTweening( 0.8f, TWEEN_BIAS_END );
|
||||
m_sprTryExtraStage.BeginBlurredTweening( 0.8f, TWEEN_DECELERATE );
|
||||
m_sprTryExtraStage.SetTweenZoom( 0.4f ); // zoom out
|
||||
m_sprTryExtraStage.SetTweenDiffuse( colorStage ); // and fade in
|
||||
m_sprTryExtraStage.BeginTweening( 0.2f );
|
||||
@@ -1549,7 +1549,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_Background.SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
|
||||
m_sprFailed.SetZoom( 4 );
|
||||
m_sprFailed.BeginBlurredTweening( 0.8f, TWEEN_BIAS_END );
|
||||
m_sprFailed.BeginBlurredTweening( 0.8f, TWEEN_DECELERATE );
|
||||
m_sprFailed.SetTweenZoom( 0.5f ); // zoom out
|
||||
m_sprFailed.SetTweenDiffuse( RageColor(1,1,1,0.7f) ); // and fade in
|
||||
m_sprFailed.BeginTweening( 0.3f );
|
||||
@@ -1671,5 +1671,5 @@ void ScreenGameplay::ShowOniGameOver( PlayerNumber pn )
|
||||
m_sprOniGameOver[pn].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprOniGameOver[pn].BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
|
||||
m_sprOniGameOver[pn].SetTweenY( CENTER_Y );
|
||||
m_sprOniGameOver[pn].SetEffectBobbing( RageVector3(0,6,0), 4 );
|
||||
m_sprOniGameOver[pn].SetEffectBob( 4, RageVector3(0,6,0) );
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ ScreenInstructions::ScreenInstructions()
|
||||
|
||||
m_sprHowToPlay.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
||||
m_sprHowToPlay.BeginTweening( 0.4f ); // sleep
|
||||
m_sprHowToPlay.BeginTweening( 0.6f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprHowToPlay.BeginTweening( 0.6f, Actor::TWEEN_ACCELERATE );
|
||||
m_sprHowToPlay.SetTweenX( CENTER_X );
|
||||
|
||||
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","instructions music") );
|
||||
@@ -176,6 +176,6 @@ void ScreenInstructions::MenuStart( PlayerNumber pn )
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen );
|
||||
|
||||
m_sprHowToPlay.StopTweening();
|
||||
m_sprHowToPlay.BeginTweening( 0.3f, Actor::TWEEN_BIAS_END );
|
||||
m_sprHowToPlay.BeginTweening( 0.3f, Actor::TWEEN_DECELERATE );
|
||||
m_sprHowToPlay.SetTweenX( SCREEN_RIGHT+m_sprHowToPlay.GetUnzoomedWidth()/2 );
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
||||
this->AddChild( &m_Wipe );
|
||||
|
||||
m_framePage.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_DECELERATE );
|
||||
m_framePage.SetTweenX( 0 );
|
||||
memset(&m_OptionDim, 0, sizeof(m_OptionDim));
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void ScreenOptions::InitOptionsText()
|
||||
title.SetZoom( LABELS_ZOOM );
|
||||
title.SetHorizAlign( (Actor::HorizAlign)LABELS_H_ALIGN );
|
||||
title.SetVertAlign( Actor::align_middle );
|
||||
title.TurnShadowOff();
|
||||
title.EnableShadow( false );
|
||||
|
||||
|
||||
Sprite &arrow = m_sprLineArrows[i];
|
||||
@@ -428,7 +428,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_SoundStart.Play();
|
||||
m_Wipe.CloseWipingRight( SM_GoToNextScreen );
|
||||
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_END );
|
||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_DECELERATE );
|
||||
m_framePage.SetTweenX( SCREEN_RIGHT );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68);
|
||||
ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking","ranking")
|
||||
{
|
||||
m_textCategory.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textCategory.TurnShadowOff();
|
||||
m_textCategory.EnableShadow( false );
|
||||
m_textCategory.SetXY( CATEGORY_X, CATEGORY_Y );
|
||||
this->AddChild( &m_textCategory );
|
||||
|
||||
m_textType.LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
m_textType.TurnShadowOff();
|
||||
m_textType.EnableShadow( false );
|
||||
m_textType.SetXY( TYPE_X, TYPE_Y );
|
||||
this->AddChild( &m_textType );
|
||||
|
||||
@@ -67,28 +67,28 @@ ScreenRanking::ScreenRanking() : ScreenAttract("ScreenRanking","ranking")
|
||||
this->AddChild( &m_sprBullets[i] );
|
||||
|
||||
m_textNames[i].LoadFromFont( THEME->GetPathTo("Fonts","ranking") );
|
||||
m_textNames[i].TurnShadowOff();
|
||||
m_textNames[i].EnableShadow( false );
|
||||
m_textNames[i].SetXY( NAMES_START_X+LINE_SPACING_X*i, NAMES_START_Y+LINE_SPACING_Y*i );
|
||||
m_textNames[i].SetZoom( TEXT_ZOOM );
|
||||
m_textNames[i].SetHorizAlign( Actor::align_left );
|
||||
this->AddChild( &m_textNames[i] );
|
||||
|
||||
m_textScores[i].LoadFromFont( THEME->GetPathTo("Fonts","ranking") );
|
||||
m_textScores[i].TurnShadowOff();
|
||||
m_textScores[i].EnableShadow( false );
|
||||
m_textScores[i].SetXY( SCORES_START_X+LINE_SPACING_X*i, SCORES_START_Y+LINE_SPACING_Y*i );
|
||||
m_textScores[i].SetZoom( TEXT_ZOOM );
|
||||
m_textScores[i].SetHorizAlign( Actor::align_right );
|
||||
this->AddChild( &m_textScores[i] );
|
||||
|
||||
m_textPoints[i].LoadFromFont( THEME->GetPathTo("Fonts","ranking") );
|
||||
m_textPoints[i].TurnShadowOff();
|
||||
m_textPoints[i].EnableShadow( false );
|
||||
m_textPoints[i].SetXY( POINTS_START_X+LINE_SPACING_X*i, POINTS_START_Y+LINE_SPACING_Y*i );
|
||||
m_textPoints[i].SetZoom( TEXT_ZOOM );
|
||||
m_textPoints[i].SetHorizAlign( Actor::align_right );
|
||||
this->AddChild( &m_textPoints[i] );
|
||||
|
||||
m_textTime[i].LoadFromFont( THEME->GetPathTo("Fonts","ranking") );
|
||||
m_textTime[i].TurnShadowOff();
|
||||
m_textTime[i].EnableShadow( false );
|
||||
m_textTime[i].SetXY( TIME_START_X+LINE_SPACING_X*i, TIME_START_Y+LINE_SPACING_Y*i );
|
||||
m_textTime[i].SetZoom( TEXT_ZOOM );
|
||||
m_textTime[i].SetHorizAlign( Actor::align_right );
|
||||
@@ -218,8 +218,8 @@ void ScreenRanking::SetPage( PageToShow pts )
|
||||
|
||||
if( bRecentHighScore )
|
||||
{
|
||||
m_textNames[l].SetEffectGlowBlinking(0.1f);
|
||||
m_textScores[l].SetEffectGlowBlinking(0.1f);
|
||||
m_textNames[l].SetEffectGlowBlink(0.1f);
|
||||
m_textScores[l].SetEffectGlowBlink(0.1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -254,8 +254,8 @@ void ScreenRanking::SetPage( PageToShow pts )
|
||||
pts.nt == GAMESTATE->m_RankingNotesType &&
|
||||
GAMESTATE->m_iRankingIndex[p] == l )
|
||||
{
|
||||
m_textNames[l].SetEffectGlowBlinking(0.1f);
|
||||
m_textScores[l].SetEffectGlowBlinking(0.1f);
|
||||
m_textNames[l].SetEffectGlowBlink(0.1f);
|
||||
m_textScores[l].SetEffectGlowBlink(0.1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -87,12 +87,12 @@ ScreenSelectCourse::ScreenSelectCourse()
|
||||
|
||||
m_textNumSongs.LoadFromFont( THEME->GetPathTo("Fonts","select course num songs") );
|
||||
m_textNumSongs.SetXY( STAGES_X, STAGES_Y );
|
||||
m_textNumSongs.TurnShadowOff();
|
||||
m_textNumSongs.EnableShadow( false );
|
||||
this->AddChild( &m_textNumSongs );
|
||||
|
||||
m_textTime.LoadFromFont( THEME->GetPathTo("Fonts","select course total time") );
|
||||
m_textTime.SetXY( TIME_X, TIME_Y );
|
||||
m_textTime.TurnShadowOff();
|
||||
m_textTime.EnableShadow( false );
|
||||
this->AddChild( &m_textTime );
|
||||
|
||||
m_CourseContentsFrame.SetXY( CONTENTS_X, CONTENTS_Y );
|
||||
|
||||
@@ -20,22 +20,11 @@
|
||||
#include "GameState.h"
|
||||
#include "RageSoundManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ModeSelector.h"
|
||||
|
||||
|
||||
const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete
|
||||
|
||||
#define MORE_X( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dX",page+1))
|
||||
#define MORE_Y( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("MorePage%dY",page+1))
|
||||
#define EXPLANATION_X( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dX",page+1))
|
||||
#define EXPLANATION_Y( page ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("ExplanationPage%dY",page+1))
|
||||
#define CHOICES_ON_PAGE( page ) THEME->GetMetric ("ScreenSelectDifficulty",ssprintf("ChoicesOnPage%d",page+1))
|
||||
#define CHOICE_X( page, choice ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("Page%dChoice%dX",page+1,choice+1))
|
||||
#define CHOICE_Y( page, choice ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("Page%dChoice%dY",page+1,choice+1))
|
||||
#define CURSOR_OFFSET_X( p ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("CursorOffsetP%dX",p+1))
|
||||
#define CURSOR_OFFSET_Y( i ) THEME->GetMetricF("ScreenSelectDifficulty",ssprintf("CursorOffsetP%dY",i+1))
|
||||
#define CURSOR_SHADOW_LENGTH_X THEME->GetMetricF("ScreenSelectDifficulty","CursorShadowLengthX")
|
||||
#define CURSOR_SHADOW_LENGTH_Y THEME->GetMetricF("ScreenSelectDifficulty","CursorShadowLengthY")
|
||||
#define INITIAL_CHOICE THEME->GetMetricI("ScreenSelectDifficulty","InitialChoice")
|
||||
#define CHOICES THEME->GetMetric ("ScreenSelectDifficulty","Choices")
|
||||
#define SELECTOR THEME->GetMetric ("ScreenSelectDifficulty","Selector")
|
||||
#define HELP_TEXT THEME->GetMetric("ScreenSelectDifficulty","HelpText")
|
||||
#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectDifficulty","TimerSeconds")
|
||||
#define NEXT_SCREEN_ARCADE THEME->GetMetric ("ScreenSelectDifficulty","NextScreenArcade")
|
||||
@@ -43,10 +32,6 @@ const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to
|
||||
#define NEXT_SCREEN_BATTLE THEME->GetMetric ("ScreenSelectDifficulty","NextScreenBattle")
|
||||
|
||||
|
||||
float CURSOR_X( int page, int choice, int p ) { return CHOICE_X(page,choice) + CURSOR_OFFSET_X(p); }
|
||||
float CURSOR_Y( int page, int choice, int p ) { return CHOICE_Y(page,choice) + CURSOR_OFFSET_Y(p); }
|
||||
|
||||
|
||||
const ScreenMessage SM_StartTweeningOffScreen = ScreenMessage(SM_User + 3);
|
||||
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 4);
|
||||
|
||||
@@ -58,6 +43,53 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
// Reset the current PlayMode
|
||||
GAMESTATE->m_PlayMode = PLAY_MODE_INVALID;
|
||||
|
||||
|
||||
|
||||
vector<ModeChoice> aModeChoices;
|
||||
|
||||
CStringArray asBits;
|
||||
split( CHOICES, ",", asBits );
|
||||
|
||||
unsigned choice;
|
||||
|
||||
for( choice=0; choice<asBits.size(); choice++ )
|
||||
{
|
||||
Difficulty dc = StringToDifficulty(asBits[choice]);
|
||||
PlayMode pm = StringToPlayMode(asBits[choice]);
|
||||
|
||||
if( dc!=DIFFICULTY_INVALID ) // valid difficulty
|
||||
{
|
||||
ModeChoice mc = {
|
||||
GAMESTATE->m_CurGame,
|
||||
PLAY_MODE_ARCADE,
|
||||
GAMESTATE->m_CurStyle,
|
||||
dc,
|
||||
"",
|
||||
GAMESTATE->GetNumSidesJoined() };
|
||||
strcpy( mc.name, DifficultyToString(dc) );
|
||||
aModeChoices.push_back( mc );
|
||||
}
|
||||
else if( pm!=PLAY_MODE_INVALID ) // valid play mode
|
||||
{
|
||||
ModeChoice mc = {
|
||||
GAMESTATE->m_CurGame,
|
||||
pm,
|
||||
GAMESTATE->m_CurStyle,
|
||||
DIFFICULTY_MEDIUM,
|
||||
"",
|
||||
GAMESTATE->GetNumSidesJoined() };
|
||||
strcpy( mc.name, PlayModeToString(pm) );
|
||||
aModeChoices.push_back( mc );
|
||||
}
|
||||
else
|
||||
RageException::Throw( "Invalid Choice%d value '%s'.", choice+1, asBits[choice].GetString() );
|
||||
}
|
||||
|
||||
|
||||
m_pSelector = ModeSelector::Create( SELECTOR );
|
||||
m_pSelector->Init( aModeChoices, "ScreenSelectDifficulty", "select difficulty" );
|
||||
this->AddChild( m_pSelector );
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("BGAnimations","select difficulty"),
|
||||
THEME->GetPathTo("Graphics","select difficulty top edge"),
|
||||
@@ -65,128 +97,13 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
// parse ModeChoices
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
{
|
||||
CStringArray asBits;
|
||||
split( CHOICES_ON_PAGE(page), ",", asBits );
|
||||
if( asBits.size() > MAX_CHOICES_PER_PAGE )
|
||||
RageException::Throw( "Choices exceed max number of choices per page." );
|
||||
|
||||
unsigned choice;
|
||||
|
||||
for( choice=0; choice<asBits.size(); choice++ )
|
||||
{
|
||||
Difficulty dc = StringToDifficulty(asBits[choice]);
|
||||
PlayMode pm = StringToPlayMode(asBits[choice]);
|
||||
|
||||
if( dc!=DIFFICULTY_INVALID ) // valid difficulty
|
||||
{
|
||||
ModeChoice mc = {
|
||||
GAMESTATE->m_CurGame,
|
||||
PLAY_MODE_ARCADE,
|
||||
GAMESTATE->m_CurStyle,
|
||||
dc,
|
||||
"",
|
||||
GAMESTATE->GetNumSidesJoined() };
|
||||
strcpy( mc.name, DifficultyToString(dc) );
|
||||
m_ModeChoices[page].push_back( mc );
|
||||
}
|
||||
else if( pm!=PLAY_MODE_INVALID ) // valid play mode
|
||||
{
|
||||
ModeChoice mc = {
|
||||
GAMESTATE->m_CurGame,
|
||||
pm,
|
||||
GAMESTATE->m_CurStyle,
|
||||
DIFFICULTY_MEDIUM,
|
||||
"",
|
||||
GAMESTATE->GetNumSidesJoined() };
|
||||
strcpy( mc.name, PlayModeToString(pm) );
|
||||
m_ModeChoices[page].push_back( mc );
|
||||
}
|
||||
else
|
||||
RageException::Throw( "Invalid Page%dChoice%d value '%s'.", page+1, choice+1, asBits[choice].GetString() );
|
||||
}
|
||||
|
||||
|
||||
for( choice=0; choice<m_ModeChoices[page].size(); choice++ )
|
||||
{
|
||||
CString sHeaderFile = ssprintf( "select difficulty header %s", m_ModeChoices[page][choice].name );
|
||||
CString sPictureFile = ssprintf( "select difficulty picture %s", m_ModeChoices[page][choice].name );
|
||||
|
||||
float fChoiceX = CHOICE_X(page,choice);
|
||||
float fChoiceY = CHOICE_Y(page,choice);
|
||||
|
||||
m_sprPicture[page][choice].Load( THEME->GetPathTo("Graphics",sPictureFile) );
|
||||
m_sprPicture[page][choice].SetXY( fChoiceX, fChoiceY );
|
||||
m_sprPicture[page][choice].SetVertAlign( align_top );
|
||||
m_framePages.AddChild( &m_sprPicture[page][choice] );
|
||||
|
||||
m_sprHeader[page][choice].Load( THEME->GetPathTo("Graphics",sHeaderFile) );
|
||||
m_sprHeader[page][choice].SetXY( fChoiceX, fChoiceY );
|
||||
m_sprHeader[page][choice].SetVertAlign( align_bottom );
|
||||
m_framePages.AddChild( &m_sprHeader[page][choice] );
|
||||
}
|
||||
|
||||
|
||||
m_sprMoreArrows[page].Load( THEME->GetPathTo("Graphics", ssprintf("select difficulty more page%d",page+1) ) );
|
||||
m_sprMoreArrows[page].SetXY( MORE_X(page), MORE_Y(page) );
|
||||
m_framePages.AddChild( &m_sprMoreArrows[page] );
|
||||
|
||||
m_sprExplanation[page].Load( THEME->GetPathTo("Graphics", "select difficulty explanation") );
|
||||
m_sprExplanation[page].SetXY( EXPLANATION_X(page), EXPLANATION_Y(page) );
|
||||
m_sprExplanation[page].StopAnimating();
|
||||
m_sprExplanation[page].SetState( page );
|
||||
m_framePages.AddChild( &m_sprExplanation[page] );
|
||||
}
|
||||
|
||||
|
||||
m_CurrentPage = PAGE_1;
|
||||
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
m_iChoiceOnPage[p] = (INITIAL_CHOICE-1);
|
||||
CLAMP( m_iChoiceOnPage[p], 0, (int)m_ModeChoices[0].size()-1 );
|
||||
m_bChosen[p] = false;
|
||||
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
m_sprJoinMessagehadow[p].Load( THEME->GetPathTo("Graphics", "select difficulty cursor 2x1") );
|
||||
m_sprJoinMessagehadow[p].StopAnimating();
|
||||
m_sprJoinMessagehadow[p].SetState( p );
|
||||
m_sprJoinMessagehadow[p].TurnShadowOff();
|
||||
m_sprJoinMessagehadow[p].SetDiffuse( RageColor(0,0,0,0.6f) );
|
||||
m_framePages.AddChild( &m_sprJoinMessagehadow[p] );
|
||||
|
||||
m_sprCursor[p].Load( THEME->GetPathTo("Graphics", "select difficulty cursor 2x1") );
|
||||
m_sprCursor[p].StopAnimating();
|
||||
m_sprCursor[p].SetState( p );
|
||||
m_sprCursor[p].TurnShadowOff();
|
||||
m_sprCursor[p].SetEffectGlowShift();
|
||||
m_framePages.AddChild( &m_sprCursor[p] );
|
||||
|
||||
m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ok 2x1") );
|
||||
m_sprOK[p].SetState( p );
|
||||
m_sprOK[p].StopAnimating();
|
||||
m_sprOK[p].SetDiffuse( RageColor(1,1,1,0) );
|
||||
m_framePages.AddChild( &m_sprOK[p] );
|
||||
}
|
||||
|
||||
this->AddChild( &m_framePages );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") );
|
||||
m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") );
|
||||
|
||||
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select difficulty intro") );
|
||||
|
||||
m_Menu.TweenOnScreenFromMenu( SM_None );
|
||||
TweenOnScreen();
|
||||
m_pSelector->TweenOnScreen();
|
||||
|
||||
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","select difficulty music") );
|
||||
|
||||
m_fLockInputTime = LOCK_INPUT_TIME;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,16 +121,12 @@ void ScreenSelectDifficulty::Input( const DeviceInput& DeviceI, const InputEvent
|
||||
if( m_Menu.IsClosing() )
|
||||
return;
|
||||
|
||||
if( m_fLockInputTime > 0 )
|
||||
return;
|
||||
|
||||
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::Update( float fDeltaTime )
|
||||
{
|
||||
Screen::Update( fDeltaTime );
|
||||
m_fLockInputTime = max( m_fLockInputTime-fDeltaTime, 0 );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::DrawPrimitives()
|
||||
@@ -234,19 +147,26 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
MenuStart( (PlayerNumber)p );
|
||||
break;
|
||||
case SM_BeginFadingOut: // sent by our ModeSelector
|
||||
{
|
||||
ModeChoice mc;
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
{
|
||||
m_pSelector->GetSelectedModeChoice( (PlayerNumber)p, &mc );
|
||||
GAMESTATE->ApplyModeChoice( &mc, (PlayerNumber)p );
|
||||
}
|
||||
|
||||
m_Menu.StopTimer();
|
||||
m_pSelector->TweenOffScreen();
|
||||
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen );
|
||||
}
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
const ModeChoice& mc = m_ModeChoices[m_CurrentPage][m_iChoiceOnPage[p]];
|
||||
GAMESTATE->m_PlayMode = mc.pm;
|
||||
GAMESTATE->m_PreferredDifficulty[p] = mc.dc;
|
||||
}
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ARCADE: SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); break;
|
||||
@@ -258,7 +178,7 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
break;
|
||||
case SM_StartTweeningOffScreen:
|
||||
TweenOffScreen();
|
||||
m_pSelector->TweenOffScreen();
|
||||
this->SendScreenMessage( SM_StartFadingOut, 0.8f );
|
||||
break;
|
||||
case SM_StartFadingOut:
|
||||
@@ -269,240 +189,32 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
void ScreenSelectDifficulty::MenuLeft( PlayerNumber pn )
|
||||
{
|
||||
if( m_bChosen[pn] )
|
||||
return;
|
||||
if( m_iChoiceOnPage[pn] == 0 ) // can't go left any more
|
||||
{
|
||||
if( m_CurrentPage > 0 )
|
||||
ChangePage( (Page)(m_CurrentPage-1) );
|
||||
}
|
||||
else
|
||||
ChangeWithinPage( pn, m_iChoiceOnPage[pn]-1, false );
|
||||
m_pSelector->MenuLeft( pn );
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectDifficulty::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
if( m_bChosen[pn] )
|
||||
return;
|
||||
if( m_iChoiceOnPage[pn] == (int)m_ModeChoices[m_CurrentPage].size()-1 ) // can't go left any more
|
||||
{
|
||||
if( m_CurrentPage < NUM_PAGES-1 )
|
||||
ChangePage( (Page)(m_CurrentPage+1) );
|
||||
}
|
||||
else
|
||||
ChangeWithinPage( pn, m_iChoiceOnPage[pn]+1, false );
|
||||
m_pSelector->MenuRight( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::ChangePage( Page newPage )
|
||||
void ScreenSelectDifficulty::MenuUp( PlayerNumber pn )
|
||||
{
|
||||
int p;
|
||||
|
||||
// If anyone has already chosen, don't allow changing of pages
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) && m_bChosen[p] )
|
||||
return;
|
||||
|
||||
bool bPageIncreasing = newPage > m_CurrentPage;
|
||||
m_CurrentPage = newPage;
|
||||
|
||||
if( newPage == PAGE_2 )
|
||||
{
|
||||
m_soundDifficult.Stop();
|
||||
m_soundDifficult.PlayRandom();
|
||||
}
|
||||
|
||||
// change both players
|
||||
int iNewChoice = bPageIncreasing ? 0 : m_ModeChoices[m_CurrentPage].size()-1;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
ChangeWithinPage( (PlayerNumber)p, iNewChoice, true );
|
||||
|
||||
// move frame with choices
|
||||
m_framePages.StopTweening();
|
||||
m_framePages.BeginTweening( 0.2f );
|
||||
m_framePages.SetTweenX( (float)newPage*-SCREEN_WIDTH );
|
||||
m_pSelector->MenuUp( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::ChangeWithinPage( PlayerNumber pn, int iNewChoice, bool bChangingPages )
|
||||
void ScreenSelectDifficulty::MenuDown( PlayerNumber pn )
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
continue; // skip
|
||||
|
||||
if( p!=pn && m_CurrentPage==PAGE_1 )
|
||||
continue; // skip
|
||||
|
||||
m_iChoiceOnPage[p] = iNewChoice;
|
||||
|
||||
float fCursorX = CURSOR_X(m_CurrentPage,m_iChoiceOnPage[p],p);
|
||||
float fCursorY = CURSOR_Y(m_CurrentPage,m_iChoiceOnPage[p],p);
|
||||
|
||||
m_sprCursor[p].StopTweening();
|
||||
m_sprCursor[p].BeginTweening( 0.2f, bChangingPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprCursor[p].SetTweenX( fCursorX - CURSOR_SHADOW_LENGTH_X );
|
||||
m_sprCursor[p].SetTweenY( fCursorY - CURSOR_SHADOW_LENGTH_Y );
|
||||
|
||||
m_sprJoinMessagehadow[p].StopTweening();
|
||||
m_sprJoinMessagehadow[p].BeginTweening( 0.2f, bChangingPages ? TWEEN_LINEAR : TWEEN_BIAS_BEGIN );
|
||||
m_sprJoinMessagehadow[p].SetTweenX( fCursorX );
|
||||
m_sprJoinMessagehadow[p].SetTweenY( fCursorY );
|
||||
}
|
||||
|
||||
m_soundChange.Play();
|
||||
m_pSelector->MenuDown( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
{
|
||||
if( m_bChosen[pn] == true )
|
||||
return;
|
||||
m_bChosen[pn] = true;
|
||||
|
||||
for( unsigned page=0; page<NUM_PAGES; page++ )
|
||||
m_sprMoreArrows[page].FadeOff( 0, "fade", 0.5f );
|
||||
|
||||
const ModeChoice& mc = m_ModeChoices[m_CurrentPage][m_iChoiceOnPage[pn]];
|
||||
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("select difficulty comment %s",mc.name)) );
|
||||
|
||||
/* XXX: This will play the same announcer twice at the same time; that'll probably
|
||||
* result in an echo effect. */
|
||||
if( m_CurrentPage == PAGE_2 )
|
||||
{
|
||||
// choose this for all the other players too
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( m_bChosen[p] )
|
||||
continue;
|
||||
|
||||
MenuStart( (PlayerNumber)p );
|
||||
}
|
||||
}
|
||||
|
||||
float fCursorX = CURSOR_X(m_CurrentPage,m_iChoiceOnPage[pn],pn);
|
||||
float fCursorY = CURSOR_Y(m_CurrentPage,m_iChoiceOnPage[pn],pn);
|
||||
|
||||
m_sprCursor[pn].BeginTweening( 0.2f );
|
||||
m_sprCursor[pn].BeginTweening( 0.2f );
|
||||
m_sprCursor[pn].SetTweenX( fCursorX );
|
||||
m_sprCursor[pn].SetTweenY( fCursorY );
|
||||
|
||||
m_sprOK[pn].SetX( fCursorX );
|
||||
m_sprOK[pn].SetY( fCursorY );
|
||||
m_sprOK[pn].SetDiffuse( RageColor(1,1,1,0) );
|
||||
m_sprOK[pn].SetZoom( 2 );
|
||||
|
||||
m_sprOK[pn].BeginTweening( 0.2f );
|
||||
m_sprOK[pn].SetTweenZoom( 1 );
|
||||
m_sprOK[pn].SetTweenDiffuse( RageColor(1,1,1,1) );
|
||||
|
||||
m_sprJoinMessagehadow[pn].BeginTweening( 0.2f );
|
||||
m_sprJoinMessagehadow[pn].BeginTweening( 0.2f );
|
||||
m_sprJoinMessagehadow[pn].SetDiffuse( RageColor(0,0,0,0) );
|
||||
|
||||
m_soundSelect.Play();
|
||||
|
||||
// check to see if everyone has chosen
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber)p) && m_bChosen[p] == false )
|
||||
return;
|
||||
}
|
||||
m_Menu.StopTimer();
|
||||
this->SendScreenMessage( SM_StartTweeningOffScreen, 0.7f );
|
||||
m_pSelector->MenuStart( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::MenuBack( PlayerNumber pn )
|
||||
{
|
||||
SOUNDMAN->StopMusic();
|
||||
|
||||
m_Menu.TweenOffScreenToBlack( SM_GoToPrevScreen, true );
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::TweenOffScreen()
|
||||
{
|
||||
unsigned p;
|
||||
|
||||
for( p=0; p < m_SubActors.size(); p++ )
|
||||
m_SubActors[p]->StopTweening();
|
||||
|
||||
|
||||
const int page = m_CurrentPage;
|
||||
|
||||
m_sprExplanation[page].SetXY( EXPLANATION_X(page), EXPLANATION_Y(page) );
|
||||
m_sprExplanation[page].BeginTweening( 0.5, Actor::TWEEN_BOUNCE_BEGIN );
|
||||
m_sprExplanation[page].SetTweenXY( EXPLANATION_X(page)+700, EXPLANATION_Y(page) );
|
||||
|
||||
m_sprMoreArrows[page].BeginTweening( 0.5 );
|
||||
m_sprMoreArrows[page].SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
m_sprCursor[p].BeginTweening( 0.3f );
|
||||
m_sprCursor[p].SetTweenZoom( 0 );
|
||||
|
||||
m_sprOK[p].BeginTweening( 0.3f );
|
||||
m_sprOK[p].SetTweenZoom( 0 );
|
||||
|
||||
m_sprJoinMessagehadow[p].BeginTweening( 0.3f );
|
||||
m_sprJoinMessagehadow[p].SetTweenDiffuse( RageColor(0,0,0,0) );
|
||||
}
|
||||
|
||||
{
|
||||
for( unsigned c=0; c<m_ModeChoices[page].size(); c++ )
|
||||
{
|
||||
const float fPause = c*0.2f;
|
||||
|
||||
// roll up
|
||||
m_sprPicture[page][c].FadeOff( fPause, "foldy bounce", 0.3f );
|
||||
|
||||
// fly off
|
||||
m_sprHeader[page][c].FadeOff( fPause+0.3f, "left far accelerate", 0.4f );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSelectDifficulty::TweenOnScreen()
|
||||
{
|
||||
unsigned p;
|
||||
|
||||
for( p=0; p<NUM_PAGES; p++ )
|
||||
{
|
||||
m_sprExplanation[p].FadeOn( 0, "right bounce", 0.3f );
|
||||
m_sprMoreArrows[p].FadeOn( 0, "fade", 0.5f );
|
||||
}
|
||||
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
{
|
||||
if( !GAMESTATE->IsPlayerEnabled((PlayerNumber)p) )
|
||||
continue;
|
||||
|
||||
float fCursorX = CURSOR_X(m_CurrentPage,m_iChoiceOnPage[p],p);
|
||||
float fCursorY = CURSOR_Y(m_CurrentPage,m_iChoiceOnPage[p],p);
|
||||
|
||||
|
||||
m_sprCursor[p].SetXY( fCursorX, fCursorY );
|
||||
m_sprCursor[p].FadeOn( 0, "SpinZ Zoom Fade", 0.3f );
|
||||
|
||||
m_sprJoinMessagehadow[p].SetXY( fCursorX, fCursorY );
|
||||
RageColor colorOriginal = m_sprJoinMessagehadow[p].GetDiffuse();
|
||||
m_sprJoinMessagehadow[p].SetDiffuse( RageColor(0,0,0,0) );
|
||||
m_sprJoinMessagehadow[p].BeginTweening( 0.3f );
|
||||
m_sprJoinMessagehadow[p].SetTweenDiffuse( colorOriginal );
|
||||
}
|
||||
|
||||
{
|
||||
const int p = m_CurrentPage;
|
||||
for( unsigned c=0; c<m_ModeChoices[m_CurrentPage].size(); c++ )
|
||||
{
|
||||
const float fPause = c*0.2f;
|
||||
|
||||
// fly on
|
||||
m_sprHeader[p][c].FadeOn( fPause, "left far accelerate", 0.4f );
|
||||
|
||||
// roll down
|
||||
m_sprPicture[p][c].FadeOn( fPause+0.4f, "foldy bounce", 0.3f );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
File: ScreenSelectDifficulty.h
|
||||
|
||||
Desc: Select the game mode (single, versus, double).
|
||||
Desc: Select the difficulty (easy, medium, hard).
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -10,13 +10,8 @@
|
||||
*/
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Sprite.h"
|
||||
#include "RandomSample.h"
|
||||
#include "Screen.h"
|
||||
#include "Quad.h"
|
||||
#include "MenuElements.h"
|
||||
#include "RandomSample.h"
|
||||
#include "ModeChoice.h"
|
||||
class ModeSelector;
|
||||
|
||||
|
||||
class ScreenSelectDifficulty : public Screen
|
||||
@@ -34,42 +29,18 @@ public:
|
||||
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
void MenuUp( PlayerNumber pn );
|
||||
void MenuDown( PlayerNumber pn );
|
||||
void MenuLeft( PlayerNumber pn );
|
||||
void MenuRight( PlayerNumber pn );
|
||||
void MenuStart( PlayerNumber pn );
|
||||
void MenuBack( PlayerNumber pn );
|
||||
|
||||
void TweenOffScreen();
|
||||
void TweenOnScreen();
|
||||
|
||||
private:
|
||||
void ChangeWithinPage( PlayerNumber pn, int iNewChoice, bool bChangingPages );
|
||||
void ChangePage( Page newPage );
|
||||
|
||||
MenuElements m_Menu;
|
||||
MenuElements m_Menu;
|
||||
|
||||
ActorFrame m_framePages; // to hold the 2 pages
|
||||
|
||||
Sprite m_sprHeader[NUM_PAGES][MAX_CHOICES_PER_PAGE];
|
||||
Sprite m_sprPicture[NUM_PAGES][MAX_CHOICES_PER_PAGE];
|
||||
Sprite m_sprExplanation[NUM_PAGES];
|
||||
Sprite m_sprMoreArrows[NUM_PAGES];
|
||||
|
||||
Sprite m_sprCursor[NUM_PLAYERS];
|
||||
Sprite m_sprJoinMessagehadow[NUM_PLAYERS];
|
||||
Sprite m_sprOK[NUM_PLAYERS];
|
||||
|
||||
RageSound m_soundChange;
|
||||
RageSound m_soundSelect;
|
||||
RandomSample m_soundDifficult;
|
||||
|
||||
vector<ModeChoice> m_ModeChoices[NUM_PAGES];
|
||||
|
||||
Page m_CurrentPage;
|
||||
int m_iChoiceOnPage[NUM_PLAYERS];
|
||||
bool m_bChosen[NUM_PLAYERS];
|
||||
|
||||
float m_fLockInputTime;
|
||||
ModeSelector* m_pSelector;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ ScreenSelectDifficultyEX::ScreenSelectDifficultyEX()
|
||||
m_sprCursor[p].SetXY( -1600, -1600 );
|
||||
m_sprCursor[p].StopAnimating();
|
||||
m_sprCursor[p].SetState( p );
|
||||
m_sprCursor[p].TurnShadowOff();
|
||||
m_sprCursor[p].EnableShadow( false );
|
||||
m_framePages.AddChild( &m_sprCursor[p] );
|
||||
|
||||
m_sprOK[p].Load( THEME->GetPathTo("Graphics", "select difficulty ex ok 2x1") );
|
||||
|
||||
@@ -147,7 +147,7 @@ ScreenSelectGroup::ScreenSelectGroup()
|
||||
m_textNumber.LoadFromFont( THEME->GetPathTo("Fonts","select group num songs") );
|
||||
m_textNumber.SetXY( NUMBER_X, NUMBER_Y );
|
||||
m_textNumber.SetHorizAlign( Actor::align_right );
|
||||
m_textNumber.TurnShadowOff();
|
||||
m_textNumber.EnableShadow( false );
|
||||
this->AddChild( &m_textNumber );
|
||||
|
||||
m_sprContents.Load( THEME->GetPathTo("Graphics","select group contents header") );
|
||||
@@ -317,7 +317,7 @@ void ScreenSelectGroup::TweenOffScreen()
|
||||
}
|
||||
|
||||
m_sprContents.BeginTweening( 0.7f );
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_BIAS_END );
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_DECELERATE );
|
||||
m_sprContents.SetTweenY( CONTENTS_Y+400 );
|
||||
|
||||
m_MusicList.TweenOffScreen();
|
||||
@@ -341,8 +341,8 @@ void ScreenSelectGroup::TweenOnScreen()
|
||||
}
|
||||
|
||||
m_sprContents.SetY( CONTENTS_Y+400 );
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_BIAS_END ); // sleep
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_BIAS_END );
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_DECELERATE ); // sleep
|
||||
m_sprContents.BeginTweening( 0.5f, TWEEN_DECELERATE );
|
||||
m_sprContents.SetTweenY( CONTENTS_Y );
|
||||
|
||||
m_MusicList.TweenOnScreen();
|
||||
|
||||
@@ -96,7 +96,7 @@ ScreenSelectMode::ScreenSelectMode()
|
||||
m_sprJoinMessage[p].SetState( p );
|
||||
m_sprJoinMessage[p].SetXY( JOIN_MESSAGE_X(p), JOIN_MESSAGE_Y(p) );
|
||||
if( BOUNCE_JOIN_MESSAGE )
|
||||
m_sprJoinMessage[p].SetEffectBouncing( RageVector3(0,10,0), 0.5f );
|
||||
m_sprJoinMessage[p].SetEffectBounce( 0.5f, RageVector3(0,10,0) );
|
||||
this->AddChild( &m_sprJoinMessage[p] );
|
||||
|
||||
if( GAMESTATE->m_bSideIsJoined[p] )
|
||||
@@ -418,9 +418,9 @@ void ScreenSelectMode::TweenOffScreen()
|
||||
{
|
||||
float fOffScreenOffset = float( (p==PLAYER_1) ? -SCREEN_WIDTH : +SCREEN_WIDTH );
|
||||
|
||||
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_BIAS_END );
|
||||
m_sprJoinMessage[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
||||
m_sprJoinMessage[p].SetTweenX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
||||
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_BIAS_END );
|
||||
m_sprJoinFrame[p].BeginTweening( 0.5f, Actor::TWEEN_DECELERATE );
|
||||
m_sprJoinFrame[p].SetTweenX( m_sprJoinMessage[p].GetX()+fOffScreenOffset );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
this->AddChild( &m_StageDisplay );
|
||||
|
||||
m_sprCDTitle.Load( THEME->GetPathTo("Graphics","fallback cd title") );
|
||||
m_sprCDTitle.TurnShadowOff();
|
||||
m_sprCDTitle.EnableShadow( false );
|
||||
m_sprCDTitle.SetXY( CD_TITLE_X, CD_TITLE_Y );
|
||||
this->AddChild( &m_sprCDTitle );
|
||||
|
||||
@@ -208,7 +208,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
m_sprMarathonBalloon.SetXY( BALLOON_X, BALLOON_Y );
|
||||
m_sprMarathonBalloon.SetZoomY( 0 );
|
||||
m_sprMarathonBalloon.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprMarathonBalloon.SetEffectBobbing( RageVector3(0,10,0), 2 );
|
||||
m_sprMarathonBalloon.SetEffectBob( 2, RageVector3(0,10,0) );
|
||||
this->AddChild( &m_sprMarathonBalloon );
|
||||
|
||||
m_sprLongBalloon.Load( THEME->GetPathTo("Graphics","select music long balloon") );
|
||||
@@ -216,7 +216,7 @@ ScreenSelectMusic::ScreenSelectMusic()
|
||||
m_sprLongBalloon.SetXY( BALLOON_X, BALLOON_Y );
|
||||
m_sprLongBalloon.SetZoomY( 0 );
|
||||
m_sprLongBalloon.SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprLongBalloon.SetEffectBobbing( RageVector3(0,10,0), 2 );
|
||||
m_sprLongBalloon.SetEffectBob( 2, RageVector3(0,10,0) );
|
||||
this->AddChild( &m_sprLongBalloon );
|
||||
|
||||
m_sprOptionsMessage.Load( THEME->GetPathTo("Graphics","select music options message") );
|
||||
@@ -346,7 +346,7 @@ void ScreenSelectMusic::TweenOffScreen()
|
||||
}
|
||||
for( unsigned i=0; i<apActorsInScore.size(); i++ )
|
||||
{
|
||||
apActorsInScore[i]->BeginTweening( TWEEN_TIME, TWEEN_BIAS_END );
|
||||
apActorsInScore[i]->BeginTweening( TWEEN_TIME, TWEEN_DECELERATE );
|
||||
apActorsInScore[i]->SetTweenX( SCORE_CONNECTED_TO_MUSIC_WHEEL ? apActorsInScore[i]->GetX()+400 : apActorsInScore[i]->GetX()-400 );
|
||||
}
|
||||
|
||||
@@ -378,19 +378,19 @@ void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
|
||||
{
|
||||
/* Grab the tween destination. (If we're tweening, this is where
|
||||
* it'll end up; otherwise it's the static position.) */
|
||||
Actor::TweenState original = apActorsInScore[i]->GetDestTweenState();
|
||||
Actor::TweenState original = apActorsInScore[i]->DestTweenState();
|
||||
|
||||
apActorsInScore[i]->StopTweening();
|
||||
|
||||
float fOriginalX = apActorsInScore[i]->GetX();
|
||||
apActorsInScore[i]->BeginTweening( factor*TWEEN_TIME, TWEEN_BIAS_END ); // tween off screen
|
||||
apActorsInScore[i]->BeginTweening( factor*TWEEN_TIME, TWEEN_DECELERATE ); // tween off screen
|
||||
apActorsInScore[i]->SetTweenX( fOriginalX+400 );
|
||||
|
||||
apActorsInScore[i]->BeginTweening( factor*0.5f ); // sleep
|
||||
|
||||
/* Go back to where we were (or to where we were going.) */
|
||||
apActorsInScore[i]->BeginTweening( factor*1, TWEEN_BIAS_BEGIN ); // tween back on screen
|
||||
apActorsInScore[i]->SetTweenState(original);
|
||||
apActorsInScore[i]->BeginTweening( factor*1, TWEEN_ACCELERATE ); // tween back on screen
|
||||
apActorsInScore[i]->SetLatestTween(original);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenSelectStyle
|
||||
|
||||
Desc: Testing the Screen class.
|
||||
Desc: See Header.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -23,100 +23,58 @@
|
||||
#include "GameState.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ModeSelector.h"
|
||||
|
||||
|
||||
#define JOINT_PREMIUM_BANNER_X THEME->GetMetricF("ScreenSelectStyle","JointPremiumBannerX")
|
||||
#define JOINT_PREMIUM_BANNER_Y THEME->GetMetricF("ScreenSelectStyle","JointPremiumBannerY")
|
||||
#define ICONS_START_X THEME->GetMetricF("ScreenSelectStyle","IconsStartX")
|
||||
#define ICONS_SPACING_X THEME->GetMetricF("ScreenSelectStyle","IconsSpacingX")
|
||||
#define ICONS_START_Y THEME->GetMetricF("ScreenSelectStyle","IconsStartY")
|
||||
#define ICONS_SPACING_Y THEME->GetMetricF("ScreenSelectStyle","IconsSpacingY")
|
||||
#define EXPLANATION_X THEME->GetMetricF("ScreenSelectStyle","ExplanationX")
|
||||
#define EXPLANATION_Y THEME->GetMetricF("ScreenSelectStyle","ExplanationY")
|
||||
#define INFO_X THEME->GetMetricF("ScreenSelectStyle","InfoX")
|
||||
#define INFO_Y THEME->GetMetricF("ScreenSelectStyle","InfoY")
|
||||
#define PREVIEW_X THEME->GetMetricF("ScreenSelectStyle","PreviewX")
|
||||
#define PREVIEW_Y THEME->GetMetricF("ScreenSelectStyle","PreviewY")
|
||||
#define HELP_TEXT THEME->GetMetric("ScreenSelectStyle","HelpText")
|
||||
#define SELECTOR THEME->GetMetric ("ScreenSelectStyle","Selector")
|
||||
#define HELP_TEXT THEME->GetMetric ("ScreenSelectStyle","HelpText")
|
||||
#define TIMER_SECONDS THEME->GetMetricI("ScreenSelectStyle","TimerSeconds")
|
||||
#define NEXT_SCREEN THEME->GetMetric("ScreenSelectStyle","NextScreen")
|
||||
/* I couldn't find a cleaner way to add this so that SM can show DDREX style,
|
||||
if configured to, in place of the normal style select difficulty screen..
|
||||
I know the screen after this one is supposed to be dynamic to whatever
|
||||
is in the metrics file.. But logically, shouldn't select difficulty always
|
||||
come after select style? -- Miryokuteki
|
||||
*/
|
||||
#define NEXT_SCREEN THEME->GetMetric ("ScreenSelectStyle","NextScreen")
|
||||
|
||||
|
||||
ScreenSelectStyle::ScreenSelectStyle()
|
||||
{
|
||||
LOG->Trace( "ScreenSelectStyle::ScreenSelectStyle()" );
|
||||
|
||||
// Reset the current style and game
|
||||
GAMESTATE->m_CurStyle = STYLE_INVALID;
|
||||
|
||||
GAMESTATE->m_bPlayersCanJoin = true;
|
||||
|
||||
GAMEMAN->GetStylesForGame( GAMESTATE->m_CurGame, m_aPossibleStyles );
|
||||
ASSERT( !m_aPossibleStyles.empty() ); // every game should have at least one Style, or else why have the Game? :-)
|
||||
m_iSelection = 0;
|
||||
|
||||
unsigned i;
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
vector<ModeChoice> aModeChoices;
|
||||
|
||||
vector<Style> aStyles;
|
||||
GAMEMAN->GetStylesForGame( GAMESTATE->m_CurGame, aStyles );
|
||||
ASSERT( !aStyles.empty() ); // every game should have at least one Style, or else why have the Game? :-)
|
||||
|
||||
for( unsigned s=0; s<aStyles.size(); s++ )
|
||||
{
|
||||
CString IconPath = THEME->GetPathToOptional("Graphics",ssprintf("select style icons %s",GAMESTATE->GetCurrentGameDef()->m_szName) );
|
||||
if(IconPath.empty())
|
||||
Style style = aStyles[s];
|
||||
const StyleDef* pStyleDef = GAMEMAN->GetStyleDefForStyle(aStyles[s]);
|
||||
|
||||
int iNumSidesJoinedToPlay;
|
||||
switch( pStyleDef->m_StyleType )
|
||||
{
|
||||
BitmapText *b = new BitmapText;
|
||||
b->LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
b->SetText(GAMEMAN->GetStyleDefForStyle( m_aPossibleStyles[i] )->m_szName);
|
||||
b->SetDiffuse(RageColor(.5,.5,.5,1));
|
||||
b->SetZoom(0.5f);
|
||||
m_sprIcon[i] = b;
|
||||
IconsAreText = true;
|
||||
case StyleDef::ONE_PLAYER_ONE_CREDIT: iNumSidesJoinedToPlay = 1; break;
|
||||
case StyleDef::TWO_PLAYERS_TWO_CREDITS: iNumSidesJoinedToPlay = 2; break;
|
||||
case StyleDef::ONE_PLAYER_TWO_CREDITS: iNumSidesJoinedToPlay = 2; break;
|
||||
default: ASSERT(0); iNumSidesJoinedToPlay = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Sprite *s = new Sprite;
|
||||
s->Load( IconPath );
|
||||
s->StopAnimating();
|
||||
s->SetState( i );
|
||||
m_sprIcon[i] = s;
|
||||
IconsAreText = false;
|
||||
}
|
||||
|
||||
m_sprIcon[i]->SetXY( ICONS_START_X + i*ICONS_SPACING_X, ICONS_START_Y + i*ICONS_SPACING_Y );
|
||||
this->AddChild( m_sprIcon[i] );
|
||||
}
|
||||
|
||||
UpdateEnabledDisabled();
|
||||
|
||||
m_sprExplanation.Load( THEME->GetPathTo("Graphics","select style explanation") );
|
||||
m_sprExplanation.SetXY( EXPLANATION_X, EXPLANATION_Y );
|
||||
this->AddChild( &m_sprExplanation );
|
||||
|
||||
m_sprPreview.SetXY( PREVIEW_X, PREVIEW_Y );
|
||||
this->AddChild( &m_sprPreview );
|
||||
|
||||
m_sprInfo.SetXY( INFO_X, INFO_Y );
|
||||
this->AddChild( &m_sprInfo );
|
||||
|
||||
if( PREFSMAN->m_bJointPremium )
|
||||
{
|
||||
m_sprJointPremium.Load( THEME->GetPathTo("Graphics","select style joint premium banner") );
|
||||
m_sprJointPremium.SetXY( JOINT_PREMIUM_BANNER_X, JOINT_PREMIUM_BANNER_Y );
|
||||
this->AddChild( &m_sprJointPremium );
|
||||
}
|
||||
|
||||
const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
|
||||
const StyleDef* pStyleDef = GAMEMAN->GetStyleDefForStyle( m_aPossibleStyles[m_iSelection] );
|
||||
|
||||
// Load dummy Sprites
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
m_sprDummyPreview[i].Load( THEME->GetPathToOptional("Graphics",ssprintf("select style preview %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
m_sprDummyInfo[i].Load( THEME->GetPathToOptional("Graphics",ssprintf("select style info %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
|
||||
ModeChoice mc = {
|
||||
GAMESTATE->m_CurGame,
|
||||
PLAY_MODE_INVALID,
|
||||
style,
|
||||
DIFFICULTY_INVALID,
|
||||
"",
|
||||
iNumSidesJoinedToPlay
|
||||
};
|
||||
strcpy( mc.name, pStyleDef->m_szName );
|
||||
aModeChoices.push_back( mc );
|
||||
}
|
||||
|
||||
m_pSelector = ModeSelector::Create( SELECTOR );
|
||||
m_pSelector->Init( aModeChoices, "ScreenSelectStyle", "select style" );
|
||||
this->AddChild( m_pSelector );
|
||||
|
||||
m_Menu.Load(
|
||||
THEME->GetPathTo("BGAnimations","select style"),
|
||||
@@ -125,16 +83,10 @@ ScreenSelectStyle::ScreenSelectStyle()
|
||||
);
|
||||
this->AddChild( &m_Menu );
|
||||
|
||||
m_soundChange.Load( THEME->GetPathTo("Sounds","select style change") );
|
||||
m_soundSelect.Load( THEME->GetPathTo("Sounds","menu start") );
|
||||
|
||||
|
||||
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style intro") );
|
||||
|
||||
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","select style music") );
|
||||
|
||||
AfterChange();
|
||||
TweenOnScreen();
|
||||
m_Menu.TweenOnScreenFromBlack( SM_None );
|
||||
}
|
||||
|
||||
@@ -142,8 +94,11 @@ ScreenSelectStyle::ScreenSelectStyle()
|
||||
ScreenSelectStyle::~ScreenSelectStyle()
|
||||
{
|
||||
LOG->Trace( "ScreenSelectStyle::~ScreenSelectStyle()" );
|
||||
for( unsigned i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
delete m_sprIcon[i];
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::Update( float fDelta )
|
||||
{
|
||||
Screen::Update( fDelta );
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::DrawPrimitives()
|
||||
@@ -165,12 +120,27 @@ void ScreenSelectStyle::Input( const DeviceInput& DeviceI, const InputEventType
|
||||
|
||||
void ScreenSelectStyle::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
Screen::HandleScreenMessage( SM );
|
||||
|
||||
switch( SM )
|
||||
{
|
||||
case SM_BeginFadingOut: // sent by our ModeSelector
|
||||
ModeChoice mc;
|
||||
m_pSelector->GetSelectedModeChoice( GAMESTATE->m_MasterPlayerNumber, &mc );
|
||||
GAMESTATE->ApplyModeChoice( &mc, GAMESTATE->m_MasterPlayerNumber );
|
||||
|
||||
GAMESTATE->m_bPlayersCanJoin = false;
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
|
||||
m_Menu.StopTimer();
|
||||
m_pSelector->TweenOffScreen();
|
||||
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen );
|
||||
break;
|
||||
case SM_MenuTimer:
|
||||
MenuStart(PLAYER_INVALID);
|
||||
{
|
||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(p) )
|
||||
MenuStart( (PlayerNumber)p );
|
||||
}
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
SOUNDMAN->StopMusic();
|
||||
@@ -182,90 +152,25 @@ void ScreenSelectStyle::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::BeforeChange()
|
||||
{
|
||||
m_sprIcon[m_iSelection]->SetEffectNone();
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::AfterChange()
|
||||
{
|
||||
m_sprIcon[m_iSelection]->SetEffectGlowShift();
|
||||
|
||||
const GameDef* pGameDef = GAMESTATE->GetCurrentGameDef();
|
||||
const StyleDef* pStyleDef = GAMEMAN->GetStyleDefForStyle( m_aPossibleStyles[m_iSelection] );
|
||||
|
||||
// Tween Preview
|
||||
m_sprPreview.Load( THEME->GetPathToOptional("Graphics",ssprintf("select style preview %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
|
||||
m_sprPreview.StopTweening();
|
||||
m_sprPreview.SetGlow( RageColor(1,1,1,0) );
|
||||
m_sprPreview.SetDiffuse( RageColor(1,1,1,0) );
|
||||
|
||||
m_sprPreview.BeginTweening( 0.25f ); // sleep
|
||||
|
||||
m_sprPreview.BeginTweening( 0.2f ); // fade to white
|
||||
m_sprPreview.SetTweenGlow( RageColor(1,1,1,1) );
|
||||
m_sprPreview.SetTweenDiffuse( RageColor(1,1,1,0) );
|
||||
|
||||
m_sprPreview.BeginTweening( 0.01f ); // turn color on
|
||||
m_sprPreview.SetTweenDiffuse( RageColor(1,1,1,1) );
|
||||
|
||||
m_sprPreview.BeginTweening( 0.2f ); // fade to color
|
||||
m_sprPreview.SetTweenGlow( RageColor(1,1,1,0) );
|
||||
m_sprPreview.SetTweenDiffuse( RageColor(1,1,1,1) );
|
||||
|
||||
|
||||
// Tween Info
|
||||
m_sprInfo.Load( THEME->GetPathToOptional("Graphics",ssprintf("select style info %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
m_sprInfo.StopTweening();
|
||||
m_sprInfo.SetZoomY( 0 );
|
||||
m_sprInfo.BeginTweening( 0.5f, Actor::TWEEN_BOUNCE_END );
|
||||
m_sprInfo.SetTweenZoomY( 1 );
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::MenuLeft( PlayerNumber pn )
|
||||
{
|
||||
// search for a style to the left of the current selection that is enabled
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( int i=m_iSelection-1; i>=0; i-- )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
{
|
||||
iSwitchToStyleIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( iSwitchToStyleIndex == -1 )
|
||||
return;
|
||||
|
||||
BeforeChange();
|
||||
m_iSelection = iSwitchToStyleIndex;
|
||||
m_soundChange.PlayRandom();
|
||||
AfterChange();
|
||||
m_pSelector->MenuLeft( pn );
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectStyle::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
// search for a style to the right of the current selection that is enabled
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( unsigned i=m_iSelection+1; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
{
|
||||
iSwitchToStyleIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_pSelector->MenuRight( pn );
|
||||
}
|
||||
|
||||
if( iSwitchToStyleIndex == -1 )
|
||||
return;
|
||||
void ScreenSelectStyle::MenuUp( PlayerNumber pn )
|
||||
{
|
||||
m_pSelector->MenuUp( pn );
|
||||
}
|
||||
|
||||
BeforeChange();
|
||||
m_iSelection = iSwitchToStyleIndex;
|
||||
m_soundChange.PlayRandom();
|
||||
AfterChange();
|
||||
void ScreenSelectStyle::MenuDown( PlayerNumber pn )
|
||||
{
|
||||
m_pSelector->MenuDown( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::MenuStart( PlayerNumber pn )
|
||||
@@ -301,29 +206,10 @@ void ScreenSelectStyle::MenuStart( PlayerNumber pn )
|
||||
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") );
|
||||
GAMESTATE->m_bSideIsJoined[pn] = true;
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
UpdateEnabledDisabled();
|
||||
return; // don't fall through
|
||||
m_pSelector->UpdateSelectableChoices();
|
||||
}
|
||||
|
||||
GAMESTATE->m_CurStyle = GetSelectedStyle();
|
||||
|
||||
CString sCurStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName;
|
||||
sCurStyleName.MakeLower();
|
||||
if( -1!=sCurStyleName.Find("single") ) SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style comment single") );
|
||||
else if( -1!=sCurStyleName.Find("versus") ) SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style comment versus") );
|
||||
else if( -1!=sCurStyleName.Find("double") ) SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style comment double") );
|
||||
else if( -1!=sCurStyleName.Find("couple") ) SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style comment couple") );
|
||||
else if( -1!=sCurStyleName.Find("solo") ) SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("select style comment solo") );
|
||||
|
||||
m_Menu.TweenOffScreenToMenu( SM_GoToNextScreen );
|
||||
GAMESTATE->m_bPlayersCanJoin = false;
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
|
||||
m_soundSelect.PlayRandom();
|
||||
|
||||
m_Menu.StopTimer();
|
||||
|
||||
TweenOffScreen();
|
||||
else
|
||||
m_pSelector->MenuStart( pn );
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::MenuBack( PlayerNumber pn )
|
||||
@@ -331,88 +217,4 @@ void ScreenSelectStyle::MenuBack( PlayerNumber pn )
|
||||
SOUNDMAN->StopMusic();
|
||||
|
||||
m_Menu.TweenOffScreenToBlack( SM_GoToPrevScreen, true );
|
||||
|
||||
// m_Fade.CloseWipingLeft( SM_GoToPrevScreen );
|
||||
|
||||
// TweenOffScreen();
|
||||
}
|
||||
|
||||
|
||||
void ScreenSelectStyle::TweenOnScreen()
|
||||
{
|
||||
for( unsigned i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
m_sprIcon[i]->FadeOn( (m_aPossibleStyles.size()-i)*0.05f, "Left Accelerate", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprExplanation.FadeOn( 0, "Right Accelerate", MENU_ELEMENTS_TWEEN_TIME );
|
||||
m_sprJointPremium.FadeOn( 0, "fade", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
// let AfterChange tween Preview and Info
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::TweenOffScreen()
|
||||
{
|
||||
for( unsigned i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
m_sprIcon[i]->FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprExplanation.FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprPreview.FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprInfo.FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprJointPremium.FadeOff( 0, "fade", MENU_ELEMENTS_TWEEN_TIME );
|
||||
}
|
||||
|
||||
|
||||
bool ScreenSelectStyle::IsEnabled( int iStyleIndex )
|
||||
{
|
||||
Style style = m_aPossibleStyles[iStyleIndex];
|
||||
|
||||
int iNumSidesJoined = 0;
|
||||
for( int c=0; c<2; c++ )
|
||||
if( GAMESTATE->m_bSideIsJoined[c] )
|
||||
iNumSidesJoined++; // left side, and right side
|
||||
|
||||
switch( GAMEMAN->GetStyleDefForStyle(style)->m_StyleType )
|
||||
{
|
||||
case StyleDef::ONE_PLAYER_ONE_CREDIT: return iNumSidesJoined==1;
|
||||
case StyleDef::ONE_PLAYER_TWO_CREDITS: return iNumSidesJoined==2;
|
||||
case StyleDef::TWO_PLAYERS_TWO_CREDITS: return iNumSidesJoined==2;
|
||||
default: ASSERT(0); return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSelectStyle::UpdateEnabledDisabled()
|
||||
{
|
||||
unsigned i;
|
||||
/* XXX: If a player joins during the tween-in, this diffuse change
|
||||
* will be undone by the tween. Hmm. */
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
/* If the icon is text, use a dimmer diffuse, or we won't be
|
||||
* able to see the glow. */
|
||||
if( IsEnabled(i) )
|
||||
m_sprIcon[i]->SetDiffuse( IconsAreText? RageColor(0.75f, 0.75f, 0.75f, 1):
|
||||
RageColor(1,1,1,1) );
|
||||
else
|
||||
m_sprIcon[i]->SetDiffuse( RageColor(0.25f,0.25f,0.25f,1) );
|
||||
}
|
||||
|
||||
// Select first enabled style
|
||||
BeforeChange();
|
||||
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
{
|
||||
iSwitchToStyleIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ASSERT( iSwitchToStyleIndex != -1 ); // no styles are enabled. We're stuck! This should never happen
|
||||
|
||||
m_iSelection = iSwitchToStyleIndex;
|
||||
AfterChange();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifndef SCREEN_SELECT_STYLE_H
|
||||
#define SCREEN_SELECT_STYLE_H
|
||||
#ifndef ScreenSelectStyle_H
|
||||
#define ScreenSelectStyle_H
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Class: ScreenSelectStyle
|
||||
|
||||
Desc: Select the game mode (single, versus, double).
|
||||
Desc: Base class for Style, Difficulty, and Mode selection screens.
|
||||
|
||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||
Chris Danford
|
||||
@@ -13,12 +13,8 @@
|
||||
|
||||
|
||||
#include "Screen.h"
|
||||
#include "Sprite.h"
|
||||
#include "TransitionFade.h"
|
||||
#include "RandomSample.h"
|
||||
#include "MenuElements.h"
|
||||
#include "Style.h"
|
||||
|
||||
class ModeSelector;
|
||||
|
||||
class ScreenSelectStyle : public Screen
|
||||
{
|
||||
@@ -26,44 +22,23 @@ public:
|
||||
ScreenSelectStyle();
|
||||
virtual ~ScreenSelectStyle();
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
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 );
|
||||
|
||||
void MenuLeft( PlayerNumber pn );
|
||||
void MenuRight( PlayerNumber pn );
|
||||
void MenuStart( PlayerNumber pn );
|
||||
void MenuBack( PlayerNumber pn );
|
||||
void TweenOffScreen();
|
||||
void TweenOnScreen();
|
||||
virtual void MenuLeft( PlayerNumber pn );
|
||||
virtual void MenuRight( PlayerNumber pn );
|
||||
virtual void MenuUp( PlayerNumber pn );
|
||||
virtual void MenuDown( PlayerNumber pn );
|
||||
virtual void MenuStart( PlayerNumber pn );
|
||||
virtual void MenuBack( PlayerNumber pn );
|
||||
|
||||
private:
|
||||
void BeforeChange();
|
||||
void AfterChange();
|
||||
|
||||
bool IsEnabled( int iStyleIndex );
|
||||
void UpdateEnabledDisabled();
|
||||
|
||||
MenuElements m_Menu;
|
||||
|
||||
Actor *m_sprIcon[NUM_STYLES];
|
||||
bool IconsAreText;
|
||||
Sprite m_sprExplanation;
|
||||
Sprite m_sprPreview;
|
||||
Sprite m_sprInfo;
|
||||
Sprite m_sprJointPremium;
|
||||
|
||||
// Sprites that are never drawn. They exist to keep the style textures in memory
|
||||
Sprite m_sprDummyPreview[NUM_STYLES];
|
||||
Sprite m_sprDummyInfo[NUM_STYLES];
|
||||
|
||||
RandomSample m_soundChange;
|
||||
RandomSample m_soundSelect;
|
||||
|
||||
int m_iSelection;
|
||||
vector<Style> m_aPossibleStyles;
|
||||
|
||||
Style GetSelectedStyle() { return m_aPossibleStyles[m_iSelection]; };
|
||||
ModeSelector* m_pSelector;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -140,7 +140,7 @@ ScreenSelectStyle5th::ScreenSelectStyle5th()
|
||||
|
||||
|
||||
m_sprStyleIcon.Load( THEME->GetPathTo("Graphics",ssprintf("select style icons game %d",GAMESTATE->m_CurGame)) );
|
||||
m_sprStyleIcon.TurnShadowOff();
|
||||
m_sprStyleIcon.EnableShadow( false );
|
||||
m_sprStyleIcon.StopAnimating();
|
||||
m_sprStyleIcon.SetXY( ICON_X, ICON_Y );
|
||||
this->AddChild( &m_sprStyleIcon );
|
||||
|
||||
@@ -221,7 +221,7 @@ ScreenStage::ScreenStage()
|
||||
m_quadMask.SetZ( 1 );
|
||||
|
||||
m_frameStage.SetXY( CENTER_X, fStageOffScreenY );
|
||||
m_frameStage.BeginTweening(0.8f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_frameStage.BeginTweening(0.8f, Actor::TWEEN_ACCELERATE );
|
||||
m_frameStage.SetTweenY( CENTER_Y );
|
||||
|
||||
this->AddChild( &m_quadMask ); // add quad mask before stage so that it will block out the stage sprites
|
||||
@@ -267,9 +267,9 @@ ScreenStage::ScreenStage()
|
||||
m_sprNumbers[i].ZoomToWidth( 200.0f ); // make the numbers that appear really big
|
||||
m_sprNumbers[i].ZoomToHeight( 200.0f); // so they can 'shrink' onto the screen
|
||||
m_sprNumbers[i].SetZoom( 20.0f ); // make it really really big on-screen
|
||||
m_sprNumbers[i].SetRotation( 10 ); // make this thing rotated
|
||||
m_sprNumbers[i].SetRotationZ( 10 ); // make this thing rotated
|
||||
|
||||
m_sprNumbers[i].BeginTweening(0.8f, Actor::TWEEN_BIAS_BEGIN );
|
||||
m_sprNumbers[i].BeginTweening(0.8f, Actor::TWEEN_ACCELERATE );
|
||||
m_sprNumbers[i].SetTweenZoom( 3.0f ); // shrink it down to it's proper size
|
||||
m_sprNumbers[i].SetTweenRotationZ( 0 ); // make it rotate into place
|
||||
}
|
||||
@@ -311,7 +311,7 @@ ScreenStage::ScreenStage()
|
||||
m_sprbgxtra.SetXY( CENTER_X-30, CENTER_Y+180); // set it's initial XY coordinates
|
||||
m_sprbgxtra.ZoomToHeight( 30 ); // set it's height and width. As we're only dealing with solid color
|
||||
m_sprbgxtra.ZoomToWidth( SCREEN_WIDTH + 50 ); // stretching shouldn't be a concern.
|
||||
m_sprbgxtra.SetRotation( -20 ); // rotate this graphic
|
||||
m_sprbgxtra.SetRotationZ( -20 ); // rotate this graphic
|
||||
m_sprbgxtra.BeginTweening(0.3f); // start tweening
|
||||
m_sprbgxtra.SetTweenRotationZ( 0 ); // set the rotation we want it to finally appear as
|
||||
}
|
||||
@@ -328,21 +328,21 @@ ScreenStage::ScreenStage()
|
||||
m_sprbg[0].ZoomToHeight( 100 );
|
||||
|
||||
m_sprbg[0].ZoomToWidth( SCREEN_WIDTH + 50 ); // no matter what... it's this wide
|
||||
m_sprbg[0].SetRotation( -20 ); // and is initially this rotation
|
||||
m_sprbg[0].SetRotationZ( -20 ); // and is initially this rotation
|
||||
m_sprbg[0].BeginTweening(0.3f); // start tweening
|
||||
m_sprbg[0].SetTweenRotationZ( 0 ); // and set the rotation to where we want it to end up
|
||||
|
||||
m_sprbg[1].SetXY( CENTER_X-(SCREEN_WIDTH/2)-20, CENTER_Y+element_y_offsets);
|
||||
m_sprbg[1].ZoomToHeight( SCREEN_HEIGHT - 140 );
|
||||
m_sprbg[1].ZoomToWidth( 130 );
|
||||
m_sprbg[1].SetRotation( -20 );
|
||||
m_sprbg[1].SetRotationZ( -20 );
|
||||
m_sprbg[1].BeginTweening(0.3f);
|
||||
m_sprbg[1].SetTweenRotationZ( 0 );
|
||||
|
||||
m_sprbg[2].SetXY( CENTER_X+430, CENTER_Y+element_y_offsets);
|
||||
m_sprbg[2].ZoomToHeight( SCREEN_HEIGHT - 140 );
|
||||
m_sprbg[2].ZoomToWidth( SCREEN_WIDTH + 50 );
|
||||
m_sprbg[2].SetRotation( -20 );
|
||||
m_sprbg[2].SetRotationZ( -20 );
|
||||
m_sprbg[2].BeginTweening(0.3f);
|
||||
m_sprbg[2].SetTweenX( CENTER_X );
|
||||
m_sprbg[2].SetTweenRotationZ( 0 );
|
||||
@@ -369,9 +369,9 @@ ScreenStage::ScreenStage()
|
||||
for (i=0; i<2; i++) // specify the font file.
|
||||
{
|
||||
m_ez2ukm[i].LoadFromFont( THEME->GetPathTo("Fonts","Stage ez2") );
|
||||
m_ez2ukm[i].TurnShadowOff();
|
||||
m_ez2ukm[i].EnableShadow( false );
|
||||
m_stagedesc[i].LoadFromFont( THEME->GetPathTo("Fonts","Stage ez2") );
|
||||
m_stagedesc[i].TurnShadowOff();
|
||||
m_stagedesc[i].EnableShadow( false );
|
||||
}
|
||||
|
||||
m_ez2ukm[0].SetXY( CENTER_X-400, CENTER_Y-220 ); // set the intiial UKMOVE positions
|
||||
@@ -485,7 +485,7 @@ ScreenStage::ScreenStage()
|
||||
|
||||
// write the stage name
|
||||
m_stagename.LoadFromFont( THEME->GetPathTo("Fonts","Stage ez2") );
|
||||
m_stagename.TurnShadowOff();
|
||||
m_stagename.EnableShadow( false );
|
||||
|
||||
m_stagename.SetXY( CENTER_X+400, CENTER_Y-30+element_y_offsets ); // set initial position
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ ScreenTestFonts::ScreenTestFonts()
|
||||
|
||||
void ScreenTestFonts::SetText(CString text)
|
||||
{
|
||||
txt.TurnShadowOff();
|
||||
txt.EnableShadow( false );
|
||||
txt.SetText(""); /* force it */
|
||||
txt.SetText(text);
|
||||
curtext = text;
|
||||
|
||||
@@ -73,8 +73,8 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
m_textHelp.SetText( sHelpText );
|
||||
m_textHelp.SetXY( HELP_X, HELP_Y );
|
||||
m_textHelp.SetZoom( 0.5f );
|
||||
m_textHelp.SetEffectDiffuseBlinking();
|
||||
m_textHelp.TurnShadowOn();
|
||||
m_textHelp.SetEffectDiffuseBlink();
|
||||
m_textHelp.EnableShadow( true );
|
||||
m_textHelp.SetShadowLength( 2 );
|
||||
this->AddChild( &m_textHelp );
|
||||
|
||||
@@ -88,7 +88,7 @@ ScreenTitleMenu::ScreenTitleMenu()
|
||||
m_textChoice[i].SetText( ChoiceToString((Choice)i) );
|
||||
m_textChoice[i].SetXY( CHOICES_X, CHOICES_START_Y + i*CHOICES_SPACING_Y );
|
||||
m_textChoice[i].SetShadowLength( CHOICES_SHADOW_LENGTH );
|
||||
m_textChoice[i].TurnShadowOn();
|
||||
m_textChoice[i].EnableShadow( true );
|
||||
this->AddChild( &m_textChoice[i] );
|
||||
}
|
||||
break;
|
||||
@@ -293,7 +293,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_sprJointPremiumMsg.SetX( SCREEN_RIGHT+m_sprJointPremiumMsg.GetUnzoomedWidth()/2 );
|
||||
m_sprJointPremiumMsg.SetY( SCREEN_BOTTOM/2 );
|
||||
|
||||
m_sprJointPremiumMsg.BeginTweening( 13.0f, Actor::TWEEN_BIAS_BEGIN ); // slide on
|
||||
m_sprJointPremiumMsg.BeginTweening( 13.0f, Actor::TWEEN_ACCELERATE ); // slide on
|
||||
m_sprJointPremiumMsg.SetTweenX( SCREEN_LEFT-m_sprJointPremiumMsg.GetUnzoomedWidth()*2 );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -144,7 +144,7 @@ void ScrollingList::Load( const CStringArray& asGraphicPaths )
|
||||
else if(m_iBannerPrefs == BANNERPREFS_DDRROT)
|
||||
{
|
||||
pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
||||
pNewCSprite->SetRotation( DDRROT_ROTATION );
|
||||
pNewCSprite->SetRotationZ( DDRROT_ROTATION );
|
||||
}
|
||||
else if(m_iBannerPrefs == BANNERPREFS_EZ2)
|
||||
{
|
||||
@@ -347,7 +347,7 @@ void ScrollingList::Replace(CString sGraphicPath, int ElementNumber)
|
||||
else if(m_iBannerPrefs == BANNERPREFS_DDRROT)
|
||||
{
|
||||
pNewCSprite->SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT );
|
||||
pNewCSprite->SetRotation( DDRROT_ROTATION );
|
||||
pNewCSprite->SetRotationZ( DDRROT_ROTATION );
|
||||
}
|
||||
else if(m_iBannerPrefs == BANNERPREFS_EZ2)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
StageDisplay::StageDisplay()
|
||||
{
|
||||
LoadFromFont( THEME->GetPathTo("Fonts","Header2") );
|
||||
TurnShadowOff();
|
||||
EnableShadow( false );
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -57,10 +57,10 @@ LINK32=link.exe
|
||||
# SUBTRACT LINK32 /verbose /pdb:none
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\../Release6
|
||||
TargetDir=\stepmania
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -92,10 +92,10 @@ LINK32=link.exe
|
||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||
# Begin Special Build Tool
|
||||
IntDir=.\../Debug6
|
||||
TargetDir=\stepmania
|
||||
TargetDir=\stepmania\stepmania
|
||||
TargetName=StepMania-debug
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -1104,6 +1104,30 @@ SOURCE=.\MenuTimer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelector.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelectorMaxType1.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelectorMaxType1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelectorMaxType2.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeSelectorMaxType2.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MusicBannerWheel.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -79,9 +79,9 @@ TextBanner::TextBanner()
|
||||
m_textSubTitle.SetHorizAlign( (Actor::HorizAlign)g_iHorizAlign );
|
||||
m_textArtist.SetHorizAlign( (Actor::HorizAlign)g_iHorizAlign );
|
||||
|
||||
m_textTitle.TurnShadowOff();
|
||||
m_textSubTitle.TurnShadowOff();
|
||||
m_textArtist.TurnShadowOff();
|
||||
m_textTitle.EnableShadow( false );
|
||||
m_textSubTitle.EnableShadow( false );
|
||||
m_textArtist.EnableShadow( false );
|
||||
|
||||
this->AddChild( &m_textTitle );
|
||||
this->AddChild( &m_textSubTitle );
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include "RageTimer.h"
|
||||
#include "Font.h"
|
||||
#include "FontCharAliases.h"
|
||||
#include "RageDisplay.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
||||
|
||||
@@ -118,7 +118,7 @@ CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
|
||||
|
||||
CString ThemeManager::GetPathTo( CString sThemeName, CString sAssetCategory, CString sFileName )
|
||||
{
|
||||
#if defined(DEBUG) && defined(WIN32) // XXX arch?
|
||||
#if defined(WIN32) // XXX arch?
|
||||
try_element_again:
|
||||
#endif
|
||||
sAssetCategory.MakeLower();
|
||||
@@ -149,9 +149,10 @@ try_element_again:
|
||||
"Verify that this redirect is correct.",
|
||||
asPossibleElementFilePaths[0].GetString(), sNewFilePath.GetString());
|
||||
|
||||
#if defined(DEBUG) && defined(WIN32) // XXX arch?
|
||||
if( MessageBox(NULL, message.GetString(), "ThemeManager", MB_RETRYCANCEL ) == IDRETRY)
|
||||
goto try_element_again;
|
||||
#if defined(WIN32) // XXX arch?
|
||||
if( DISPLAY->IsWindowed() )
|
||||
if( MessageBox(NULL, message.GetString(), "ThemeManager", MB_RETRYCANCEL ) == IDRETRY)
|
||||
goto try_element_again;
|
||||
#endif
|
||||
RageException::Throw( "%s", message.GetString() );
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ TipDisplay::TipDisplay()
|
||||
LOG->Trace( "TipDisplay::TipDisplay()" );
|
||||
|
||||
m_textTip.LoadFromFont( THEME->GetPathTo("Fonts","help") );
|
||||
m_textTip.SetEffectDiffuseBlinking();
|
||||
m_textTip.TurnShadowOff();
|
||||
m_textTip.SetEffectDiffuseBlink();
|
||||
m_textTip.EnableShadow( false );
|
||||
this->AddChild( &m_textTip );
|
||||
|
||||
m_iCurTipIndex = 0;
|
||||
|
||||
@@ -32,7 +32,7 @@ TransitionOniFade::TransitionOniFade()
|
||||
m_quadStrip.StretchTo( RectI(SCREEN_LEFT, int(CENTER_Y-30), SCREEN_RIGHT, int(CENTER_Y+30)) );
|
||||
|
||||
m_textSongInfo.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||
m_textSongInfo.TurnShadowOff();
|
||||
m_textSongInfo.EnableShadow( false );
|
||||
m_textSongInfo.SetZoom( 0.5f );
|
||||
m_textSongInfo.SetXY( CENTER_X, CENTER_Y );
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ void TransitionStarWipe::DrawPrimitives()
|
||||
SCREEN_WIDTH+SCREEN_HEIGHT/2 - x_offset + x_tilt;
|
||||
|
||||
|
||||
m_sprStar.SetRotation( bIsAnEvenRow ? PI : 0.0f ); // flip the sprite
|
||||
m_sprStar.SetRotationZ( bIsAnEvenRow ? PI : 0.0f ); // flip the sprite
|
||||
m_sprStar.SetXY( bIsAnEvenRow?x-1.0f:x+0.0f, bIsAnEvenRow?y-1.0f:y+0.0f ); // fudge. The rotation makes it off center
|
||||
m_sprStar.Draw();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user