mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-06 09:05:48 -04:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user