[LifeMeterBattery] Fixed various issues (lives not fully disappearing on fail, P2 lose life animation having the wrong x zoom, hide the lives number if it falls below 0).

This commit is contained in:
AJ Kelly
2011-12-12 22:13:32 -06:00
parent 058f03e495
commit c8e99cc18b
4 changed files with 15 additions and 7 deletions
+3
View File
@@ -13,6 +13,9 @@ StepMania 5.0 $next | 20111xxx
* [ScreenEdit] Add the GAMESTATE:InStepEditor LUA binding. [Wolfman2000]
* [Player, ScreenGameplay] Allow failing on Oni without crashing. This one
took awhile. [Wolfman2000]
* [LifeMeterBattery] Fixed various issues (lives not fully disappearing on fail,
P2 lose life animation having the wrong x zoom, hide the lives number if it
falls below 0). [AJ]
2011/12/11
----------
@@ -3,14 +3,18 @@ local blinkTime = 1.2
local t = Def.ActorFrame{
LoadActor("_lives")..{
-- xxx: assumes course is 4lives
-- xxx: assumes course is 4lives (or more)
InitCommand=cmd(pause;setstate,3);
LifeChangedMessageCommand=function(self,param)
if param.Player == player then
if param.LivesLeft <= 4 then
if param.LivesLeft == 0 then
self:visible(false)
elseif param.LivesLeft <= 4 then
self:setstate( math.max(param.LivesLeft-1,0) )
self:visible(true)
else
self:setstate(3)
self:visible(true)
end
end
end;
+1
View File
@@ -136,6 +136,7 @@ BatteryP2X=0
BatteryP2Y=0
#
NumLivesP2OnCommand=zoomx,-1
NumLivesP2LoseLifeCommand=zoomx,-1.5;zoomy,1.5;linear,0.15;zoomx,-1;zoomy,1
[LifeMeterBattery Percent]
# still asking for this even though it's in fallback... -aj
+5 -5
View File
@@ -49,11 +49,6 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
m_textNumLives.LoadFromFont( THEME->GetPathF(sType, "lives") );
m_textNumLives.SetName( ssprintf("NumLivesP%i",int(pn+1)) );
// old hardcoded commands:
/*
m_textNumLives.SetDiffuse( RageColor(1,1,1,1) );
m_textNumLives.SetShadowLength( 0 );
*/
if( bPlayerEnabled )
{
ActorUtil::LoadAllCommandsAndSetXY( m_textNumLives, sType );
@@ -232,6 +227,11 @@ int LifeMeterBattery::GetRemainingLives() const
void LifeMeterBattery::Refresh()
{
m_textNumLives.SetText( ssprintf(LIVES_FORMAT.GetValue(), m_iLivesLeft-1) );
if( m_iLivesLeft-1 < 0 )
{
// hide text to avoid showing -1
m_textNumLives.SetVisible(false);
}
//update m_sprBattery
}