Run the field-move white blink under its text, not after (#320)

The vanilla surf/strength flow closed the menu, showed the overworld,
then fired a solid-white blink on the empty map, and set the surfing
sprite while the player was still on land.  pokered's
GBPalWhiteOutWithDelay3 runs while the text is still up, so the blink
reads as a text flash.

The blink now sits under the textbox on the stack (only the top state
updates, so it holds its frames until the text closes), and surfing
applies only when the step onto the water happens.  Same reorder for
the party-menu STRENGTH texts.  The parity surf tests now dismiss the
got-on text before asserting the mount, matching the new order.
This commit is contained in:
johnjohto
2026-07-27 22:31:56 -04:00
parent 10acfe0710
commit b0868e7571
5 changed files with 75 additions and 17 deletions
+5 -3
View File
@@ -304,10 +304,12 @@ function PartyMenu:update(dt)
or Strings("{RAM:wNameBuffer} used\nSTRENGTH.")):gsub("{RAM:wNameBuffer}", name)
local t2 = (self.game.data.text._CanMoveBouldersText
or Strings("{RAM:wNameBuffer} can\nmove boulders.")):gsub("{RAM:wNameBuffer}", name)
-- like surf (#320): the blink belongs UNDER the texts, not as a
-- flashbang on the empty map after them; the stack only updates
-- the top state, so the flash holds until the texts close
self.game.stack:push(Transition.whiteFlash(self.game))
self.game.stack:push(TextBox.new(self.game, t1, function()
self.game.stack:push(TextBox.new(self.game, t2, function()
self.game.stack:push(Transition.whiteFlash(self.game))
end))
self.game.stack:push(TextBox.new(self.game, t2))
end, { auto = { sound = function()
return require("src.core.Sound").playCry(self.game.data, mon.species)
end } }))
+10 -14
View File
@@ -2004,23 +2004,19 @@ function OverworldState:trySurf(fx, fy)
if not mon then return end
local name = mon.nickname or Game.data.pokemon[mon.species].name
local p = self.player
p.surfing = true
require("src.core.Music").setSurfing(Game.data, true)
local text = (Game.data.text._SurfingGotOnText or Strings("{PLAYER} got on\n{RAM:wNameBuffer}!"))
:gsub("{RAM:wNameBuffer}", name)
-- GBPalWhiteOutWithDelay3 runs while the got-on text is still up
-- (start_sub_menus.asm .surf), so the blink reads as a text flash
-- instead of a flashbang on the empty map (#320). The flash sits
-- under the textbox on the stack: only the top state updates, so it
-- holds its frames until the text closes. surfing (and the sprite
-- swap) only applies when the step happens -- no paddling on land.
Game.stack:push(require("src.render.Transition").whiteFlash(Game))
Game.stack:push(TextBox.new(Game, text, function()
-- start_sub_menus.asm .surf: UseItem returns (mount + text done),
-- then GBPalWhiteOutWithDelay3 blinks before the simulated forward
-- press steps onto the water (or across a connection strip, like
-- Cinnabar's east coast onto Route 20)
local Transition = require("src.render.Transition")
if Transition.whiteFlash then
Game.stack:push(Transition.whiteFlash(Game, nil, function()
self:stepForwardOrCrossEdge(p.facing)
end))
else
self:stepForwardOrCrossEdge(p.facing)
end
p.surfing = true
require("src.core.Music").setSurfing(Game.data, true)
self:stepForwardOrCrossEdge(p.facing)
end))
end