From 09e6b85f3b30d7a9774917cf6ea6527e35598505 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 17 Mar 2004 06:01:17 +0000 Subject: [PATCH] add ActiveAttackList --- .../ScreenGameplay ActiveAttackList.redir | 1 + stepmania/Themes/default/metrics.ini | 40 ++------- stepmania/src/ActiveAttackList.cpp | 61 +++++++++++++ stepmania/src/ActiveAttackList.h | 32 +++++++ stepmania/src/MenuElements.cpp | 2 +- stepmania/src/PlayerOptions.cpp | 1 + stepmania/src/ScreenGameplay.cpp | 12 +++ stepmania/src/ScreenGameplay.h | 2 + stepmania/src/ScreenNameEntryTraditional.cpp | 3 + stepmania/src/StepMania.dsp | 85 ++++++++++++------- stepmania/src/StepMania.vcproj | 18 ++++ 11 files changed, 195 insertions(+), 62 deletions(-) create mode 100644 stepmania/Themes/default/Fonts/ScreenGameplay ActiveAttackList.redir create mode 100644 stepmania/src/ActiveAttackList.cpp create mode 100644 stepmania/src/ActiveAttackList.h diff --git a/stepmania/Themes/default/Fonts/ScreenGameplay ActiveAttackList.redir b/stepmania/Themes/default/Fonts/ScreenGameplay ActiveAttackList.redir new file mode 100644 index 0000000000..ca24092074 --- /dev/null +++ b/stepmania/Themes/default/Fonts/ScreenGameplay ActiveAttackList.redir @@ -0,0 +1 @@ +Common normal diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index ff265b4e89..729753ca56 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -1097,38 +1097,14 @@ LyricsReverseY=100 LyricsOneReverseX=320 LyricsOneReverseY=35 LyricsDefaultColor=0,1,0,1 -ActiveItemsP1X=0 -ActiveItemsP1Y=0 -ActiveItemsP1OnCommand= -ActiveItemsP1OffCommand= -ActiveItemsP1ReverseX=0 -ActiveItemsP1ReverseY=0 -ActiveItemsP1ReverseOnCommand= -ActiveItemsP1ReverseOffCommand= -ActiveItemsP1ExtraX=0 -ActiveItemsP1ExtraY=0 -ActiveItemsP1ExtraOnCommand= -ActiveItemsP1ExtraOffCommand= -ActiveItemsP1ExtraReverseX=0 -ActiveItemsP1ExtraReverseY=0 -ActiveItemsP1ExtraReverseOnCommand= -ActiveItemsP1ExtraReverseOffCommand= -ActiveItemsP2X=0 -ActiveItemsP2Y=0 -ActiveItemsP2OnCommand= -ActiveItemsP2OffCommand= -ActiveItemsP2ReverseX=0 -ActiveItemsP2ReverseY=0 -ActiveItemsP2ReverseOnCommand= -ActiveItemsP2ReverseOffCommand= -ActiveItemsP2ExtraX=0 -ActiveItemsP2ExtraY=0 -ActiveItemsP2ExtraOnCommand= -ActiveItemsP2ExtraOffCommand= -ActiveItemsP2ExtraReverseX=0 -ActiveItemsP2ExtraReverseY=0 -ActiveItemsP2ExtraReverseOnCommand= -ActiveItemsP2ExtraReverseOffCommand= +ActiveAttackListP1X= +ActiveAttackListP1Y= +ActiveAttackListP1OnCommand=hidden,1 +ActiveAttackListP1OffCommand= +ActiveAttackListP2X= +ActiveAttackListP2Y= +ActiveAttackListP2OnCommand=hidden,1 +ActiveAttackListP2OffCommand= SurviveTimeX=320 SurviveTimeY=340 SurviveTimeOnCommand=sleep,0.3;linear,0.3;diffusealpha,1;sleep,3.5;linear,0.5;diffusealpha,0 diff --git a/stepmania/src/ActiveAttackList.cpp b/stepmania/src/ActiveAttackList.cpp new file mode 100644 index 0000000000..ac994bdeb2 --- /dev/null +++ b/stepmania/src/ActiveAttackList.cpp @@ -0,0 +1,61 @@ +#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 ); + + // refresh text only once every second + float fNowSeconds = RageTimer::GetTimeSinceStart(); + float fLastSeconds = RageTimer::GetTimeSinceStart() - fDelta; + + if( (int)fNowSeconds != (int)fLastSeconds ) + { + CString s; + + const AttackArray& attacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS + + // clear all lines, then add all active attacks + for( int i=0; iSetText( s ); // BitmapText will not rebuild vertices if these strings are the same. + } +} diff --git a/stepmania/src/ActiveAttackList.h b/stepmania/src/ActiveAttackList.h new file mode 100644 index 0000000000..48d9c90e56 --- /dev/null +++ b/stepmania/src/ActiveAttackList.h @@ -0,0 +1,32 @@ +#ifndef _ActiveAttackList_H_ +#define _ActiveAttackList_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 "BitmapText.h" +#include "PlayerNumber.h" + + +class ActiveAttackList : public BitmapText +{ +public: + ActiveAttackList(); + + void Init( PlayerNumber pn ); + + virtual void Update( float fDelta ); + +protected: + + PlayerNumber m_PlayerNumber; +}; + +#endif diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index 5aeebba94e..b85d5a2049 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -184,11 +184,11 @@ void MenuElements::DrawTopLayer() m_autoHeader->Draw(); m_sprStyleIcon.Draw(); + m_autoFooter->Draw(); for( int p=0; pDraw(); - m_autoFooter->Draw(); m_textHelp->Draw(); m_In.Draw(); m_Out.Draw(); diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index 384362248d..27e968b322 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -552,6 +552,7 @@ bool PlayerOptions::IsHandicapForSong( Song* pSong ) if( m_bTransforms[TRANSFORM_NOQUADS] ) return true; if( m_bTransforms[TRANSFORM_PLANTED] ) return true; if( m_bTransforms[TRANSFORM_TWISTER] ) return true; + if( m_bTransforms[TRANSFORM_ECHO] ) return true; return false; } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d4f8c859e2..dbe58682f8 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -593,6 +593,16 @@ void ScreenGameplay::Init() m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() ); this->AddChild( &m_textSongOptions ); + { + FOREACH_EnabledPlayer( pn ) + { + m_ActiveAttackList[pn].LoadFromFont( THEME->GetPathF(m_sName,"ActiveAttackList") ); + m_ActiveAttackList[pn].Init( pn ); + m_ActiveAttackList[pn].SetName( ssprintf("ActiveAttackListP%d",pn+1) ); + SET_XY( m_ActiveAttackList[pn] ); + this->AddChild( &m_ActiveAttackList[pn] ); + } + } @@ -2244,6 +2254,7 @@ void ScreenGameplay::TweenOnScreen() if( m_pSecondaryScoreDisplay[p] ) ON_COMMAND( *m_pSecondaryScoreDisplay[p] ); ON_COMMAND( m_textPlayerOptions[p] ); + ON_COMMAND( m_ActiveAttackList[p] ); ON_COMMAND( m_DifficultyIcon[p] ); } m_Overlay.PlayCommand("On"); @@ -2276,6 +2287,7 @@ void ScreenGameplay::TweenOffScreen() if( m_pSecondaryScoreDisplay[p] ) OFF_COMMAND( *m_pSecondaryScoreDisplay[p] ); OFF_COMMAND( m_textPlayerOptions[p] ); + OFF_COMMAND( m_ActiveAttackList[p] ); OFF_COMMAND( m_DifficultyIcon[p] ); } m_Overlay.PlayCommand("Off"); diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 25b2a9bc75..6db8c6242b 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -31,6 +31,7 @@ class Inventory; #include "Character.h" #include "Attack.h" #include "MeterDisplay.h" +#include "ActiveAttackList.h" // messages sent by Combo const ScreenMessage SM_PlayToasty = ScreenMessage(SM_User+104); @@ -132,6 +133,7 @@ protected: ScoreKeeper* m_pSecondaryScoreKeeper[NUM_PLAYERS]; BitmapText m_textPlayerOptions[NUM_PLAYERS]; BitmapText m_textSongOptions; + ActiveAttackList m_ActiveAttackList[NUM_PLAYERS]; BitmapText m_textDebug; diff --git a/stepmania/src/ScreenNameEntryTraditional.cpp b/stepmania/src/ScreenNameEntryTraditional.cpp index e5de0c6f0e..44f0711442 100644 --- a/stepmania/src/ScreenNameEntryTraditional.cpp +++ b/stepmania/src/ScreenNameEntryTraditional.cpp @@ -63,12 +63,14 @@ void HighScoreWheelItem::Load( int iRankIndex, const HighScore& hs ) m_textRank.SetName( "Rank" ); m_textRank.LoadFromFont( THEME->GetPathF(m_sName,"rank") ); m_textRank.SetText( ssprintf("%d", iRankIndex+1) ); + m_textRank.SetShadowLength( 2 ); this->AddChild( &m_textRank ); SET_XY_AND_ON_COMMAND( m_textRank ); m_textName.SetName( "Name" ); m_textName.LoadFromFont( THEME->GetPathF(m_sName,"name") ); m_textName.SetText( hs.GetDisplayName() ); + m_textName.SetShadowLength( 2 ); this->AddChild( &m_textName ); SET_XY_AND_ON_COMMAND( m_textName ); @@ -78,6 +80,7 @@ void HighScoreWheelItem::Load( int iRankIndex, const HighScore& hs ) m_textScore.SetText( ssprintf("%.2f%%", hs.fPercentDP*100) ); else m_textScore.SetText( ssprintf("%i", hs.iScore) ); + m_textScore.SetShadowLength( 2 ); this->AddChild( &m_textScore ); SET_XY_AND_ON_COMMAND( m_textScore ); } diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index e1fe9db67f..ada6f0c4e3 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -1,5 +1,5 @@ # Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# Microsoft Developer Studio Generated Build File, Format Version 60000 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -62,10 +62,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # Begin Special Build Tool IntDir=.\../Debug6 -TargetDir=\stepmania2\stepmania\Program +TargetDir=\stepmania\stepmania\Program TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -82,23 +82,27 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # PROP Intermediate_Dir "../Debug_Xbox" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -XBCP=xbecopy.exe -# ADD BASE XBCP /NOLOGO -# ADD XBCP /NOLOGO -XBE=imagebld.exe -# ADD BASE XBE /nologo /stack:0x10000 /debug -# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "_DEBUG" /D "_XBOX" /D "OGG_ONLY" /D "DEBUG" /FR /YX"global.h" /FD /G6 /Ztmp /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /incremental:no /debug /machine:I386 /subsystem:xbox /fixed:no /TMP # ADD LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /map /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"../StepManiaXbox-debug.exe" /subsystem:xbox /fixed:no /TMP # SUBTRACT LINK32 /incremental:no -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_XBOX" /D "_DEBUG" /YX /FD /G6 /Ztmp /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "_DEBUG" /D "_XBOX" /D "OGG_ONLY" /D "DEBUG" /FR /YX"global.h" /FD /G6 /Ztmp /c +XBE=imagebld.exe +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /stack:0x10000 /debug /out:"../default.xbe" +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO # Begin Special Build Tool +IntDir=.\../Debug_Xbox +TargetDir=\stepmania\stepmania +TargetName=default +SOURCE="$(InputPath)" PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -135,10 +139,10 @@ LINK32=link.exe # SUBTRACT LINK32 /verbose /pdb:none /debug # Begin Special Build Tool IntDir=.\../Release6 -TargetDir=\stepmania2\stepmania\Program +TargetDir=\stepmania\stepmania\Program TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -156,24 +160,28 @@ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania # PROP Intermediate_Dir "../Release_Xbox" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -XBCP=xbecopy.exe -# ADD BASE XBCP /NOLOGO -# ADD XBCP /NOLOGO -XBE=imagebld.exe -# ADD BASE XBE /nologo /stack:0x10000 /debug -# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe" +CPP=cl.exe +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "NDEBUG" /D "_XBOX" /FR /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 $(intdir)\verstub.obj xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib /nologo /pdb:"../debug6/StepMania-debug.pdb" /map /debug /machine:IX86 /nodefaultlib:"libcmtd.lib" /out:"../StepMania-debug.exe" # SUBTRACT BASE LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # ADD LINK32 $(intdir)\verstub.obj xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xnet.lib xboxkrnl.lib libcmt.lib /nologo /incremental:no /map /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"../StepManiaXbox.exe" /subsystem:xbox /fixed:no /TMP /OPT:REF # SUBTRACT LINK32 /pdb:none /debug -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /D "WIN32" /D "_XBOX" /D "_DEBUG" /Fr /YX"global.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "SDL-1.2.5\include" /I "SDL_image-1.2" /I "plib-1.6.0" /I "SDL_sound-1.0.0" /I "vorbis" /D "WIN32" /D "NDEBUG" /D "_XBOX" /FR /YX /FD /c +XBE=imagebld.exe +# ADD BASE XBE /nologo /stack:0x10000 /debug +# ADD XBE /nologo /testid:"123456" /stack:0x10000 /debug /out:"../default.xbe" +XBCP=xbecopy.exe +# ADD BASE XBCP /NOLOGO +# ADD XBCP /NOLOGO # Begin Special Build Tool +IntDir=.\../Release_Xbox +TargetDir=\stepmania\stepmania +TargetName=default +SOURCE="$(InputPath)" PreLink_Cmds=disasm\verinc cl /Zl /nologo /c PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -3337,6 +3345,25 @@ SOURCE=.\Transition.h # PROP Default_Filter "" # Begin Source File +SOURCE=.\ActiveAttackList.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\ActiveAttackList.h +# End Source File +# Begin Source File + SOURCE=.\ArrowEffects.cpp !IF "$(CFG)" == "StepMania - Win32 Debug" diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 9c3f4033f4..94b17bce38 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -1442,6 +1442,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + @@ -2065,6 +2071,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + + @@ -2107,6 +2119,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ + + + +