Author SHA1 Message Date
TaikoZhongandClaude Opus 5.5 6fdaf558de Nameplate: no dan on a plate without a player badge
The entry screen's plate shows only the title and the name, centred. This
replaces the left-end fill from the previous commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 15:01:30 +08:00
TaikoZhongandClaude Opus 5.5 8ceb2df868 Nameplate: without a badge, the dan chip's black reaches the plate's left end
The chip curves in around the player badge; on a plate without one that left
a light crescent at the left end. dan_emblem_bg_left fills it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:55:51 +08:00
TaikoZhongandClaude Opus 5.5 4560b5a4b1 Nameplate: keep the name clear of the dan chip
The name was centred right of half the badge plus the chip's width, but the
chip is drawn at its texture.json x: without a badge (the entry screen) the
name started at x 64 while the chip ends at x 126, so a name ran over the
dan text. The name is now centred right of the chip's actual right edge
(or the badge when there is no dan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:53:04 +08:00
+8 -3
View File
@@ -166,7 +166,8 @@ function Nameplate:draw(x, y, fade)
if self.now and self.shiny then self:draw_sparkles(x, y, fade) end
local dan_offset = 0
if self.dan ~= -1 then
-- a plate without a player badge (the entry screen) shows no dan
if self.dan ~= -1 and self.pnum_tex then
tex.draw_texture(self.dan_emblem_bg, { x = x, y = y, fade = fade })
if self.is_gold then
tex.draw_texture(self.dan_emblem_gold, { frame = self.dan, x = x, y = y, fade = fade })
@@ -187,9 +188,13 @@ function Nameplate:draw(x, y, fade)
local frame_top_h = self.frame_top_info.height
local outline_h = self.outline_info.height
local name_max = frame_top_w - self.padding - offset - dan_offset
-- the name is centred right of the badge, or right of the dan chip (drawn at its texture.json x,
-- so where it ends doesn't depend on the badge)
local left = offset
if dan_offset > 0 then left = math.max(offset, self.emblem_info.x[1] + dan_offset) end
local name_max = frame_top_w - self.padding - left
local name_width = math.min(self.name_text.width, name_max)
local name_x = x + offset + dan_offset + (outline_w - offset - dan_offset) / 2.0 - name_width / 2
local name_x = x + left + (outline_w - left) / 2.0 - name_width / 2
local name_y = y + outline_h / 2.0 + self.name_offset
self.name_text:draw({ x = name_x, y = name_y, x2 = name_width - self.name_text.width, fade = fade })