Marathon 2020 section colour function fixed

This commit is contained in:
Ishaan Bhardwaj 2020-12-06 11:38:45 -05:00
parent 696da3fa3f
commit 40a2e78280
2 changed files with 14 additions and 0 deletions

View File

@ -524,6 +524,10 @@ function GameMode:drawSectionTimes(current_section)
love.graphics.printf(formatTime(self.frames - self.section_start_time), section_x, 40 + 20 * current_section, 90, "left") love.graphics.printf(formatTime(self.frames - self.section_start_time), section_x, 40 + 20 * current_section, 90, "left")
end end
function GameMode:sectionColourFunction(section)
return { 1, 1, 1, 1 }
end
function GameMode:drawSectionTimesWithSecondary(current_section) function GameMode:drawSectionTimesWithSecondary(current_section)
local section_x = 530 local section_x = 530
local section_secondary_x = 440 local section_secondary_x = 440
@ -535,9 +539,11 @@ function GameMode:drawSectionTimesWithSecondary(current_section)
end end
for section, time in pairs(self.secondary_section_times) do for section, time in pairs(self.secondary_section_times) do
love.graphics.setColor(self:sectionColourFunction(section))
if section > 0 then if section > 0 then
love.graphics.printf(formatTime(time), section_secondary_x, 40 + 20 * section, 90, "left") love.graphics.printf(formatTime(time), section_secondary_x, 40 + 20 * section, 90, "left")
end end
love.graphics.setColor(1, 1, 1, 1)
end end
local current_x local current_x

View File

@ -423,6 +423,14 @@ function Marathon2020Game:drawGrid()
end end
end end
function Marathon2020Game:sectionColourFunction(section)
if self.section_status[section] == "cool" then
return { 0, 1, 0, 1 }
else
return { 1, 1, 1, 1 }
end
end
function Marathon2020Game:drawScoringInfo() function Marathon2020Game:drawScoringInfo()
Marathon2020Game.super.drawScoringInfo(self) Marathon2020Game.super.drawScoringInfo(self)