Merge branch 'master' of https://github.com/FajsiEx/exceed
This commit is contained in:
commit
c460f6f845
|
@ -353,26 +353,22 @@ draw_challenge = function(challenge, x, y, w, h, selected)
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
-- draw charts section
|
-- draw charts section
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
local diffIconHeight = 0.124 * h
|
local diffIconScale = 0.0048 * h
|
||||||
local diffIconWidth = 140 / 31 * diffIconHeight -- only scaling, no stretching textures
|
|
||||||
-- diffIconWidth = 0.8 * diffIconWidth -- okay, maybe a little squishing must be done
|
|
||||||
|
|
||||||
local paddingY = 0.18 * h
|
local paddingY = 0.18 * h
|
||||||
local offsetX = x + 0.252 * w
|
local offsetX = x + 0.242 * w
|
||||||
local offsetY = y + 0.246 * h
|
local offsetY = y + 0.233 * h
|
||||||
|
|
||||||
local titleMargin = 6
|
local titleMargin = 6
|
||||||
local titleMaxWidth = 6 / 9 * w
|
local titleMaxWidth = 6 / 9 * w
|
||||||
local titleCenterX = x + w - titleMargin - titleMaxWidth / 2 -- align right
|
local titleCenterX = x + w - titleMargin - titleMaxWidth / 2 -- align right
|
||||||
|
|
||||||
if selected then
|
if selected then
|
||||||
diffIconHeight = h / 12
|
diffIconScale = 0.0032 * h
|
||||||
diffIconWidth = 140 / 31 * diffIconHeight -- only scaling, no stretching textures
|
|
||||||
-- diffIconWidth = 0.8 * diffIconWidth -- okay, maybe a little squishing must be done
|
|
||||||
|
|
||||||
paddingY = 0.122 * h
|
paddingY = 0.123 * h
|
||||||
offsetX = x + 0.268 * w
|
offsetX = x + 0.259 * w
|
||||||
offsetY = y + 0.256 * h
|
offsetY = y + 0.248 * h
|
||||||
|
|
||||||
titleFontSize = math.floor(0.075 * h) -- must be an integer
|
titleFontSize = math.floor(0.075 * h) -- must be an integer
|
||||||
titleMaxWidth = 3 / 5 * w
|
titleMaxWidth = 3 / 5 * w
|
||||||
|
@ -382,39 +378,17 @@ draw_challenge = function(challenge, x, y, w, h, selected)
|
||||||
for i, chart in ipairs(challengeCache[challenge.id]["charts"]) do
|
for i, chart in ipairs(challengeCache[challenge.id]["charts"]) do
|
||||||
local ypos = offsetY + paddingY * (i - 1)
|
local ypos = offsetY + paddingY * (i - 1)
|
||||||
|
|
||||||
draw_diff_icon(chart, offsetX, ypos, diffIconWidth, diffIconHeight, selected)
|
DiffRectangle.render(timer, offsetX, ypos, diffIconScale, chart.difficulty, chart.level)
|
||||||
|
|
||||||
|
local _, titleHeight = gfx.LabelSize(chart.title)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER | gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER | gfx.TEXT_ALIGN_MIDDLE)
|
||||||
gfx.DrawLabel(chart.title, titleCenterX, ypos + diffIconHeight / 2, titleMaxWidth)
|
gfx.DrawLabel(chart.title, titleCenterX, ypos + titleHeight / 2, titleMaxWidth)
|
||||||
end
|
end
|
||||||
|
|
||||||
gfx.ForceRender()
|
gfx.ForceRender()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
draw_diff_icon = function(diff, x, y, w, h)
|
|
||||||
-- cut out the transparent part of the diff background image
|
|
||||||
local boxWidth = 140 / 122 * w
|
|
||||||
local boxHeight = 31 / 27 * h
|
|
||||||
local boxOffsetX = x - (boxWidth - w) / 2
|
|
||||||
local boxOffsetY = y - (boxHeight - h) / 2
|
|
||||||
|
|
||||||
local labelOffsetX = w / 12
|
|
||||||
local labelTextOffsetY = h / 12
|
|
||||||
|
|
||||||
gfx.BeginPath()
|
|
||||||
|
|
||||||
gfx.ImageRect(boxOffsetX, boxOffsetY, boxWidth, boxHeight, difficultyLabelImages[diff.difficulty + 1], 1, 0)
|
|
||||||
|
|
||||||
gfx.FontFace("dfmarugoth.ttf")
|
|
||||||
gfx.FontSize(math.floor(0.6 * h))
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT | gfx.TEXT_ALIGN_MIDDLE)
|
|
||||||
gfx.FastText(difficultyLabelText[diff.difficulty + 1], x + labelOffsetX, y + (h / 2) - labelTextOffsetY)
|
|
||||||
gfx.FontSize(math.floor(0.8 * h))
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT | gfx.TEXT_ALIGN_MIDDLE)
|
|
||||||
gfx.FastText(tostring(diff.level), x + w - labelOffsetX, y + (h / 2) - labelTextOffsetY)
|
|
||||||
end
|
|
||||||
|
|
||||||
draw_selected = function(challenge, x, y, w, h)
|
draw_selected = function(challenge, x, y, w, h)
|
||||||
if not challenge then
|
if not challenge then
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue