add DisplayName

This commit is contained in:
Chris Danford
2005-08-14 01:51:09 +00:00
parent 9bed5de7e9
commit 3fd1091159
2 changed files with 25 additions and 7 deletions
+13 -4
View File
@@ -11,18 +11,27 @@ bool Character::Load( CString sCharDir )
sCharDir += "/";
m_sCharDir = sCharDir;
// Save character name
vector<CString> as;
split( sCharDir, "/", as );
m_sName = as.back();
// save ID
{
vector<CString> as;
split( sCharDir, "/", as );
m_sCharacterID = as.back();
}
// Save attacks
IniFile ini;
if( !ini.ReadFile( sCharDir+"character.ini" ) )
return false;
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
{
for( int j=0; j<NUM_ATTACKS_PER_LEVEL; j++ )
ini.GetValue( "Character", ssprintf("Level%dAttack%d",i+1,j+1), m_sAttacks[i][j] );
}
// get display name (if any)
ini.GetValue( "Character", "DisplayName", m_sDisplayName );
return true;
}
+12 -3
View File
@@ -28,15 +28,24 @@ public:
CString GetStageIconPath() const;
bool Has2DElems();
bool IsDefaultCharacter() const
{
return m_sCharacterID.CompareNoCase("default") == 0;
}
//
// Lua
//
void PushSelf( Lua *L );
// smart accessor
const CString &GetDisplayName() { return !m_sDisplayName.empty() ? m_sDisplayName : m_sCharacterID; }
CString m_sCharDir;
CString m_sName;
CString m_sCharacterID;
private:
CString m_sDisplayName;
public:
// All the stuff below will be filled in if this character is playable in Rave mode
bool m_bUsableInRave;