Make all modes compatible with side next

This commit is contained in:
terpyderp 2021-10-19 19:37:48 -05:00
parent aa56248e34
commit ad63765eb9
13 changed files with 130 additions and 57 deletions

View File

@ -720,7 +720,7 @@ function GameMode:drawNextQueue(ruleset)
local skin = self.next_queue[i].skin
local rotation = self.next_queue[i].orientation
if config.side_next then -- next at side
drawPiece(next_piece, skin, ruleset.block_offsets[next_piece][rotation], 192, -16+i*48)
drawPiece(next_piece, skin, ruleset.block_offsets[next_piece][rotation], 192, -10+i*48)
else -- next at top
drawPiece(next_piece, skin, ruleset.block_offsets[next_piece][rotation], -16+i*80, -32)
end

View File

@ -439,10 +439,15 @@ function Marathon2020Game:sectionColourFunction(section)
end
function Marathon2020Game:drawScoringInfo()
Marathon2020Game.super.drawScoringInfo(self)
local current_section = getSectionForLevel(self.level)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 100, 40, "left")

View File

@ -189,7 +189,6 @@ function MarathonA1Game:drawGrid()
end
function MarathonA1Game:drawScoringInfo()
MarathonA1Game.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
love.graphics.setFont(font_3x5_2)
@ -198,30 +197,39 @@ function MarathonA1Game:drawScoringInfo()
self.das.frames .. " " ..
strTrueValues(self.prev_inputs)
)
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
love.graphics.printf("GRADE", 240, 120, 40, "left")
love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("NEXT RANK", 240, 260, 90, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")
love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("NEXT RANK", text_x, 260, 90, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade()
if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
love.graphics.printf("SECRET GRADE", text_x, 430, 180, "left")
end
if self.bravos > 0 then love.graphics.printf("BRAVO", 300, 120, 40, "left") end
love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, 240, 220, 90, "left")
love.graphics.printf(self.score, text_x, 220, 90, "left")
if self.gm_conditions["level300"] and self.gm_conditions["level500"] and self.gm_conditions["level999"] then
love.graphics.printf("GM", 240, 140, 90, "left")
love.graphics.printf("GM", text_x, 140, 90, "left")
else
love.graphics.printf(getRankForScore(self.score).rank, 240, 140, 90, "left")
love.graphics.printf(getRankForScore(self.score).rank, text_x, 140, 90, "left")
end
love.graphics.printf(getRankForScore(self.score).next, 240, 280, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
love.graphics.printf(getRankForScore(self.score).next, text_x, 280, 90, "left")
love.graphics.printf(self.level, text_x, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right")
if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
love.graphics.printf(self.SGnames[sg], text_x, 450, 180, "left")
end
if self.bravos > 0 then love.graphics.printf(self.bravos, 300, 140, 40, "left") end

View File

@ -353,10 +353,19 @@ function MarathonA2Game:drawScoringInfo()
self.das.frames .. " " ..
strTrueValues(self.prev_inputs)
)
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
love.graphics.printf("GRADE", 240, 120, 40, "left")
love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")
love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade()
if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
@ -372,13 +381,13 @@ function MarathonA2Game:drawScoringInfo()
else love.graphics.setColor(0, 1, 0, 1) end
end
end
love.graphics.printf(self:getLetterGrade(), 240, 140, 90, "left")
love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left")
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(self.score, 240, 220, 90, "left")
love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
love.graphics.printf(self.score, text_x, 220, 90, "left")
love.graphics.printf(self.level, text_x, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right")
if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
love.graphics.printf(self.SGnames[sg], text_x, 450, 180, "left")
end
love.graphics.setFont(font_8x11)

View File

@ -421,13 +421,22 @@ function MarathonA3Game:drawScoringInfo()
self.das.frames .. " " ..
strTrueValues(self.prev_inputs)
)
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
love.graphics.printf("GRADE", 240, 120, 40, "left")
love.graphics.printf("SCORE", 240, 200, 40, "left")
love.graphics.printf("LEVEL", 240, 320, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")
love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade()
if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
love.graphics.printf("SECRET GRADE", text_x, 430, 180, "left")
end
-- draw section time data
@ -466,15 +475,15 @@ function MarathonA3Game:drawScoringInfo()
end
love.graphics.setFont(font_3x5_3)
love.graphics.printf(self.score, 240, 220, 90, "left")
love.graphics.printf(self.score, text_x, 220, 90, "left")
if self.roll_frames > 3238 then love.graphics.setColor(1, 0.5, 0, 1)
elseif self.level >= 999 then love.graphics.setColor(0, 1, 0, 1) end
love.graphics.printf(self:getLetterGrade(), 240, 140, 90, "left")
love.graphics.printf(self:getLetterGrade(), text_x, 140, 90, "left")
love.graphics.setColor(1, 1, 1, 1)
love.graphics.printf(self.level, 240, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), 240, 370, 40, "right")
love.graphics.printf(self.level, text_x, 340, 40, "right")
love.graphics.printf(self:getSectionEndLevel(), text_x, 370, 40, "right")
if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
love.graphics.printf(self.SGnames[sg], text_x, 450, 180, "left")
end
love.graphics.setFont(font_8x11)

View File

@ -176,9 +176,14 @@ local function getLetterGrade(level, clear)
end
function PhantomManiaGame:drawScoringInfo()
PhantomManiaGame.super.drawScoringInfo(self)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
if getLetterGrade(self.level, self.clear) ~= "" then

View File

@ -297,7 +297,13 @@ function PhantomMania2Game:drawScoringInfo()
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")
@ -305,7 +311,7 @@ function PhantomMania2Game:drawScoringInfo()
love.graphics.printf("LEVEL", text_x, 320, 40, "left")
local sg = self.grid:checkSecretGrade()
if sg >= 5 then
love.graphics.printf("SECRET GRADE", 240, 430, 180, "left")
love.graphics.printf("SECRET GRADE", text_x, 430, 180, "left")
end
self:drawSectionTimesWithSplits(math.floor(self.level / 100) + 1)
@ -326,7 +332,7 @@ function PhantomMania2Game:drawScoringInfo()
end
if sg >= 5 then
love.graphics.printf(self.SGnames[sg], 240, 450, 180, "left")
love.graphics.printf(self.SGnames[sg], text_x, 450, 180, "left")
end
end

View File

@ -122,13 +122,19 @@ function Race40Game:getSecretGrade(sg)
end
function Race40Game:drawScoringInfo()
Race40Game.super.drawScoringInfo(self)
-- Race40Game.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("NEXT", 64, 40, 40, "left")
-- love.graphics.printf("NEXT", 64, 40, 40, "left")
love.graphics.printf("LINES", text_x, 320, 40, "left")
love.graphics.printf("line/min", text_x, 160, 80, "left")
love.graphics.printf("piece/sec", text_x, 220, 80, "left")

View File

@ -114,11 +114,16 @@ function StrategyGame:drawGrid()
end
function StrategyGame:drawScoringInfo()
StrategyGame.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("SCORE", text_x, 200, 40, "left")

View File

@ -223,11 +223,16 @@ local function getLetterGrade(grade)
end
function Survival2020Game:drawScoringInfo()
Survival2020Game.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")

View File

@ -138,7 +138,13 @@ function SurvivalA2Game:drawScoringInfo()
SurvivalA2Game.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.print(
@ -146,7 +152,6 @@ function SurvivalA2Game:drawScoringInfo()
self.das.frames .. " " ..
strTrueValues(self.prev_inputs)
)
love.graphics.printf("NEXT", 64, 40, 40, "left")
if self:getLetterGrade() ~= "" then love.graphics.printf("GRADE", text_x, 120, 40, "left") end
love.graphics.printf("SCORE", text_x, 200, 40, "left")
love.graphics.printf("LEVEL", text_x, 320, 40, "left")

View File

@ -212,11 +212,16 @@ local function getLetterGrade(grade)
end
function SurvivalA3Game:drawScoringInfo()
SurvivalA3Game.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
local text_x = config["side_next"] and 320 or 240
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.printf("GRADE", text_x, 120, 40, "left")

View File

@ -129,7 +129,13 @@ end
function SurvivalAXGame:drawScoringInfo()
SurvivalAXGame.super.drawScoringInfo(self)
love.graphics.setColor(1, 1, 1, 1)
if config["side_next"] then
love.graphics.printf("NEXT", 240, 72, 40, "left")
else
love.graphics.printf("NEXT", 64, 40, 40, "left")
end
local text_x = config["side_next"] and 316 or 240
love.graphics.setFont(font_3x5_2)
love.graphics.print(
@ -137,7 +143,6 @@ function SurvivalAXGame:drawScoringInfo()
self.das.frames .. " " ..
strTrueValues(self.prev_inputs)
)
love.graphics.printf("NEXT", 64, 40, 40, "left")
if self.lines < 150 then love.graphics.printf("TIME LEFT", 240, 250, 80, "left") end
love.graphics.printf("LINES", 240, 320, 40, "left")