#include "global.h" /* ----------------------------------------------------------------------------- File: ActiveItemList.h Desc: A graphic displayed in the ActiveItemList during Dancing. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "ActiveItemList.h" #include "RageUtil.h" #include "GameState.h" #include "ThemeManager.h" #include "Inventory.h" #include "RageTimer.h" #define TEXT_HORIZ_ALIGN( p ) THEME->GetMetricI("ActiveItemList",ssprintf("TextHorizAlignP%d",p+1)) #define TEXT_ZOOM THEME->GetMetricF("ActiveItemList","TextZoom") #define SPACING_Y THEME->GetMetricF("ActiveItemList","SpacingY") ActiveItemList::ActiveItemList() { } void ActiveItemList::Init( PlayerNumber pn ) { m_PlayerNumber = pn; int i; for( i=0; iGetPathToF("Common normal") ); m_text[i].SetZoom( TEXT_ZOOM ); // m_text[i].SetText( "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW" ); this->AddChild( &m_text[i] ); } for( i=0; im_PlayerOptions[pn].m_fReverseScroll == 1; float fHeight = SPACING_Y*MAX_ACTIVE_ITEMS_LINES * (bReverse ? 1 : -1 ); float fY = SCALE(i,0.f,MAX_ACTIVE_ITEMS_LINES,0.f,fHeight); m_text[i].SetY( fY ); } } void ActiveItemList::Update( float fDelta ) { ActorFrame::Update( fDelta ); // refresh text only once every second float fNowSeconds = RageTimer::GetTimeSinceStart(); float fLastSeconds = RageTimer::GetTimeSinceStart() - fDelta; if( (int)fNowSeconds != (int)fLastSeconds ) { GameState::Attack* sActiveAttacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS for( int s=0; s