Support separate X, Y, and On/OffCommand metrics. This way, positions can be overridden without having to duplicate all the commands related to animation.

This commit is contained in:
Chris Danford
2003-04-11 21:33:30 +00:00
parent 483a305c6b
commit a3513ac7f3
2 changed files with 51 additions and 38 deletions
+30 -10
View File
@@ -67,28 +67,48 @@ NextScreen2=ScreenSelectDifficulty
NextScreen3=ScreenSelectDifficulty
NextScreen4=ScreenSelectDifficulty
NextScreen5=ScreenSelectDifficulty
JointPremiumOnCommand=x,550;y,84;xoffset,400;bounceend,0.5;xoffset,-400;glowshift;effectcolor1,1,1,1,0;effectcolor2,1,1,1,0.3
JointPremiumX=550
JointPremiumY=84
JointPremiumOnCommand=xoffset,400;bounceend,0.5;xoffset,-400;glowshift;effectcolor1,1,1,1,0;effectcolor2,1,1,1,0.3
JointPremiumOffCommand=bouncebegin,0.5;xoffset,400
Icon1OnCommand=x,60;y,84;xoffset,-640;sleep,0.20;decelerate,0.3;xoffset,640
Icon1X=60
Icon1Y=84
Icon1OnCommand=xoffset,-640;sleep,0.20;decelerate,0.3;xoffset,640
Icon1OffCommand=bouncebegin,0.5;zoomy,0
Icon2OnCommand=x,140;y,84;xoffset,-640;sleep,0.15;decelerate,0.3;xoffset,640
Icon2X=140
Icon2Y=84
Icon2OnCommand=xoffset,-640;sleep,0.15;decelerate,0.3;xoffset,640
Icon2OffCommand=bouncebegin,0.5;zoomy,0
Icon3OnCommand=x,220;y,84;xoffset,-640;sleep,0.10;decelerate,0.3;xoffset,640
Icon3X=220
Icon3Y=84
Icon3OnCommand=xoffset,-640;sleep,0.10;decelerate,0.3;xoffset,640
Icon3OffCommand=bouncebegin,0.5;zoomy,0
Icon4OnCommand=x,300;y,84;xoffset,-640;sleep,0.05;decelerate,0.3;xoffset,640
Icon4X=300
Icon4Y=84
Icon4OnCommand=xoffset,-640;sleep,0.05;decelerate,0.3;xoffset,640
Icon4OffCommand=bouncebegin,0.5;zoomy,0
Icon5OnCommand=x,380;y,84;xoffset,-640;sleep,0.00;decelerate,0.3;xoffset,640
Icon5X=380
Icon5Y=84
Icon5OnCommand=xoffset,-640;sleep,0.00;decelerate,0.3;xoffset,640
Icon5OffCommand=bouncebegin,0.5;zoomy,0
IconGainFocusCommand=glowshift;effectperiod,0.5
IconLoseFocusCommand=stopeffect
DisabledColor=0.2,0.2,0.2,1
ExplanationOnCommand=x,480;y,170;xoffset,400;bounceend,0.5;xoffset,-400
ExplanationX=480
ExplanationY=170
ExplanationOnCommand=xoffset,400;bounceend,0.5;xoffset,-400
ExplanationOffCommand=bouncebegin,0.5;xoffset,400
WarningOnCommand=x,480;y,280;zoomy,0;decelerate,0.5;zoomy,1;y,400;diffuseshift;effectcolor1,1,1,1,1;effectcolor2,0.4,0.4,0.4,1
WarningX=480
WarningY=400
WarningOnCommand=yoffset,-120;zoomy,0;decelerate,0.5;zoomy,1;yoffset,120;diffuseshift;effectcolor1,1,1,1,1;effectcolor2,0.4,0.4,0.4,1
WarningOffCommand=accelerate,0.3;zoomy,0;y,280
InfoOnCommand=x,480;y,280;zoomy,0;bounceend,0.5;zoomy,1
InfoX=480
InfoY=280
InfoOnCommand=zoomy,0;bounceend,0.5;zoomy,1
InfoOffCommand=bouncebegin,0.5;zoomy,0
PictureOnCommand=x,160;y,260;diffuse,1,1,1,0;glow,1,1,1,0;linear,0.2;glow,1,1,1,1;linear,0.0;diffuse,1,1,1,1;linear,0.2;glow,1,1,1,0
PictureX=160
PictureY=260
PictureOnCommand=diffuse,1,1,1,0;glow,1,1,1,0;linear,0.2;glow,1,1,1,1;linear,0.0;diffuse,1,1,1,1;linear,0.2;glow,1,1,1,0
PictureOffCommand=linear,0.5;diffuse,1,1,1,0
[ScreenSelectStyle5th]
+21 -28
View File
@@ -18,22 +18,17 @@
#include "GameState.h"
#include "AnnouncerManager.h"
#define ACTOR_ON( actor, name ) \
actor.SetX( THEME->GetMetricF("ScreenSelectStyle",CString(name)+"X") ); \
actor.SetY( THEME->GetMetricF("ScreenSelectStyle",CString(name)+"Y") ); \
actor.Command( THEME->GetMetric("ScreenSelectStyle",CString(name)+"OnCommand") )
#define ACTOR_OFF( actor, name ) \
actor.Command( THEME->GetMetric("ScreenSelectStyle",CString(name)+"OffCommand") )
#define JOINT_PREMIUM_ON_COMMAND THEME->GetMetric ("ScreenSelectStyle","JointPremiumOnCommand")
#define JOINT_PREMIUM_OFF_COMMAND THEME->GetMetric ("ScreenSelectStyle","JointPremiumOffCommand")
#define ICON_ON_COMMAND( i ) THEME->GetMetric ("ScreenSelectStyle",ssprintf("Icon%dOnCommand",i+1))
#define ICON_OFF_COMMAND( i ) THEME->GetMetric ("ScreenSelectStyle",ssprintf("Icon%dOffCommand",i+1))
#define ICON_GAIN_FOCUS_COMMAND THEME->GetMetric ("ScreenSelectStyle","IconGainFocusCommand")
#define ICON_LOSE_FOCUS_COMMAND THEME->GetMetric ("ScreenSelectStyle","IconLoseFocusCommand")
#define DISABLED_COLOR THEME->GetMetricC("ScreenSelectStyle","DisabledColor")
#define EXPLANATION_ON_COMMAND THEME->GetMetric ("ScreenSelectStyle","ExplanationOnCommand")
#define EXPLANATION_OFF_COMMAND THEME->GetMetric ("ScreenSelectStyle","ExplanationOffCommand")
#define WARNING_ON_COMMAND THEME->GetMetric ("ScreenSelectStyle","WarningOnCommand")
#define WARNING_OFF_COMMAND THEME->GetMetric ("ScreenSelectStyle","WarningOffCommand")
#define INFO_ON_COMMAND THEME->GetMetric ("ScreenSelectStyle","InfoOnCommand")
#define INFO_OFF_COMMAND THEME->GetMetric ("ScreenSelectStyle","InfoOffCommand")
#define PICTURE_ON_COMMAND THEME->GetMetric ("ScreenSelectStyle","PictureOnCommand")
#define PICTURE_OFF_COMMAND THEME->GetMetric ("ScreenSelectStyle","PictureOffCommand")
ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
@@ -73,7 +68,6 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
if( sPicturePath != "" )
{
m_sprPicture[i].Load( sPicturePath );
// m_sprPicture[i].Command( PREVIEW_X, PREVIEW_Y );
m_sprPicture[i].SetDiffuse( RageColor(1,1,1,0) );
this->AddChild( &m_sprPicture[i] );
}
@@ -87,7 +81,6 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
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] );
}
@@ -127,12 +120,12 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
//
for( i=0; i<m_aModeChoices.size(); i++ )
{
m_textIcon[i].Command( ICON_ON_COMMAND(i) );
m_sprIcon[i].Command( ICON_ON_COMMAND(i) );
ACTOR_ON( m_textIcon[i], ssprintf("Icon%d",i+1) );
ACTOR_ON( m_sprIcon[i], ssprintf("Icon%d",i+1) );
}
m_sprExplanation.Command( EXPLANATION_ON_COMMAND );
m_sprWarning.Command( WARNING_ON_COMMAND );
m_sprJointPremium.Command( JOINT_PREMIUM_ON_COMMAND );
ACTOR_ON( m_sprExplanation, "Explanation" );
ACTOR_ON( m_sprWarning, "Warning" );
ACTOR_ON( m_sprJointPremium, "JointPremium" );
// let AfterChange tween Picture and Info
}
@@ -199,14 +192,14 @@ void ScreenSelectStyle::MenuStart( PlayerNumber pn )
for( i=0; i<m_aModeChoices.size(); i++ )
{
m_sprIcon[i].Command( ICON_OFF_COMMAND(i) );
m_textIcon[i].Command( ICON_OFF_COMMAND(i) );
ACTOR_OFF( m_sprIcon[i], ssprintf("Icon%d",i+1) );
ACTOR_OFF( m_textIcon[i], ssprintf("Icon%d",i+1) );
}
m_sprExplanation.Command( EXPLANATION_OFF_COMMAND );
m_sprWarning.Command( WARNING_OFF_COMMAND );
m_sprPicture[m_iSelection].Command( PICTURE_OFF_COMMAND );
m_sprInfo[m_iSelection].Command( INFO_OFF_COMMAND );
m_sprJointPremium.Command( JOINT_PREMIUM_OFF_COMMAND );
ACTOR_OFF( m_sprExplanation, "Explanation" );
ACTOR_OFF( m_sprWarning, "Warning" );
ACTOR_OFF( m_sprPicture[m_iSelection], "Picture" );
ACTOR_OFF( m_sprInfo[m_iSelection], "Info" );
ACTOR_OFF( m_sprJointPremium, "JointPremium" );
}
int ScreenSelectStyle::GetSelectionIndex( PlayerNumber pn )
@@ -277,6 +270,6 @@ void ScreenSelectStyle::AfterChange()
m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,1) );
m_sprPicture[m_iSelection].SetZoom( 1 );
m_sprInfo[m_iSelection].SetZoom( 1 );
m_sprPicture[m_iSelection].Command( PICTURE_ON_COMMAND );
m_sprInfo[m_iSelection].Command( INFO_ON_COMMAND );
ACTOR_ON( m_sprPicture[m_iSelection], "Picture" );
ACTOR_ON( m_sprInfo[m_iSelection], "Info" );
}