yellow alpha

This commit is contained in:
bryanthaboi
2026-07-29 11:46:32 -04:00
parent d6e36d457f
commit dde25ec7d0
54 changed files with 55593 additions and 698 deletions
+45 -3
View File
@@ -127,6 +127,9 @@ local function deposit(game)
end
table.remove(game.save.party, item.value)
table.insert(active, mon)
-- PIKAHAPPY_DEPOSITED (engine/pokemon/bills_pc.asm:247)
require("src.world.PikachuFollower")
.modifyHappiness(game.save, "DEPOSITED", mon)
local name = monName(game, mon)
game.stringBuffer = name
game.boxNumString = tostring(game.save.currentBox)
@@ -220,13 +223,43 @@ local function drawChrome(game)
love.graphics.setColor(1, 1, 1, 1)
end
-- PrintPCBox (engine/printer/printer.asm): Yellow's box-list print job,
-- box number plus each stored mon's name, level and dex number; the PNG
-- under prints/ stands in for the printer paper.
local function printBox(game)
local box = Boxes.active(game.save)
local Printer = require("src.core.Printer")
local TextBox = require("src.render.TextBox")
local h = 32 + math.max(1, #box) * 10
local saved, err = Printer.save("box_" .. (game.save.currentBox or 1),
160, h, function()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.rectangle("fill", 0, 0, 160, h)
love.graphics.setColor(0, 0, 0, 1)
Font.draw(Strings("BOX No.%d", game.save.currentBox or 1), 8, 8)
if #box == 0 then Font.draw(Strings("Empty."), 8, 24) end
for i, mon in ipairs(box) do
local def = game.data.pokemon[mon.species]
Font.draw(mon.nickname or (def and def.name) or tostring(mon.species),
8, 14 + i * 10)
Font.draw(Strings(":L%d No.%03d", mon.level or 0,
def and def.dex or 0), 88, 14 + i * 10)
end
love.graphics.setColor(1, 1, 1, 1)
end)
game.stack:push(TextBox.new(game, saved
and Strings("Printed BOX %d!\fSaved as\n%s\vin the save\nfolder.",
game.save.currentBox or 1, saved)
or Strings("Printer error!\n%s", tostring(err))))
end
function BoxMenu.new(game)
Boxes.ensure(game.save)
-- bills_pc.asm BillsPCMenu: TextBoxBorder at (0,0) with interior
-- 12x10 → total 14x12. "CHANGE BOX" / "WITHDRAW <PK><MN>" need the
-- full interior (cursor col + label). keepOpen so WITHDRAW/DEPOSIT/
-- RELEASE/CHANGE BOX leave this menu underneath (jp BillsPCMenu).
local menu = Menu.new(game, {
local items = {
{ label = Strings("WITHDRAW <PK><MN>"), keepOpen = true,
onSelect = function() withdraw(game) end },
{ label = Strings("DEPOSIT <PK><MN>"), keepOpen = true,
@@ -235,10 +268,19 @@ function BoxMenu.new(game)
onSelect = function() release(game) end },
{ label = Strings("CHANGE BOX"), keepOpen = true,
onSelect = function() changeBox(game) end },
{ label = Strings("SEE YA!") },
}
-- Yellow's PRINT BOX item (bills_pc.asm _YELLOW -> PrintPCBox): the
-- Game Boy Printer box list becomes a PNG under prints/, like the
-- Pokédex PRNT stand-in
if require("src.core.GameVersion").isYellow() then
items[#items + 1] = { label = Strings("PRINT BOX"), keepOpen = true,
onSelect = function() printBox(game) end }
end
items[#items + 1] = { label = Strings("SEE YA!") }
local menu = Menu.new(game, items,
-- Bill's PC runs silent end to end (BIT_NO_MENU_BUTTON_SOUND,
-- engine/menus/pokemon_pc.asm)
}, { tx = 0, ty = 0, tw = 14, th = 12, noSound = true })
{ tx = 0, ty = 0, tw = 14, th = #items * 2 + 2, noSound = true })
local baseDraw = menu.draw
function menu:draw()
baseDraw(self)