Resolve Ruby and Sapphire's party prompts again each time the menu opens

The prompt a mode shows (Choose a POKéMON., Move to where?...) was kept on the party menu for the rest of the session. PartyMenu.show now clears it, like the menu's other per-open state, so a prompt is resolved once per opening.
This commit is contained in:
thibautbus
2026-10-06 22:06:51 +02:00
parent 870411b88e
commit 2d404a7dc7
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -945,6 +945,7 @@ function PartyMenu.show(sessionParty, moveOverlay, opts)
end
opts = opts or {}
PartyMenu._order = nil
PartyMenu._rsPrompt = nil
if opts.mode == "battle_switch" or opts.mode == "battle_faint" or (opts.mode == "use" and opts.battleOrder) then
local party0 = sessionParty or (opts.session and opts.session.party)
local ov0 = moveOverlay or (opts.session and (opts.session.move_overlay or opts.session.moveOverlay))
@@ -254,6 +254,7 @@ local menu = { ACTIONS = { "SUMMARY", "CANCEL" }, actionCursor = 1,
_actionTextsFor = function(list) resolved = resolved + 1 return { "RESUME", "RETOUR" } end }
PartyData.drawActions(menu, false)
check(drawn[2] == "RESUME" and drawn[3] == "RETOUR" and resolved == 1, "the action menu draws the texts resolved for its list")
local displayName = package.loaded["src.core.game3.pokemon"].displayName
package.loaded["src.core.game3.pokemon"].displayName = function(mon) return mon.nickname end
BUNDLE.text = { ["PartyMenuPromptTexts[5]"] = { { t = "text", s = "Que faire avec " }, { t = "strvar", n = 1 },
{ t = "text", s = "?" }, { t = "eos" } } }
@@ -264,6 +265,12 @@ BUNDLE.text = {}
drawn = {}
PartyData.drawActions(menu, false)
check(drawn[1] == "Que faire avec POUSSIFEU?", "the prompt resolved for this menu is drawn again without a lookup")
BUNDLE.text = { ["PartyMenuPromptTexts[5]"] = { { t = "text", s = "Que faire avec " }, { t = "strvar", n = 1 },
{ t = "text", s = "?" }, { t = "eos" } } }
drawn, menu.ACTIONS, menu._party = {}, { "SUMMARY", "CANCEL" }, { { nickname = "GOBOU" } }
PartyData.drawActions(menu, false)
check(drawn[1] == "Que faire avec GOBOU?", "a new action menu names its own POKeMON")
package.loaded["src.core.game3.pokemon"].displayName = displayName
package.loaded["src.ui.game3.frlg_font"], package.loaded["src.ui.game3.chrome"] = font, chrome
package.loaded["src.ui.game3.rs.menu_cursor"], package.loaded["src.ui.game3.rs.party_chrome"] = cursor, partyChrome
if failed > 0 then