Strip Gen 2 text terminator from intro and gender select, use × glyph in Gen 1 item lists

This commit is contained in:
bryanthaboi
2026-09-02 18:05:09 -04:00
parent 61c416b23e
commit 4e32ca1de3
21 changed files with 304 additions and 27 deletions
+2 -2
View File
@@ -2612,11 +2612,11 @@ function BattleState:openOldManBag()
-- inventory) differs by version: pokered's OldManItemList has 50
-- POKé BALLs; pokeyellow's SimulatedInputBattleItemList, shared by
-- the Viridian tutorial and Oak's catch, has one.
local qty = require("src.core.GameVersion").isYellow() and "x1" or "x50"
local qty = require("src.core.GameVersion").isYellow() and 1 or 50
-- the tutorial bag rides DisplayBagMenu's LIST_MENU_BOX over the battle
-- screen (engine/battle/core.asm:2210)
list = ListMenu.new(game, "ITEMS", {
{ value = "POKE_BALL", label = Strings("POKé BALL"), right = qty },
{ value = "POKE_BALL", label = Strings("POKé BALL"), count = qty },
}, {
itemBox = true,
script = function(l)
+2 -2
View File
@@ -24,7 +24,7 @@ local function buildItems(game)
table.insert(items, {
value = id,
label = def and def.name or id,
right = (not unsellable) and ("x" .. game.save.inventory[id]) or nil,
count = (not unsellable) and game.save.inventory[id] or nil,
})
end
-- the $ff terminator's row: CANCEL is selectable and exits like B
@@ -346,7 +346,7 @@ local function vanillaUseOn(game, battle, id, target, list, moveIndex, picker)
for i, it in ipairs(list.items) do
if it.value == id then
local left = game.save.inventory[id]
if left then it.right = "x" .. left else table.remove(list.items, i) end
if left then it.count = left else table.remove(list.items, i) end
break
end
end
+5 -3
View File
@@ -310,12 +310,14 @@ function ListMenu:drawItemBox()
elseif item.price then
-- home/list_menu.asm:410-424
Font.draw(item.price, ITEM_QTY_END - Font.width(item.price), y + 8)
elseif item.right then
elseif item.count then
-- '×' at column 14, PrintNumber's two right-aligned digits after it
-- (home/list_menu.asm:479-490)
local count = item.right:sub(2)
Font.draw(item.right:sub(1, 1), ITEM_QTY_X, y + 8)
local count = tostring(item.count)
Font.draw("\xc3\x97", ITEM_QTY_X, y + 8)
Font.draw(count, ITEM_QTY_END - Font.width(count), y + 8)
elseif item.right then
Font.draw(item.right, ITEM_QTY_END - Font.width(item.right), y + 8)
end
if i == self.index and (self.cursorBlank or 0) == 0 then
Font.drawCode(self.hollowIndex == i
+2 -2
View File
@@ -34,7 +34,7 @@ local function buildItems(game, store, order)
table.insert(items, {
value = id,
label = itemName(game, id),
right = "x" .. store[id],
count = store[id],
})
end
end
@@ -77,7 +77,7 @@ local function refreshRow(list, store, id)
for i, it in ipairs(list.items) do
if it.value == id then
if store[id] then
it.right = "x" .. store[id]
it.count = store[id]
else
table.remove(list.items, i)
end
+2 -2
View File
@@ -123,7 +123,7 @@ local function sellItems(game)
table.insert(items, {
value = id,
label = def and def.name or id,
right = (not keyed) and ("x" .. game.save.inventory[id]) or nil,
count = (not keyed) and game.save.inventory[id] or nil,
})
end
items[#items + 1] = { cancel = true, label = Strings("CANCEL") }
@@ -207,7 +207,7 @@ local function sell(game, menu)
Bag.remove(game.save, item.value, qty)
local left = game.save.inventory[item.value]
if left then
item.right = "x" .. left
item.count = left
else
list:removeCurrent()
end
+3 -2
View File
@@ -2,6 +2,7 @@
-- PlayerProfileSetup runs before OakSpeech (engine/menus/intro_menu.asm:61-83).
local Chrome = require("src.ui.gen2.Chrome")
local CommonText = require("src.core.gen2.CommonText")
local Music = require("src.core.Music")
local RomText = require("src.core.RomText")
local Sound = require("src.core.Sound")
@@ -56,8 +57,8 @@ function GenderSelect.new(game, opts)
-- `db 1 ; default option`: the cursor opens on Boy.
self.cursor = 1
self.exit = nil
self.text = RomText(self.data, "_AreYouABoyOrAreYouAGirlText",
FALLBACK)
self.text = CommonText.plain(RomText(self.data,
"_AreYouABoyOrAreYouAGirlText", FALLBACK))
return self
end
+2 -1
View File
@@ -37,6 +37,7 @@
-- love.graphics.newImage skips overrides/ and AssetTransform output.
local Assets = require("src.render.Assets")
local Chrome = require("src.ui.gen2.Chrome")
local CommonText = require("src.core.gen2.CommonText")
local FieldMoves = require("src.world.gen2.FieldMoves")
local Font = require("src.render.Font")
local Gen2Save = require("src.core.gen2.Save")
@@ -447,7 +448,7 @@ function OakSpeech:openNamePick(step)
end
function OakSpeech:lastPageLines(key)
local body = self:text(key)
local body = CommonText.plain(self:text(key))
local pages = {}
for page in (body .. "\f"):gmatch("(.-)\f") do
pages[#pages + 1] = page
+2 -1
View File
@@ -26,6 +26,7 @@ local FlagNames = require("src.core.gen2.FlagNames")
local GbcPalette = require("src.render.GbcPalette")
local Gen2Save = require("src.core.gen2.Save")
local Clock = require("src.core.gen2.Clock")
local CommonText = require("src.core.gen2.CommonText")
local Font = require("src.render.Font")
local Palettes = require("src.world.gen2.Palettes")
local Phone = require("src.core.gen2.Phone")
@@ -1141,7 +1142,7 @@ function Pokegear:phoneText(name)
if not entry then return "" end
local text = self.textData
or (self.game and self.game.world and self.game.world.text)
local extracted = text and text[entry.key]
local extracted = CommonText.plain(text and text[entry.key])
if extracted and extracted ~= "" then return extracted end
return Strings(entry.body)
end