gauge: fade-in cells land on the new cell; skin-set clear mark offset #15
@@ -16,6 +16,9 @@ function Gauge.new(is_2p, dan, string_diff, opts)
|
||||
self.base_fade = 1.0
|
||||
self.pool = {}
|
||||
self.fade_in = tex.get_option("gauge_cell_fade_in")
|
||||
-- cells the clear mark sits before the exact clear fraction (Lumen: 87/60 on the 87-cell art)
|
||||
local mark = tex.get_skin_config("gauge_clear_mark_offset")
|
||||
self.clear_mark_offset = mark and mark.x
|
||||
local screen = opts.screen or "game"
|
||||
|
||||
local cells = tex.get_skin_config("gauge_cells")
|
||||
@@ -167,7 +170,7 @@ function Gauge:render(y, mirror, idx, points, previous_points, max_points, clear
|
||||
local clear_point = clamp(clear_points * units // max_points, 1, units)
|
||||
-- Lumen puts the clear mark at the exact fraction minus 87/60 cells (x 897/967/1037 on
|
||||
-- easy/normal/hard), not on a cell edge
|
||||
local cpx = clear_points * units / max_points - units / 60
|
||||
local cpx = clear_points * units / max_points - (self.clear_mark_offset or units / 60)
|
||||
|
||||
if solid > 0 then
|
||||
self:blit(self.bar, nil, nil, y,
|
||||
@@ -197,8 +200,9 @@ function Gauge:render(y, mirror, idx, points, previous_points, max_points, clear
|
||||
end
|
||||
|
||||
if show_up then
|
||||
-- sprite sits on the cell that was just filled (length-1)
|
||||
local fx = length * bw -- glow rides the leading edge of the fill
|
||||
-- flash: the glow rides the leading edge of the fill; fade-in: the sprite is the new
|
||||
-- cell itself (the fill stops one cell short until it lands)
|
||||
local fx = (fade_in and length - 1 or length) * bw
|
||||
if length == clear_point then
|
||||
self:blit(self.clear_transition_fade, mirror, cpx * bw, y, nil, alpha, nil, idx)
|
||||
elseif length > clear_point then
|
||||
|
||||
Reference in new issue
Block a user