[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:
@@ -13,6 +13,9 @@ StepMania 5.0 $next | 20111xxx
|
|||||||
* [ScreenEdit] Add the GAMESTATE:InStepEditor LUA binding. [Wolfman2000]
|
* [ScreenEdit] Add the GAMESTATE:InStepEditor LUA binding. [Wolfman2000]
|
||||||
* [Player, ScreenGameplay] Allow failing on Oni without crashing. This one
|
* [Player, ScreenGameplay] Allow failing on Oni without crashing. This one
|
||||||
took awhile. [Wolfman2000]
|
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
|
2011/12/11
|
||||||
----------
|
----------
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ local blinkTime = 1.2
|
|||||||
|
|
||||||
local t = Def.ActorFrame{
|
local t = Def.ActorFrame{
|
||||||
LoadActor("_lives")..{
|
LoadActor("_lives")..{
|
||||||
-- xxx: assumes course is 4lives
|
-- xxx: assumes course is 4lives (or more)
|
||||||
InitCommand=cmd(pause;setstate,3);
|
InitCommand=cmd(pause;setstate,3);
|
||||||
LifeChangedMessageCommand=function(self,param)
|
LifeChangedMessageCommand=function(self,param)
|
||||||
if param.Player == player then
|
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:setstate( math.max(param.LivesLeft-1,0) )
|
||||||
|
self:visible(true)
|
||||||
else
|
else
|
||||||
self:setstate(3)
|
self:setstate(3)
|
||||||
|
self:visible(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ BatteryP2X=0
|
|||||||
BatteryP2Y=0
|
BatteryP2Y=0
|
||||||
#
|
#
|
||||||
NumLivesP2OnCommand=zoomx,-1
|
NumLivesP2OnCommand=zoomx,-1
|
||||||
|
NumLivesP2LoseLifeCommand=zoomx,-1.5;zoomy,1.5;linear,0.15;zoomx,-1;zoomy,1
|
||||||
|
|
||||||
[LifeMeterBattery Percent]
|
[LifeMeterBattery Percent]
|
||||||
# still asking for this even though it's in fallback... -aj
|
# still asking for this even though it's in fallback... -aj
|
||||||
|
|||||||
@@ -49,11 +49,6 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
|
|||||||
|
|
||||||
m_textNumLives.LoadFromFont( THEME->GetPathF(sType, "lives") );
|
m_textNumLives.LoadFromFont( THEME->GetPathF(sType, "lives") );
|
||||||
m_textNumLives.SetName( ssprintf("NumLivesP%i",int(pn+1)) );
|
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 )
|
if( bPlayerEnabled )
|
||||||
{
|
{
|
||||||
ActorUtil::LoadAllCommandsAndSetXY( m_textNumLives, sType );
|
ActorUtil::LoadAllCommandsAndSetXY( m_textNumLives, sType );
|
||||||
@@ -232,6 +227,11 @@ int LifeMeterBattery::GetRemainingLives() const
|
|||||||
void LifeMeterBattery::Refresh()
|
void LifeMeterBattery::Refresh()
|
||||||
{
|
{
|
||||||
m_textNumLives.SetText( ssprintf(LIVES_FORMAT.GetValue(), m_iLivesLeft-1) );
|
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
|
//update m_sprBattery
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user