[ScreenHowToPlay] Added CharacterName metric, which will force the Character that shows up.

This commit is contained in:
AJ Kelly
2010-12-27 00:08:52 -06:00
parent 4f5f4b92d0
commit 114e28a1d3
4 changed files with 31 additions and 24 deletions
+5
View File
@@ -13,6 +13,11 @@ _____________________________________________________________________________
sm-ssc v1.2 | 201012xx
--------------------------------------------------------------------------------
20101227
--------
* [ScreenHowToPlay] Added CharacterName metric, which will force the Character
that shows up. [freem]
20101226
--------
* [ScreenEdit] Added GetEditState Lua binding. [freem]
+1
View File
@@ -4006,6 +4006,7 @@ LifeMeterBarY=SCREEN_TOP+40
LifeMeterBarOnCommand=addy,-60;sleep,2.4;linear,0.2;addy,60
#
UseCharacter=true
CharacterName=""
CharacterX=SCREEN_CENTER_X-200
CharacterY=SCREEN_CENTER_Y+160
CharacterOnCommand=zoom,20;addy,-SCREEN_WIDTH;sleep,3.0;decelerate,0.4;addy,SCREEN_WIDTH
+15 -11
View File
@@ -23,6 +23,7 @@ static const ThemeMetric<int> NUM_MISSES ("ScreenHowToPlay","NumMisses");
static const ThemeMetric<bool> USE_CHARACTER ("ScreenHowToPlay","UseCharacter");
static const ThemeMetric<bool> USE_PAD ("ScreenHowToPlay","UsePad");
static const ThemeMetric<bool> USE_PLAYER ("ScreenHowToPlay","UsePlayer");
static const ThemeMetric<RString> CHARACTER_NAME("ScreenHowToPlay","CharacterName");
enum Animation
{
@@ -47,7 +48,6 @@ static const RString anims[NUM_ANIMATIONS] =
"BeginnerHelper_step-jumplr.bones.txt"
};
static RString GetAnimPath( Animation a )
{
return RString("Characters/") + anims[a];
@@ -92,22 +92,26 @@ void ScreenHowToPlay::Init()
CHARMAN->GetCharacters( vpCharacters );
if( (bool)USE_CHARACTER && vpCharacters.size() && HaveAllCharAnimations() )
{
Character* rndchar = CHARMAN->GetRandomCharacter();
Character* displayChar;
if( !CHARACTER_NAME.GetValue().empty() && CHARMAN->GetCharacterFromID(CHARACTER_NAME) )
displayChar = CHARMAN->GetCharacterFromID(CHARACTER_NAME);
else
displayChar = CHARMAN->GetRandomCharacter();
RString sModelPath = rndchar->GetModelPath();
RString sModelPath = displayChar->GetModelPath();
if( sModelPath != "" )
{
m_pmCharacter = new Model;
m_pmCharacter->SetName( "Character" );
m_pmCharacter->LoadMilkshapeAscii( rndchar->GetModelPath() );
m_pmCharacter->LoadMilkshapeAscii( displayChar->GetModelPath() );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-LEFT", GetAnimPath( ANIM_LEFT ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-DOWN", GetAnimPath( ANIM_DOWN ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-UP", GetAnimPath( ANIM_UP ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-RIGHT", GetAnimPath( ANIM_RIGHT ) );
m_pmCharacter->LoadMilkshapeAsciiBones( "Step-JUMPLR", GetAnimPath( ANIM_JUMPLR ) );
RString sRestFile = rndchar->GetRestAnimationPath();
RString sRestFile = displayChar->GetRestAnimationPath();
ASSERT( !sRestFile.empty() );
m_pmCharacter->LoadMilkshapeAsciiBones( "rest",rndchar->GetRestAnimationPath() );
m_pmCharacter->LoadMilkshapeAsciiBones( "rest",displayChar->GetRestAnimationPath() );
m_pmCharacter->SetDefaultAnimation( "rest" );
m_pmCharacter->PlayAnimation( "rest" ); // Stay bouncing after a step has finished animating.
@@ -189,6 +193,7 @@ ScreenHowToPlay::~ScreenHowToPlay()
void ScreenHowToPlay::Step()
{
// xxx: assumes dance. -freem
#define ST_LEFT 0x01
#define ST_DOWN 0x02
#define ST_UP 0x04
@@ -251,9 +256,9 @@ void ScreenHowToPlay::Update( float fDelta )
iLastNoteRowCounted = iCurNoteRow;
}
// once we hit the number of perfects we want, we want to fail.
// switch the controller to HUMAN. since we aren't taking input,
// the steps will always be misses.
// Once we hit the number of perfects we want, we want to fail. Switch
// the controller to HUMAN. Since we aren't taking input, the steps will
// always be misses.
if( m_iW2s > m_iNumW2s )
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PC_HUMAN;
@@ -268,7 +273,7 @@ void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_GainFocus )
{
/* We do this ourself. */
// We do this ourself.
SOUND->HandleSongTimer( false );
}
else if( SM == SM_LoseFocus )
@@ -282,7 +287,6 @@ void ScreenHowToPlay::HandleScreenMessage( const ScreenMessage SM )
ScreenAttract::HandleScreenMessage( SM );
}
// lua start
#include "LuaBinding.h"
+1 -4
View File
@@ -18,13 +18,10 @@ public:
virtual void Update( float fDelta );
virtual void HandleScreenMessage( const ScreenMessage SM );
//
// Lua
//
virtual void PushSelf( lua_State *L );
LifeMeterBar *m_pLifeMeterBar;
protected:
virtual void Step();
PlayerPlus m_Player;