diff --git a/src/ui/game3/party_menu.lua b/src/ui/game3/party_menu.lua index 7002fcf4..306cf006 100644 --- a/src/ui/game3/party_menu.lua +++ b/src/ui/game3/party_menu.lua @@ -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)) diff --git a/tests/engine/game3_rs_translation_runtime_test.lua b/tests/engine/game3_rs_translation_runtime_test.lua index 9f859b2b..70c7421c 100644 --- a/tests/engine/game3_rs_translation_runtime_test.lua +++ b/tests/engine/game3_rs_translation_runtime_test.lua @@ -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