move PlayerName texts out of code and into BGAnimations

This commit is contained in:
Chris Danford
2005-02-13 01:16:17 +00:00
parent 4264182ea1
commit 12fde5d55c
11 changed files with 38 additions and 88 deletions
-32
View File
@@ -1104,14 +1104,6 @@ PlayerOptionsP2X=SCREEN_CENTER_X+0
PlayerOptionsP2Y=SCREEN_CENTER_Y+210
PlayerOptionsP2OnCommand=zoom,0.5;addy,100;sleep,0.5;linear,1;addy,-100
PlayerOptionsP2OffCommand=linear,1;addy,100
PlayerNameP1X=
PlayerNameP1Y=
PlayerNameP1OnCommand=hidden,1
PlayerNameP1OffCommand=
PlayerNameP2X=
PlayerNameP2Y=
PlayerNameP2OnCommand=hidden,1
PlayerNameP2OffCommand=
ScoreboardC1P1X=SCREEN_CENTER_X-260
ScoreboardC1P1Y=SCREEN_CENTER_Y-160
ScoreboardC1P1OnCommand=zoom,1
@@ -1316,14 +1308,6 @@ Class=ScreenEvaluation
FailedSoundTime=0
PassedSoundTime=0
NumSequenceSounds=0
PlayerNameP1X=
PlayerNameP1Y=
PlayerNameP1OnCommand=hidden,1
PlayerNameP1OffCommand=
PlayerNameP2X=
PlayerNameP2Y=
PlayerNameP2OnCommand=hidden,1
PlayerNameP2OffCommand=
DisqualifiedP1X=
DisqualifiedP1Y=
DisqualifiedP1OnCommand=hidden,1
@@ -1525,14 +1509,6 @@ ShowMaxCombo=1
ShowScoreArea=1
ShowTimeArea=0
TimerSeconds=15
PlayerNameP1X=
PlayerNameP1Y=
PlayerNameP1OnCommand=hidden,1
PlayerNameP1OffCommand=
PlayerNameP2X=
PlayerNameP2Y=
PlayerNameP2OnCommand=hidden,1
PlayerNameP2OffCommand=
LargeBannerX=SCREEN_CENTER_X+0
LargeBannerY=SCREEN_CENTER_Y-140
LargeBannerOnCommand=addy,SCREEN_HEIGHT;sleep,0.0;decelerate,0.3;addy,-SCREEN_HEIGHT
@@ -2465,14 +2441,6 @@ DisqualifyP2X=
DisqualifyP2Y=
DisqualifyP2OnCommand=hidden,1
DisqualifyP2OffCommand=
PlayerNameP1X=
PlayerNameP1Y=
PlayerNameP1OnCommand=hidden,1
PlayerNameP1OffCommand=
PlayerNameP2X=
PlayerNameP2Y=
PlayerNameP2OnCommand=hidden,1
PlayerNameP2OffCommand=
PageX=SCREEN_CENTER_X
PageY=SCREEN_CENTER_Y
PageOnCommand=
+31
View File
@@ -531,6 +531,37 @@ bool ProfileManager::IsUsingProfile( ProfileSlot slot ) const
}
}
// lua start
#include "LuaBinding.h"
template<class T>
class LunaProfileManager : public Luna<T>
{
public:
LunaProfileManager() { LUA->Register( Register ); }
static int IsUsingProfile( T* p, lua_State *L ) { lua_pushboolean(L, p->IsUsingProfile((PlayerNumber)IArg(1)) ); return 1; }
static void Register(lua_State *L)
{
ADD_METHOD( IsUsingProfile )
Luna<T>::Register( L );
// Add global singleton if constructed already. If it's not constructed yet,
// then we'll register it later when we reload the theme just before
// initializing the display.
if( PROFILEMAN )
{
lua_pushstring(L, "PROFILEMAN");
THEME->PushSelf( LUA->L );
lua_settable(L, LUA_GLOBALSINDEX);
}
}
};
LUA_REGISTER_CLASS( ProfileManager )
// lua end
/*
* (c) 2003-2004 Chris Danford
* All rights reserved.
+3
View File
@@ -9,6 +9,7 @@
class Song;
class Style;
struct lua_State;
class ProfileManager
{
@@ -83,6 +84,8 @@ public:
void IncrementCategoryPlayCount( StepsType st, RankingCategory rc, PlayerNumber pn );
// Lua
virtual void PushSelf( lua_State *L );
private:
bool LoadProfile( PlayerNumber pn, CString sProfileDir, bool bIsMemCard );
-6
View File
@@ -208,12 +208,6 @@ ScreenEnding::ScreenEnding( CString sClassName ) : ScreenAttract( sClassName, fa
Profile* pProfile = PROFILEMAN->GetProfile( p );
m_textPlayerName[p].LoadFromFont( THEME->GetPathF("ScreenEnding","player name") );
m_textPlayerName[p].SetText( pProfile ? pProfile->GetDisplayName() : CString("NO CARD") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%d",p+1) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
this->AddChild( &m_textPlayerName[p] );
m_bWaitingForRemoveCard[p] = true;
switch( MEMCARDMAN->GetCardState(p) )
{
-1
View File
@@ -31,7 +31,6 @@ public:
void HandleScreenMessage( const ScreenMessage SM );
private:
BitmapText m_textPlayerName[NUM_PLAYERS];
struct Line
{
BitmapText title;
-18
View File
@@ -297,18 +297,6 @@ void ScreenEvaluation::Init()
m_soundStart.Load( THEME->GetPathS("ScreenEvaluation","start") );
//
// init player name area
//
FOREACH_EnabledPlayer( p )
{
m_textPlayerName[p].LoadFromFont( THEME->GetPathF(m_sName,"PlayerName") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%d",p+1) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName(p) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
this->AddChild( &m_textPlayerName[p] );
}
//
// init banner area
//
@@ -1117,12 +1105,6 @@ void ScreenEvaluation::CommitScores(
void ScreenEvaluation::TweenOffScreen()
{
// player name area
FOREACH_EnabledPlayer( p )
{
OFF_COMMAND( m_textPlayerName[p] );
}
// large banner area
OFF_COMMAND( m_LargeBanner );
OFF_COMMAND( m_sprLargeBannerFrame );
-3
View File
@@ -65,9 +65,6 @@ protected:
ConditionalBGA m_bgCondBga;
// player name area
BitmapText m_textPlayerName[NUM_PLAYERS];
// banner area
Banner m_LargeBanner;
AutoActor m_sprLargeBannerFrame;
-13
View File
@@ -504,15 +504,6 @@ void ScreenGameplay::Init()
SET_XY( m_textCourseSongNumber[p] );
m_textCourseSongNumber[p].SetText( "" );
m_textCourseSongNumber[p].SetDiffuse( RageColor(0,0.5f,1,1) ); // light blue
if( GAMESTATE->m_PlayMode == PLAY_MODE_RAVE )
{
m_textPlayerName[p].LoadFromFont( THEME->GetPathF(m_sName,"player") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%i",p+1) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName(p) );
SET_XY( m_textPlayerName[p] );
this->AddChild( &m_textPlayerName[p] );
}
}
FOREACH_EnabledPlayer(p)
@@ -2432,8 +2423,6 @@ void ScreenGameplay::TweenOnScreen()
if( !GAMESTATE->IsPlayerEnabled(p) )
continue;
ON_COMMAND( m_textCourseSongNumber[p] );
if( GAMESTATE->m_PlayMode == PLAY_MODE_RAVE )
ON_COMMAND( m_textPlayerName[p] );
ON_COMMAND( m_textStepsDescription[p] );
if( m_pPrimaryScoreDisplay[p] )
ON_COMMAND( *m_pPrimaryScoreDisplay[p] );
@@ -2474,8 +2463,6 @@ void ScreenGameplay::TweenOffScreen()
if( !GAMESTATE->IsPlayerEnabled(p) )
continue;
OFF_COMMAND( m_textCourseSongNumber[p] );
if( GAMESTATE->m_PlayMode == PLAY_MODE_RAVE )
OFF_COMMAND( m_textPlayerName[p] );
OFF_COMMAND( m_textStepsDescription[p] );
if( m_pPrimaryScoreDisplay[p] )
OFF_COMMAND( *m_pPrimaryScoreDisplay[p] );
-1
View File
@@ -93,7 +93,6 @@ protected:
Sprite m_sprCourseSongNumber;
AutoActor m_sprStageFrame;
BitmapText m_textCourseSongNumber[NUM_PLAYERS];
BitmapText m_textPlayerName[NUM_PLAYERS];
BitmapText m_textStepsDescription[NUM_PLAYERS];
BPMDisplay m_BPMDisplay;
-14
View File
@@ -412,20 +412,6 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowDefinition defs[], int iNum
m_framePage.AddChild( &m_textExplanation[p] );
}
/* Hack: if m_CurStyle is set, we're probably in the player or song options menu, so
* the player name is meaningful. Otherwise, we're probably in the system menu. */
if( GAMESTATE->m_pCurStyle != NULL )
{
FOREACH_HumanPlayer( p )
{
m_textPlayerName[p].LoadFromFont( THEME->GetPathF(m_sName,"player") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%i",p+1) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName(p) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
m_framePage.AddChild( &m_textPlayerName[p] );
}
}
if( SHOW_SCROLL_BAR )
{
m_ScrollBar.SetName( "DualScrollBar", "ScrollBar" );
+4
View File
@@ -1089,6 +1089,10 @@ int main(int argc, char* argv[])
NSMAN = new NetworkSyncManager( loading_window );
MESSAGEMAN = new MessageManager;
// UGLY: Reload the current theme now that all global singletons are
// constructed so that they can be registered with Lua.
THEME->SwitchThemeAndLanguage( THEME->GetCurThemeName(), THEME->GetCurLanguage() );
SAFE_DELETE( loading_window ); // destroy this before init'ing Display
DISPLAY = CreateDisplay();