mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
The battle textbox redraws its text every frame, but only while a message was current. Once the player dismissed "Enemy X used GUST!" and the move animation started, nothing drew the text, so the box sat empty for the whole animation. The original game's animations never touch the textbox, so the text stays up. Draw the held lines while an animation is playing; everything else is unchanged. Co-authored-by: johnjohto <johnjohto@users.noreply.github.com>
This commit is contained in:
@@ -2860,6 +2860,32 @@ do
|
||||
eq(ys[1], 112, "battle text line 1 at row 14 (y=112)")
|
||||
eq(ys[2], 128, "battle text line 2 at row 16 (y=128)")
|
||||
end
|
||||
|
||||
-- issue #296: the used-move text stays up during the move animation.
|
||||
-- current is nil once the message is dismissed, but shown still holds the
|
||||
-- lines; pokered's animations never touch the textbox tilemap.
|
||||
do
|
||||
local Font = require("src.render.Font")
|
||||
local drawn, origCode, origBox = 0, Font.drawCode, Font.drawBox
|
||||
Font.drawBox = function() end
|
||||
Font.drawCode = function() drawn = drawn + 1 end
|
||||
local battle = setmetatable({
|
||||
phase = "messages",
|
||||
current = nil,
|
||||
animPlaying = true,
|
||||
shown = { { 0x80 }, { 0x81 } },
|
||||
}, BattleState)
|
||||
battle:drawTextArea()
|
||||
eq(drawn, 2, "text keeps drawing while the move animation plays")
|
||||
|
||||
-- without an animation the dismissed message is still hidden, so states
|
||||
-- that clear the box (e.g. pushed UI rows) are unchanged
|
||||
drawn = 0
|
||||
battle.animPlaying = nil
|
||||
battle:drawTextArea()
|
||||
Font.drawCode, Font.drawBox = origCode, origBox
|
||||
eq(drawn, 0, "no current message and no animation draws no text")
|
||||
end
|
||||
end
|
||||
|
||||
-- ================= BUGS.md batch: ledge-shadow =================
|
||||
|
||||
Reference in New Issue
Block a user