Skip to content

Commit

Permalink
Merge additional fixes from 5.1 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ListenerJubatus committed Feb 9, 2018
1 parent 8974782 commit 414f54e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions BGAnimations/ScreenGameplay underlay/ScreenFilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local stepsType = style:GetStepsType()
if numPlayers == 1 then
local player = GAMESTATE:GetMasterPlayerNumber()
local pNum = (player == PLAYER_1) and 1 or 2
filterAlphas[player] = tonumber(getenv("ScreenFilterP"..pNum));
filterAlphas[player] = tonumber(getenv("ScreenFilterP"..pNum)) or 0;

local pos;
-- [ScreenGameplay] PlayerP#Player*Side(s)X
Expand Down Expand Up @@ -54,7 +54,7 @@ else
-- otherwise we need two separate ones. to the pairsmobile!
for i, player in ipairs(PlayerNumber) do
local pNum = (player == PLAYER_1) and 1 or 2
filterAlphas[player] = tonumber(getenv("ScreenFilterP"..pNum));
filterAlphas[player] = tonumber(getenv("ScreenFilterP"..pNum)) or 0;
local metricName = string.format("PlayerP%i%sX",pNum,styleType)
local pos = THEME:GetMetric("ScreenGameplay",metricName)
t[#t+1] = Def.Quad{
Expand All @@ -65,4 +65,4 @@ else
end
end

return t;
return t;
12 changes: 6 additions & 6 deletions Graphics/ScreenGameplay lifebar_bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ local function updateFunc(self)
local beat = self:GetSecsIntoEffect() % 1
local _beat = self.life == 1.00 and 0 or beat
local _fillWidth = (life_meter_width * self.life - _beat * life_meter_tip_gap) / life_meter_width
local _clampedWidth = math.round(_fillWidth * life_meter_num_segments)
local _tipPosition = (life_meter_width * self.life ) / life_meter_width
local _tipClamped = math.round( _tipPosition * life_meter_num_segments )
local _clampedWidth = math.round(_fillWidth * life_meter_num_segments)
local _tipPosition = self.life
local _tipClamped = math.round( _tipPosition * life_meter_num_segments ) / life_meter_num_segments
c.Fill:zoomtowidth( math.max(0,(_clampedWidth/life_meter_num_segments) * life_meter_width) )
--c.Fill:zoomtowidth( (life_meter_width * self.life) - beat * life_meter_tip_gap)
c.Tip:x( clamp(-life_meter_tip_width/2 + scale((_tipClamped/life_meter_num_segments) * life_meter_width,0,life_meter_width, -life_meter_width/2, life_meter_width/2),0, life_meter_width) )
c.Tip:x( (_tipClamped*life_meter_width) - life_meter_width/2)
end

t[#t+1] = Def.ActorFrame {
Expand Down Expand Up @@ -82,7 +82,7 @@ t[#t+1] = Def.ActorFrame {
InitCommand=cmd(zoomto,life_meter_width+life_meter_outline,life_meter_height+life_meter_outline),
OnCommand=cmd()
},
-- Background
-- Background
Def.Quad {
Name="Background",
InitCommand=cmd(zoomto,life_meter_width,life_meter_height),
Expand Down Expand Up @@ -115,4 +115,4 @@ t[#t+1] = Def.ActorFrame {
}
}

return t
return t

0 comments on commit 414f54e

Please sign in to comment.