Files
itgmania212121/stepmania/src/ActiveAttackList.cpp
T

71 lines
1.6 KiB
C++
Raw Normal View History

2004-03-17 06:01:17 +00:00
#include "global.h"
/*
-----------------------------------------------------------------------------
File: ActiveAttackList.h
Desc: A graphic displayed in the ActiveAttackList during Dancing.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ActiveAttackList.h"
#include "RageUtil.h"
#include "GameState.h"
#include "ThemeManager.h"
#include "Inventory.h"
#include "RageTimer.h"
ActiveAttackList::ActiveAttackList()
{
}
void ActiveAttackList::Init( PlayerNumber pn )
{
m_PlayerNumber = pn;
}
void ActiveAttackList::Update( float fDelta )
{
BitmapText::Update( fDelta );
2004-03-24 07:37:35 +00:00
bool bTimeToUpdate =
GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ||
GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber];
2004-03-17 06:01:17 +00:00
2004-03-24 07:13:35 +00:00
if( bTimeToUpdate )
2004-03-17 06:01:17 +00:00
{
CString s;
const AttackArray& attacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS
// clear all lines, then add all active attacks
2004-03-17 06:26:01 +00:00
for( unsigned i=0; i<attacks.size(); i++ )
2004-03-17 06:01:17 +00:00
{
const Attack& attack = attacks[i];
if( !attack.bOn )
continue; /* hasn't started yet */
2004-03-21 18:49:25 +00:00
CString sMods = attack.sModifier;
CStringArray asMods;
split( sMods, ", ", asMods );
2004-03-22 00:54:31 +00:00
for( unsigned j=0; j<asMods.size(); j++ )
{
2004-03-21 18:49:25 +00:00
CString& sMod = asMods[j];
2004-05-02 11:54:16 +00:00
sMod = PlayerOptions::ThemeMod( sMod );
2004-04-17 22:21:40 +00:00
2004-03-21 18:49:25 +00:00
if( s.empty() )
s = sMod;
else
s = sMod + "\n" + s;
}
2004-03-17 06:01:17 +00:00
}
this->SetText( s ); // BitmapText will not rebuild vertices if these strings are the same.
}
}