From b5553c9ab57575f0b08886e0374435da3f4bba69 Mon Sep 17 00:00:00 2001 From: Thad Ward Date: Tue, 26 Aug 2003 14:58:41 +0000 Subject: [PATCH] fix up ScreenSelectCharacter a bit and enable it for normal game mode. --- stepmania/Themes/default/metrics.ini | 34 ++++++++++------ stepmania/src/ScreenSelectCharacter.cpp | 54 +++++++++++++++++-------- 2 files changed, 58 insertions(+), 30 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index a27ff933b0..c307d8d9db 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -503,7 +503,8 @@ CropWidth=146 InitCommand=horizalign,left;vertalign,top;shadowlength,2;zoom,0.5; [ScreenInstructions] -NextScreenArcade=ScreenSelectMusic +#NextScreenArcade=ScreenSelectMusic +NextScreenArcade=ScreenSelectCharacter NextScreenNonstop=ScreenSelectCourse NextScreenOni=ScreenSelectCourse NextScreenEndless=ScreenSelectCourse @@ -2373,30 +2374,37 @@ NextScreen=ScreenCompany [ScreenSelectCharacter] TitleP1OnCommand=x,140;y,80;addx,-400;bounceend,0.5;addx,400 -TitleP1OffCommand=sleep,0.6;bouncebegin,0.5;addx,-400 +TitleP1OffCommand=sleep,0.2;bouncebegin,0.5;addx,-400 TitleP2OnCommand=x,500;y,80;addx,400;bounceend,0.5;addx,-400 -TitleP2OffCommand=sleep,0.6;bouncebegin,0.5;addx,400 +TitleP2OffCommand=sleep,0.2;bouncebegin,0.5;addx,400 CharacterP1OnCommand=x,140;y,180;addx,-400;bounceend,0.5;addx,400 -CharacterP1OffCommand=sleep,0.6;bouncebegin,0.5;addx,-400 +CharacterP1OffCommand=sleep,0.2;bouncebegin,0.5;addx,-400 CharacterP2OnCommand=x,500;y,180;addx,400;bounceend,0.5;addx,-400 -CharacterP2OffCommand=sleep,0.6;bouncebegin,0.5;addx,400 -CharacterArrowsP1OnCommand=x,140;y,180 -CharacterArrowsP1OffCommand= -CharacterArrowsP2OnCommand=x,500;y,180 -CharacterArrowsP2OffCommand= +CharacterP2OffCommand=sleep,0.2;bouncebegin,0.5;addx,400 +CharacterArrowsP1OnCommand=x,140;y,180;diffusealpha,0;linear,0.3;diffusealpha,1 +CharacterArrowsP1OffCommand=linear,0.3;diffusealpha,0 +CharacterArrowsP2OnCommand=x,500;y,180;diffusealpha,0;linear,0.3;diffusealpha,1 +CharacterArrowsP2OffCommand=linear,0.3;diffusealpha,0 ExplanationOnCommand=x,320;y,140;diffusealpha,0;linear,0.3;diffusealpha,1 ExplanationOffCommand=linear,0.3;diffusealpha,0 -AttackFrameP1OnCommand=x,140;y,380 -AttackFrameP1OffCommand= -AttackFrameP2OnCommand=x,500;y,380 -AttackFrameP2OffCommand= +AttackFrameP1OnCommand=x,140;y,380;addx,-400;bounceend,0.5;addx,400 +AttackFrameP1OffCommand=sleep,0.2;bouncebegin,0.5;addx,-400 +AttackFrameP2OnCommand=x,500;y,380;addx,400;bounceend,0.5;addx,-400 +AttackFrameP2OffCommand=sleep,0.2;bouncebegin,0.5;addx,400 IconsP1StartX=128 IconsP1StartY=356 IconsP2StartX=488 IconsP2StartY=356 IconsSpacingX=42 IconsSpacingY=32 +# DO NOT set absolute X or Y coords in these tweens. they are set based on +# the above 6 metrics. you can use addx and addy still. +IconsP1OnCommand=addx,-400;bounceend,0.5;addx,400 +IconsP1OffCommand=sleep,0.2;bouncebegin,0.5;addx,-400 +IconsP2OnCommand=addx,400;bounceend,0.5;addx,-400 +IconsP2OffCommand=sleep,0.2;bouncebegin,0.5;addx,400 HelpText=Use &LEFT; &RIGHT; to select, then press START +SleepAfterTweenOffSeconds=0.8 TimerSeconds=40 NextScreen=ScreenSelectMusic diff --git a/stepmania/src/ScreenSelectCharacter.cpp b/stepmania/src/ScreenSelectCharacter.cpp index f5e9136bc7..d2ee751008 100644 --- a/stepmania/src/ScreenSelectCharacter.cpp +++ b/stepmania/src/ScreenSelectCharacter.cpp @@ -36,9 +36,12 @@ #define ICONS_START_Y( p ) THEME->GetMetricF("ScreenSelectCharacter",ssprintf("IconsP%dStartY",p+1)) #define ICONS_SPACING_X THEME->GetMetricF("ScreenSelectCharacter","IconsSpacingX") #define ICONS_SPACING_Y THEME->GetMetricF("ScreenSelectCharacter","IconsSpacingY") +#define ICONS_ON_COMMAND( p ) THEME->GetMetric ("ScreenSelectCharacter",ssprintf("IconsP%dOnCommand",p+1)) +#define ICONS_OFF_COMMAND( p ) THEME->GetMetric ("ScreenSelectCharacter",ssprintf("IconsP%dOffCommand",p+1)) #define HELP_TEXT THEME->GetMetric ("ScreenSelectCharacter","HelpText") #define TIMER_SECONDS THEME->GetMetricI("ScreenSelectCharacter","TimerSeconds") #define NEXT_SCREEN THEME->GetMetric ("ScreenSelectCharacter","NextScreen") +#define SLEEP_AFTER_TWEEN_OFF_SECONDS THEME->GetMetricF("ScreenSelectCharacter","SleepAfterTweenOffSeconds") #define LEVEL_CURSOR_X( p, l ) ( ICONS_START_X(p)+ICONS_SPACING_X*((NUM_ATTACKS_PER_LEVEL-1)/2.f) ) #define LEVEL_CURSOR_Y( p, l ) ( ICONS_START_Y(p)+ICONS_SPACING_Y*l ) @@ -74,6 +77,9 @@ ScreenSelectCharacter::ScreenSelectCharacter() : Screen("ScreenSelectCharacter") for( p=0; pIsPlayerEnabled(p) ) + continue; + m_sprTitle[p].Load( THEME->GetPathToG("ScreenSelectCharacter title 2x2") ); m_sprTitle[p].SetState( GAMESTATE->IsHumanPlayer(p) ? p : 2+p ); m_sprTitle[p].StopAnimating(); @@ -88,20 +94,24 @@ ScreenSelectCharacter::ScreenSelectCharacter() : Screen("ScreenSelectCharacter") m_sprCharacterArrows[p].Command( CHARACTER_ARROWS_ON_COMMAND(p) ); this->AddChild( &m_sprCharacterArrows[p] ); - m_sprAttackFrame[p].Load( THEME->GetPathToG("ScreenSelectCharacter attack frame 1x2") ); - m_sprAttackFrame[p].StopAnimating(); - m_sprAttackFrame[p].SetState( p ); - m_sprAttackFrame[p].Command( ATTACK_FRAME_ON_COMMAND(p) ); - this->AddChild( &m_sprAttackFrame[p] ); + if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) + { + m_sprAttackFrame[p].Load( THEME->GetPathToG("ScreenSelectCharacter attack frame 1x2") ); + m_sprAttackFrame[p].StopAnimating(); + m_sprAttackFrame[p].SetState( p ); + m_sprAttackFrame[p].Command( ATTACK_FRAME_ON_COMMAND(p) ); + this->AddChild( &m_sprAttackFrame[p] ); - for( int i=0; iAddChild( &m_AttackIcons[p][i][j] ); - } + for( int i=0; iAddChild( &m_AttackIcons[p][i][j] ); + } + } } m_sprExplanation.Load( THEME->GetPathToG("ScreenSelectCharacter explanation") ); @@ -224,9 +234,10 @@ void ScreenSelectCharacter::AfterValueChange( PlayerNumber pn ) m_sprCharacter[pnAffected].UnloadTexture(); m_sprCharacter[pnAffected].Load( pChar->GetCardPath() ); - for( int i=0; im_sAttacks[i][j] ); + if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) + for( int i=0; im_sAttacks[i][j] ); } break; case FINISHED_CHOOSING: @@ -310,7 +321,7 @@ void ScreenSelectCharacter::MenuStart( PlayerNumber pn ) m_Menu.m_MenuTimer.Stop(); TweenOffScreen(); - this->PostScreenMessage( SM_BeginFadingOut, 0 ); + this->PostScreenMessage( SM_BeginFadingOut, SLEEP_AFTER_TWEEN_OFF_SECONDS ); } } @@ -324,6 +335,15 @@ void ScreenSelectCharacter::TweenOffScreen() for( int p=0; pm_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE) + { + m_sprAttackFrame[p].Command( ATTACK_FRAME_OFF_COMMAND(p) ); + for( int i=0; i