Adds metric options to flash the lifebar when a note is hit and a function for sprite to set all the delays in all of the states in one shot.
This commit is contained in:
@@ -1792,6 +1792,8 @@ InitialValue=0.5
|
|||||||
HotValue=1.0
|
HotValue=1.0
|
||||||
LifeMultiplier=1.0
|
LifeMultiplier=1.0
|
||||||
MinStayAlive="TapNoteScore_W3"
|
MinStayAlive="TapNoteScore_W3"
|
||||||
|
FlashHotOnNoteHit=false
|
||||||
|
MinScoreToFlash="TapNoteScore_W3"
|
||||||
LifePercentChangeW1=0.008
|
LifePercentChangeW1=0.008
|
||||||
LifePercentChangeW2=0.008
|
LifePercentChangeW2=0.008
|
||||||
LifePercentChangeW3=0.004
|
LifePercentChangeW3=0.004
|
||||||
|
|||||||
@@ -27,8 +27,12 @@ LifeMeterBar::LifeMeterBar()
|
|||||||
MIN_STAY_ALIVE.Load ("LifeMeterBar","MinStayAlive");
|
MIN_STAY_ALIVE.Load ("LifeMeterBar","MinStayAlive");
|
||||||
m_fLifePercentChange.Load( "LifeMeterBar", LIFE_PERCENT_CHANGE_NAME, NUM_ScoreEvent );
|
m_fLifePercentChange.Load( "LifeMeterBar", LIFE_PERCENT_CHANGE_NAME, NUM_ScoreEvent );
|
||||||
|
|
||||||
|
FLASH_HOT_ON_NOTE_HIT.Load("LifeMeterBar","FlashHotOnNoteHit");
|
||||||
|
MIN_SCORE_TO_FLASH.Load("LifeMeterBar","MinScoreToFlash");
|
||||||
|
|
||||||
m_pPlayerState = NULL;
|
m_pPlayerState = NULL;
|
||||||
|
|
||||||
|
|
||||||
switch( GAMESTATE->m_SongOptions.GetStage().m_DrainType )
|
switch( GAMESTATE->m_SongOptions.GetStage().m_DrainType )
|
||||||
{
|
{
|
||||||
case SongOptions::DRAIN_NORMAL:
|
case SongOptions::DRAIN_NORMAL:
|
||||||
@@ -125,6 +129,11 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
|
|||||||
case TNS_CheckpointHit: fDeltaLife = m_fLifePercentChange.GetValue(SE_CheckpointHit); break;
|
case TNS_CheckpointHit: fDeltaLife = m_fLifePercentChange.GetValue(SE_CheckpointHit); break;
|
||||||
case TNS_CheckpointMiss:fDeltaLife = m_fLifePercentChange.GetValue(SE_CheckpointMiss); break;
|
case TNS_CheckpointMiss:fDeltaLife = m_fLifePercentChange.GetValue(SE_CheckpointMiss); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FLASH_HOT_ON_NOTE_HIT)
|
||||||
|
if(score >= MIN_SCORE_TO_FLASH)
|
||||||
|
m_fHotAlpha = 1.0f; // flash the hot temporarily
|
||||||
|
|
||||||
if( IsHot() && fDeltaLife < 0 )
|
if( IsHot() && fDeltaLife < 0 )
|
||||||
fDeltaLife = min( fDeltaLife, -0.10f ); // make it take a while to get back to "hot"
|
fDeltaLife = min( fDeltaLife, -0.10f ); // make it take a while to get back to "hot"
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ private:
|
|||||||
int m_iMissCombo; // current number of progressive W5/miss
|
int m_iMissCombo; // current number of progressive W5/miss
|
||||||
|
|
||||||
int m_iComboToRegainLife; // combo needed before lifebar starts filling up after fail
|
int m_iComboToRegainLife; // combo needed before lifebar starts filling up after fail
|
||||||
|
|
||||||
|
ThemeMetric<TapNoteScore> MIN_SCORE_TO_FLASH;
|
||||||
|
ThemeMetric<bool> FLASH_HOT_ON_NOTE_HIT;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -70,6 +70,14 @@ void Sprite::InitState()
|
|||||||
m_bSkipNextUpdate = true;
|
m_bSkipNextUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sprite::SetAllStateDelays(float fDelay)
|
||||||
|
{
|
||||||
|
for(unsigned int i=0;i<m_States.size();i++)
|
||||||
|
{
|
||||||
|
m_States[i].fDelay = fDelay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RageTextureID Sprite::SongBGTexture( RageTextureID ID )
|
RageTextureID Sprite::SongBGTexture( RageTextureID ID )
|
||||||
{
|
{
|
||||||
ID.bMipMaps = true;
|
ID.bMipMaps = true;
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ public:
|
|||||||
//
|
//
|
||||||
virtual void PushSelf( lua_State *L );
|
virtual void PushSelf( lua_State *L );
|
||||||
|
|
||||||
|
void SetAllStateDelays(float fDelay);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void LoadFromTexture( RageTextureID ID );
|
void LoadFromTexture( RageTextureID ID );
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,14 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
|
|||||||
Sprite *pSpr = new Sprite;
|
Sprite *pSpr = new Sprite;
|
||||||
|
|
||||||
if(m_bUsingThreePart)
|
if(m_bUsingThreePart)
|
||||||
|
{
|
||||||
pSpr->Load( THEME->GetPathG(sMetricsGroup,ssprintf("%s part%d",StreamTypeToString(st).c_str(),i) ) );
|
pSpr->Load( THEME->GetPathG(sMetricsGroup,ssprintf("%s part%d",StreamTypeToString(st).c_str(),i) ) );
|
||||||
|
|
||||||
|
if(pSpr->GetNumStates() > 1)
|
||||||
|
{
|
||||||
|
pSpr->SetAllStateDelays(THEME->GetMetricF(sMetricsGroup,ssprintf("%spart%ddelay",StreamTypeToString(st).c_str(),i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
pSpr->Load( THEME->GetPathG(sMetricsGroup,StreamTypeToString(st)) );
|
pSpr->Load( THEME->GetPathG(sMetricsGroup,StreamTypeToString(st)) );
|
||||||
m_vpSprPill[st].push_back( pSpr );
|
m_vpSprPill[st].push_back( pSpr );
|
||||||
@@ -67,9 +74,8 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
|
|||||||
if(m_bUsingThreePart)
|
if(m_bUsingThreePart)
|
||||||
{
|
{
|
||||||
m_fThreePartWidth = THEME->GetMetricF(sMetricsGroup,"ThreePartWidth");
|
m_fThreePartWidth = THEME->GetMetricF(sMetricsGroup,"ThreePartWidth");
|
||||||
float fCroppedWidthRight = (1-m_vpSprPill[st][0]->GetCropRight())*m_vpSprPill[st][0]->GetZoomedWidth();
|
|
||||||
// first element positioned depending on metric width specified
|
// first element positioned depending on metric width specified
|
||||||
m_vpSprPill[st][0]->AddX(-(m_fThreePartWidth/2 + m_vpSprPill[st][0]->GetZoomedWidth()/2) + fCroppedWidthRight);
|
m_vpSprPill[st][0]->AddX(-(m_fThreePartWidth/2 + m_vpSprPill[st][0]->GetZoomedWidth()/2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user