From 47bd0d15324ce3bff765596f6411caebb1991ecb Mon Sep 17 00:00:00 2001 From: Andrew Livy Date: Fri, 12 Jul 2002 17:46:15 +0000 Subject: [PATCH] Lifebar colors for ez2dancer inplace --- stepmania/src/LifeMeterBar.cpp | 31 ++++++++++++++--- stepmania/src/ScreenEz2SelectPlayer.cpp | 8 ++++- stepmania/src/ScreenEz2SelectStyle.cpp | 5 ++- stepmania/src/ScreenGameplay.cpp | 3 ++ stepmania/src/ScreenMusicScroll.cpp | 3 +- stepmania/src/ScreenSelectGame.cpp | 46 +++++++++++++++++++++++-- stepmania/src/ScreenTitleMenu.cpp | 6 ++++ 7 files changed, 92 insertions(+), 10 deletions(-) diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index fabb7558b3..5c167a887b 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -12,7 +12,7 @@ #include "LifeMeterBar.h" #include "ThemeManager.h" - +#include "GameManager.h" const int NUM_SECTIONS = 3; const float SECTION_WIDTH = 1.0f/NUM_SECTIONS; @@ -94,7 +94,14 @@ void LifeMeterBar::Update( float fDeltaTime ) m_fTrailingLifePercentage = clamp( m_fTrailingLifePercentage, 0, 1 ); } - +const D3DXCOLOR COLOR_EZ2NORMAL_1 = D3DXCOLOR(0.7f,0.4f,0,1); +const D3DXCOLOR COLOR_EZ2NORMAL_2 = D3DXCOLOR(0.8f,0.4f,0,1); +const D3DXCOLOR COLOR_EZ2NEARFULL_1 = D3DXCOLOR(0.7f,0.6f,0,1); +const D3DXCOLOR COLOR_EZ2NEARFULL_2 = D3DXCOLOR(0.8f,0.7f,0,1); +const D3DXCOLOR COLOR_EZ2NEARFAIL_1 = D3DXCOLOR(0.9f,0.0f,0,1); +const D3DXCOLOR COLOR_EZ2NEARFAIL_2 = D3DXCOLOR(0.8f,0.1f,0,1); +const D3DXCOLOR COLOR_EZ2FULL_1 = D3DXCOLOR(0.3f,0.9f,0.4f,1); +const D3DXCOLOR COLOR_EZ2FULL_2 = D3DXCOLOR(0.2f,0.7f,0.3f,1); const D3DXCOLOR COLOR_NORMAL_1 = D3DXCOLOR(1,1,1,1); const D3DXCOLOR COLOR_NORMAL_2 = D3DXCOLOR(0,1,0,1); const D3DXCOLOR COLOR_FULL_1 = D3DXCOLOR(1,0,0,1); @@ -104,10 +111,24 @@ D3DXCOLOR LifeMeterBar::GetColor( float fPercentIntoSection ) { float fPercentColor1 = fabsf( fPercentIntoSection*2 - 1 ); fPercentColor1 *= fPercentColor1 * fPercentColor1 * fPercentColor1; // make the color bunch around one side - if( m_fLifePercentage == 1 ) - return COLOR_FULL_1 * fPercentColor1 + COLOR_FULL_2 * (1-fPercentColor1); + if (GAMEMAN->m_CurGame != GAME_EZ2) + { + if( m_fLifePercentage == 1 ) + return COLOR_FULL_1 * fPercentColor1 + COLOR_FULL_2 * (1-fPercentColor1); + else + return COLOR_NORMAL_1 * fPercentColor1 + COLOR_NORMAL_2 * (1-fPercentColor1); + } else - return COLOR_NORMAL_1 * fPercentColor1 + COLOR_NORMAL_2 * (1-fPercentColor1); + { + if( m_fLifePercentage == 1 ) + return COLOR_EZ2FULL_1 * fPercentColor1 + COLOR_EZ2FULL_2 * (1-fPercentColor1); + else if ( m_fLifePercentage > 0.60 ) + return COLOR_EZ2NEARFULL_1 * fPercentColor1 + COLOR_EZ2NEARFULL_2 * (1-fPercentColor1); + else if ( m_fLifePercentage < 0.25 ) + return COLOR_EZ2NEARFAIL_1 * fPercentColor1 + COLOR_EZ2NEARFAIL_2 * (1-fPercentColor1); + else + return COLOR_EZ2NORMAL_1 * fPercentColor1 + COLOR_EZ2NORMAL_2 * (1-fPercentColor1); + } } void LifeMeterBar::DrawPrimitives() diff --git a/stepmania/src/ScreenEz2SelectPlayer.cpp b/stepmania/src/ScreenEz2SelectPlayer.cpp index 6ec609b317..666153fd65 100644 --- a/stepmania/src/ScreenEz2SelectPlayer.cpp +++ b/stepmania/src/ScreenEz2SelectPlayer.cpp @@ -58,7 +58,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer() LOG->WriteLine( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" ); ez2_lasttimercheck[0] = TIMER->GetTimeSinceStart(); ez2_lasttimercheck[1] = 0.0f; - m_iSelectedStyle=0; + m_iSelectedStyle=3; // set to invalid style GAMEMAN->m_CurStyle = STYLE_NONE; GAMEMAN->m_sMasterPlayerNumber = PLAYER_INVALID; @@ -280,6 +280,11 @@ presses the button bound to start ************************************/ void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p ) { + //disallow multiple presses of the menu start. + if (m_iSelectedStyle == 0 && p == PLAYER_1 || m_iSelectedStyle == 1 && p == PLAYER_2) + { + return; + } // figure out whether we should add a player into the fray or not if( GAMEMAN->m_sMasterPlayerNumber != PLAYER_2 && GAMEMAN->m_sMasterPlayerNumber != PLAYER_1 ) @@ -301,6 +306,7 @@ void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p ) m_iSelectedStyle = 2; m_soundSelect.PlayRandom(); } + TweenOffScreen(); } diff --git a/stepmania/src/ScreenEz2SelectStyle.cpp b/stepmania/src/ScreenEz2SelectStyle.cpp index d129361fbc..950e77df92 100644 --- a/stepmania/src/ScreenEz2SelectStyle.cpp +++ b/stepmania/src/ScreenEz2SelectStyle.cpp @@ -3,6 +3,9 @@ ScreenEzSelectPlayer,cpp Desc: See Header Copyright (C): Andrew Livy + +NOTES: Needs a good cleanup. Code is messy +and sloppy and err needs cleaning up ;) *****************************************/ /* Includes */ @@ -27,7 +30,7 @@ Andrew Livy /* Constants */ -const CString BG_ANIMS_DIR = "BGAnimations\\"; +// const CString BG_ANIMS_DIR = "BGAnimations\\"; const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1); const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 44cb9c4104..9a94b0d750 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -802,6 +802,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) m_sprFailed.SetTweenZoom( 1.0f ); // come to rest m_sprFailed.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0.7f) ); // and fade in + // BUGFIX by ANDY: Stage will now reset back to 0 when game ends. + PREFSMAN->m_iCurrentStageIndex = 0; + SCREENMAN->SendMessageToTopScreen( SM_PlayFailComment, 1.5f ); SCREENMAN->SendMessageToTopScreen( SM_HideFailed, 3.0f ); break; diff --git a/stepmania/src/ScreenMusicScroll.cpp b/stepmania/src/ScreenMusicScroll.cpp index 0d875cae9d..d4d95c6359 100644 --- a/stepmania/src/ScreenMusicScroll.cpp +++ b/stepmania/src/ScreenMusicScroll.cpp @@ -44,6 +44,7 @@ const CString CREDIT_LINES[] = "TofuBoy (Lucas Tang)", "SPiGuMuS", "DJ McFox (Ryan McKanna)", + "Cloud34 (Lamden Travis)", "", "", "", @@ -122,7 +123,7 @@ ScreenMusicScroll::ScreenMusicScroll() { LOG->WriteLine( "ScreenMusicScroll::ScreenMusicScroll()" ); - int i; + int i; // BUGFIX by ANDY: Stage will now reset back to 0 when game ends. PREFSMAN->m_iCurrentStageIndex = 0; diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index ceada681ba..9156d31899 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -80,7 +80,12 @@ void ScreenSelectGame::ExportOptions() case GAME_DANCE: GAMEMAN->m_CurStyle = STYLE_DANCE_SINGLE; GAMEMAN->m_CurGame = GAME_DANCE; - ANNOUNCER->SwitchAnnouncer( "default" ); + ANNOUNCER->SwitchAnnouncer( "default" ); + // Does anyone wanna code something fancy that 'remembers' each + // announcer preference per game type?, I think it would be better than + // resetting the annoncer to a default each time? + // + // - Andy. break; case GAME_PUMP: GAMEMAN->m_CurStyle = STYLE_PUMP_SINGLE; @@ -99,7 +104,44 @@ void ScreenSelectGame::ExportOptions() CStringArray asGameNames; GAMEMAN->GetGameNames( asGameNames ); CString sGameName = asGameNames[game]; - THEME->SwitchTheme( sGameName ); + THEME->SwitchTheme( sGameName ); + + // THE NEXT FEW LINES OF CODE: + // Figure out all the valid skin names for the game and.... + // Chooses the first one and loads it in + // This is needed because otherwise ALL gametypes will be looking + // for a MAX skin. Ez2dancer MAX? Pump It Up MAX? Not likely. + + // This was stolen from ScreenAppearance Options, if you can do a cleaner + // version PLEASE DO!!! + // + // - Andy. + + CStringArray arraySkinNames; + GAMEMAN->GetSkinNames( arraySkinNames ); + + m_OptionLineData[0].iNumOptions = arraySkinNames.GetSize(); + + for(int i=0; im_sCurrentSkin)==0 ) + { + m_iSelectedOption[0][0] = i; + break; + } + } + if( m_iSelectedOption[0][0] == -1 ) + m_iSelectedOption[0][0] = 0; + + int iSelectedSkin = m_iSelectedOption[0][0]; + CString sNewSkin = m_OptionLineData[0].szOptionsText[iSelectedSkin]; + PREFSMAN->m_sNoteSkin = sNewSkin; + GAMEMAN->m_sCurrentSkin = sNewSkin; + } void ScreenSelectGame::GoToPrevState() diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 7ca8ee64ea..414a750ffe 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -153,6 +153,12 @@ ScreenTitleMenu::ScreenTitleMenu() // Cheers // -- dro kulix + // Good call, actually, I made this change when announcer switching wasn't possible. + // or rather, announcer switching WASN'T possible from the title menu (it used to be + // in song options) + // but since it is now changed before we get here, + // care needs to be taken to ensure the player can still switch. + SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_GAME_NAME) ); m_soundAttract.Load( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_ATTRACT) );