CLOSES #788, CLOSES #795, CLOSES #796, CLOSES #797, CLOSES #805, CLOSES #826, CLOSES #833, CLOSES #835, CLOSES #837, CLOSES #844, CLOSES #845, CLOSES #846, CLOSES #847

This commit is contained in:
bryanthaboi
2026-08-05 11:09:05 -04:00
parent d18824cfae
commit f6392e8932
32 changed files with 2776 additions and 114 deletions
+14 -1
View File
@@ -99,7 +99,20 @@ end
function NamingScreen:confirm()
local name = table.concat(self.glyphs)
if name == "" then
name = (self.presets and self.presets[1]) or self.default or "A"
-- An empty confirm (START, or the ED cell with nothing typed) must not
-- invent a letter (#833). DisplayNamingScreen seeds wStringBuffer with
-- '@' (engine/menus/naming_screen.asm) and every caller checks that first
-- byte: AskName falls through to .declinedNickname, copying the species
-- name over the nick slot -- vanilla's "un-nicknamed", which this port
-- models as mon.nickname == nil (src/save_convert/GenSave.lua), so
-- evolution can still rename the mon. DisplayNameRaterScreen takes
-- .playerCancelled and keeps the old nick, which is why an explicit
-- opts.default still wins here. Player/rival naming
-- (oak_speech2.asm ChoosePlayerName) re-opens on '@' and never accepts an
-- empty result; the port keeps its preset fallback for that.
-- Contract for callers: "" means NO name -- BattleState:askNicknameUI and
-- Commands.give_pokemon both guard on #name > 0 before setting nickname.
name = (self.presets and self.presets[1]) or self.default or ""
end
Sound.play(self.game.data, "Press_AB")
self.game.stack:pop()