From ea8d0083700b38e831194de5227998e58bf5f1c7 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Fri, 15 Jan 2021 15:46:28 -0500 Subject: [PATCH] Set piece opacity fixes --- tetris/modes/gamemode.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 3e0ef51..e718a45 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -545,8 +545,7 @@ function GameMode:drawNextQueue(ruleset) end end if self.hold_queue ~= nil and self.enable_hold then - local hold_color = self.held and 0.6 or 1 - self:setHoldOpacity(1, hold_color) + self:setHoldOpacity() drawPiece( self.hold_queue.shape, self.hold_queue.skin, @@ -557,15 +556,12 @@ function GameMode:drawNextQueue(ruleset) return false end -function GameMode:setNextOpacity(i, j) - i = i ~= nil and i or 1 - j = j ~= nil and j or 1 - love.graphics.setColor(j, j, j, i) +function GameMode:setNextOpacity(i) + love.graphics.setColor(1, 1, 1, 1) end -function GameMode:setHoldOpacity(i, j) - i = i ~= nil and i or 1 - j = j ~= nil and j or 1 - love.graphics.setColor(j, j, j, i) + +function GameMode:setHoldOpacity() + love.graphics.setColor(1, 1, 1, self.held and 0.6 or 1) end function GameMode:drawScoringInfo()