Lifebar colors for ez2dancer inplace
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "LifeMeterBar.h"
|
#include "LifeMeterBar.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "GameManager.h"
|
||||||
|
|
||||||
const int NUM_SECTIONS = 3;
|
const int NUM_SECTIONS = 3;
|
||||||
const float SECTION_WIDTH = 1.0f/NUM_SECTIONS;
|
const float SECTION_WIDTH = 1.0f/NUM_SECTIONS;
|
||||||
@@ -94,7 +94,14 @@ void LifeMeterBar::Update( float fDeltaTime )
|
|||||||
m_fTrailingLifePercentage = clamp( m_fTrailingLifePercentage, 0, 1 );
|
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_1 = D3DXCOLOR(1,1,1,1);
|
||||||
const D3DXCOLOR COLOR_NORMAL_2 = D3DXCOLOR(0,1,0,1);
|
const D3DXCOLOR COLOR_NORMAL_2 = D3DXCOLOR(0,1,0,1);
|
||||||
const D3DXCOLOR COLOR_FULL_1 = D3DXCOLOR(1,0,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 );
|
float fPercentColor1 = fabsf( fPercentIntoSection*2 - 1 );
|
||||||
fPercentColor1 *= fPercentColor1 * fPercentColor1 * fPercentColor1; // make the color bunch around one side
|
fPercentColor1 *= fPercentColor1 * fPercentColor1 * fPercentColor1; // make the color bunch around one side
|
||||||
|
if (GAMEMAN->m_CurGame != GAME_EZ2)
|
||||||
|
{
|
||||||
if( m_fLifePercentage == 1 )
|
if( m_fLifePercentage == 1 )
|
||||||
return COLOR_FULL_1 * fPercentColor1 + COLOR_FULL_2 * (1-fPercentColor1);
|
return COLOR_FULL_1 * fPercentColor1 + COLOR_FULL_2 * (1-fPercentColor1);
|
||||||
else
|
else
|
||||||
return COLOR_NORMAL_1 * fPercentColor1 + COLOR_NORMAL_2 * (1-fPercentColor1);
|
return COLOR_NORMAL_1 * fPercentColor1 + COLOR_NORMAL_2 * (1-fPercentColor1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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()
|
void LifeMeterBar::DrawPrimitives()
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()
|
|||||||
LOG->WriteLine( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
|
LOG->WriteLine( "ScreenEz2SelectPlayer::ScreenEz2SelectPlayer()" );
|
||||||
ez2_lasttimercheck[0] = TIMER->GetTimeSinceStart();
|
ez2_lasttimercheck[0] = TIMER->GetTimeSinceStart();
|
||||||
ez2_lasttimercheck[1] = 0.0f;
|
ez2_lasttimercheck[1] = 0.0f;
|
||||||
m_iSelectedStyle=0;
|
m_iSelectedStyle=3; // set to invalid style
|
||||||
GAMEMAN->m_CurStyle = STYLE_NONE;
|
GAMEMAN->m_CurStyle = STYLE_NONE;
|
||||||
GAMEMAN->m_sMasterPlayerNumber = PLAYER_INVALID;
|
GAMEMAN->m_sMasterPlayerNumber = PLAYER_INVALID;
|
||||||
|
|
||||||
@@ -280,6 +280,11 @@ presses the button bound to start
|
|||||||
************************************/
|
************************************/
|
||||||
void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p )
|
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
|
// figure out whether we should add a player into the fray or not
|
||||||
if( GAMEMAN->m_sMasterPlayerNumber != PLAYER_2 && GAMEMAN->m_sMasterPlayerNumber != PLAYER_1 )
|
if( GAMEMAN->m_sMasterPlayerNumber != PLAYER_2 && GAMEMAN->m_sMasterPlayerNumber != PLAYER_1 )
|
||||||
@@ -301,6 +306,7 @@ void ScreenEz2SelectPlayer::MenuStart( PlayerNumber p )
|
|||||||
m_iSelectedStyle = 2;
|
m_iSelectedStyle = 2;
|
||||||
m_soundSelect.PlayRandom();
|
m_soundSelect.PlayRandom();
|
||||||
}
|
}
|
||||||
|
|
||||||
TweenOffScreen();
|
TweenOffScreen();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ ScreenEzSelectPlayer,cpp
|
|||||||
Desc: See Header
|
Desc: See Header
|
||||||
Copyright (C):
|
Copyright (C):
|
||||||
Andrew Livy
|
Andrew Livy
|
||||||
|
|
||||||
|
NOTES: Needs a good cleanup. Code is messy
|
||||||
|
and sloppy and err needs cleaning up ;)
|
||||||
*****************************************/
|
*****************************************/
|
||||||
|
|
||||||
/* Includes */
|
/* Includes */
|
||||||
@@ -27,7 +30,7 @@ Andrew Livy
|
|||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
|
|
||||||
const CString BG_ANIMS_DIR = "BGAnimations\\";
|
// const CString BG_ANIMS_DIR = "BGAnimations\\";
|
||||||
|
|
||||||
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1);
|
||||||
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
||||||
|
|||||||
@@ -802,6 +802,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
m_sprFailed.SetTweenZoom( 1.0f ); // come to rest
|
m_sprFailed.SetTweenZoom( 1.0f ); // come to rest
|
||||||
m_sprFailed.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0.7f) ); // and fade in
|
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_PlayFailComment, 1.5f );
|
||||||
SCREENMAN->SendMessageToTopScreen( SM_HideFailed, 3.0f );
|
SCREENMAN->SendMessageToTopScreen( SM_HideFailed, 3.0f );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const CString CREDIT_LINES[] =
|
|||||||
"TofuBoy (Lucas Tang)",
|
"TofuBoy (Lucas Tang)",
|
||||||
"SPiGuMuS",
|
"SPiGuMuS",
|
||||||
"DJ McFox (Ryan McKanna)",
|
"DJ McFox (Ryan McKanna)",
|
||||||
|
"Cloud34 (Lamden Travis)",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ void ScreenSelectGame::ExportOptions()
|
|||||||
GAMEMAN->m_CurStyle = STYLE_DANCE_SINGLE;
|
GAMEMAN->m_CurStyle = STYLE_DANCE_SINGLE;
|
||||||
GAMEMAN->m_CurGame = GAME_DANCE;
|
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;
|
break;
|
||||||
case GAME_PUMP:
|
case GAME_PUMP:
|
||||||
GAMEMAN->m_CurStyle = STYLE_PUMP_SINGLE;
|
GAMEMAN->m_CurStyle = STYLE_PUMP_SINGLE;
|
||||||
@@ -100,6 +105,43 @@ void ScreenSelectGame::ExportOptions()
|
|||||||
GAMEMAN->GetGameNames( asGameNames );
|
GAMEMAN->GetGameNames( asGameNames );
|
||||||
CString sGameName = asGameNames[game];
|
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; i<arraySkinNames.GetSize(); i++ )
|
||||||
|
strcpy( m_OptionLineData[0].szOptionsText[i], arraySkinNames[i] );
|
||||||
|
|
||||||
|
m_iSelectedOption[0][0] = -1;
|
||||||
|
for( i=0; i<m_OptionLineData[0].iNumOptions; i++ )
|
||||||
|
{
|
||||||
|
if( stricmp(m_OptionLineData[0].szOptionsText[i], GAMEMAN->m_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()
|
void ScreenSelectGame::GoToPrevState()
|
||||||
|
|||||||
@@ -153,6 +153,12 @@ ScreenTitleMenu::ScreenTitleMenu()
|
|||||||
// Cheers
|
// Cheers
|
||||||
// -- dro kulix
|
// -- 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) );
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_GAME_NAME) );
|
||||||
|
|
||||||
m_soundAttract.Load( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_ATTRACT) );
|
m_soundAttract.Load( ANNOUNCER->GetPathTo(ANNOUNCER_TITLE_MENU_ATTRACT) );
|
||||||
|
|||||||
Reference in New Issue
Block a user