From 32d52b88c075f32b2553623dbbfe9385fdba174f Mon Sep 17 00:00:00 2001 From: thibautbus <310327033+thibautbus@users.noreply.github.com> Date: Tue, 22 Sep 2026 12:47:50 +0200 Subject: [PATCH] Show only an egg's name in its FireRed party slot The party menu drew an egg's slot like any other mon's: level, gender, HP numbers and HP bar. pret's DisplayPartyPokemonData prints only the nickname for an egg and blits the slot without its HP frame (sSlotTilemap_MainNoHP / WideNoHP; pokefirered/src/party_menu.c:781, :2197), and DisplayPartyPokemonDescriptionData likewise skips the level and gender of an egg (party_menu.c:804). The slot now does the same, reusing the no-HP frame the description slots already draw. --- src/ui/game3/party_menu.lua | 9 ++++++++- tests/engine/game3_egg_screens_test.lua | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/ui/game3/party_menu.lua b/src/ui/game3/party_menu.lua index e01474fb..f6782538 100644 --- a/src/ui/game3/party_menu.lua +++ b/src/ui/game3/party_menu.lua @@ -2111,10 +2111,17 @@ local function draw_filled_slot(i, mon, selected) local info = slot_info(i) local desc = slot_description(i, mon) - PartyChrome.drawSlot(win.kind, win.left, win.top, selected, desc ~= nil) + -- pokefirered/src/party_menu.c:781 DisplayPartyPokemonData: an egg's slot + -- has no HP frame and shows only its nickname (gText_EggNickname). + local isEgg = Pokemon.isEgg(mon) + PartyChrome.drawSlot(win.kind, win.left, win.top, selected, desc ~= nil or isEgg) local name = Pokemon.displayName(mon) party_print(name, baseX + info.nick[1], baseY + info.nick[2], 56) + if isEgg then + if desc then party_print(desc, baseX + info.desc[1], baseY + info.desc[2], 64) end + return + end party_print("Lv" .. tostring(mon.level or 0), baseX + info.level[1], baseY + info.level[2], 32) local gender = mon.gender or (Pokemon.gender and Pokemon.gender(mon.species, mon.personality)) diff --git a/tests/engine/game3_egg_screens_test.lua b/tests/engine/game3_egg_screens_test.lua index 69b519a6..e5fa3191 100644 --- a/tests/engine/game3_egg_screens_test.lua +++ b/tests/engine/game3_egg_screens_test.lua @@ -1,8 +1,8 @@ #!/usr/bin/env luajit -- The screens that show a single mon draw an egg as an egg, as pret does with -- GetMonData(MON_DATA_SPECIES_OR_EGG) and MON_DATA_NICKNAME --- (pokefirered/src/pokemon.c:3245, :3020): the PC's hovered-mon panel, the --- summary's egg page, the trade scene, and the script string buffers. +-- (pokefirered/src/pokemon.c:3245, :3020): the party slots, the PC's hovered-mon +-- panel, the summary's egg page, the trade scene, and the script string buffers. package.path = "./?.lua;./?/init.lua;" .. package.path @@ -58,6 +58,22 @@ PcChrome.drawLeftDataPanel({ species = 172, nickname = "PICHU", level = 5, gende check(pics[1] == 172 and has(texts, "/PICHU") and has(texts, "Lv5"), "a hatched mon keeps its pic, species and level lines") +-- pokefirered/src/party_menu.c:781 DisplayPartyPokemonData, :2197 sSlotTilemap_MainNoHP +local PartyMenu = require("src.ui.game3.party_menu") +local PartyChrome = require("src.ui.game3.party_chrome") +local slotsHidingHp = {} +PartyChrome.drawSlot = function(kind, _, _, _, hideHp) + if kind ~= "empty" then slotsHidingHp[#slotsHidingHp + 1] = hideHp and true or false end +end +texts, slotsHidingHp = {}, {} +PartyMenu.show({ { species = 25, nickname = "SPARKY", level = 12, gender = "M", hp = 30, maxHp = 30 }, egg() }) +PartyMenu.draw() +PartyMenu.close() +check(has(texts, "OEUF") and has(texts, "SPARKY"), "the party names both mons: " .. table.concat(texts, " | ")) +check(not has(texts, "Lv5") and has(texts, "Lv12"), "an egg's party slot shows no level, the other one does") +check(slotsHidingHp[1] == false and slotsHidingHp[2] == true, + "and an egg's slot has no HP frame (hideHp = " .. tostring(slotsHidingHp[1]) .. ", " .. tostring(slotsHidingHp[2]) .. ")") + -- pokefirered/src/pokemon_summary_screen.c:4016 local SummaryMenu = require("src.ui.game3.summary_menu") local SummaryChrome = require("src.ui.game3.summary_chrome")