mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 19:24:01 +02:00
CLOSES #1206, CLOSES #1189, CLOSES #1175, CLOSES #1129, CLOSES #1119, CLOSES #1089, CLOSES #1073, CLOSES #1069, CLOSES #1065, CLOSES #1010, CLOSES #990, CLOSES #989, CLOSES #988, CLOSES #978, CLOSES #944, CLOSES #936, CLOSES #1221, CLOSES #1220, CLOSES #1193, CLOSES #1101, CLOSES #1066, CLOSES #1056, CLOSES #1041, CLOSES #984, CLOSES #1225, CLOSES #1214, CLOSES #1011, CLOSES #1035, CLOSES #1219, CLOSES #1048, CLOSES #1047, CLOSES #964, CLOSES #949, CLOSES #1149, CLOSES #1007, CLOSES #914, CLOSES #1115, CLOSES #1146, CLOSES #999, CLOSES #1207, CLOSES #1029, CLOSES #1120, CLOSES #987, CLOSES #983
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package.path = "./?.lua;./?/init.lua;" .. package.path
|
||||
|
||||
local T = require("tests.harness")
|
||||
local GenSave = require("src.save_convert.GenSave")
|
||||
local romText = require("src.core.RomText")
|
||||
|
||||
local localized = {
|
||||
text = {
|
||||
_MoveIsDisabledText = "The move {RAM:wNameBuffer} from {USER} is disabled!",
|
||||
},
|
||||
}
|
||||
T.eq(romText(localized, "_MoveIsDisabledText", "%s's %s is disabled!", {
|
||||
USER = "PIKACHU", ["RAM:wNameBuffer"] = "THUNDER",
|
||||
}), "The move THUNDER from PIKACHU is disabled!",
|
||||
"named ROM tokens survive translation reordering")
|
||||
|
||||
GenSave.setCharmap(loadfile("src/save_convert/data/charmap.lua")())
|
||||
local data = {
|
||||
pokemon = {}, moves = {}, items = {}, maps = {},
|
||||
hiddenItems = loadfile("src/save_convert/data/hidden_items.lua")(),
|
||||
}
|
||||
local save = {
|
||||
player = { name = "RED", id = 1, map = "PALLET_TOWN", x = 0, y = 0 },
|
||||
rival = { name = "BLUE" }, party = {}, boxes = {}, inventory = {},
|
||||
pcItems = {}, flags = {}, pokedex = { seen = {}, owned = {} },
|
||||
hiddenTaken = {
|
||||
VIRIDIAN_FOREST_1_18 = true,
|
||||
VIRIDIAN_CITY_14_4 = true,
|
||||
},
|
||||
}
|
||||
for i = 1, 12 do save.boxes[i] = {} end
|
||||
local bytes = GenSave.encode(save, data, nil)
|
||||
local decoded = GenSave.decode(bytes, data)
|
||||
T.check(decoded.hiddenTaken.VIRIDIAN_FOREST_1_18,
|
||||
"Viridian Forest hidden potion imports from wObtainedHiddenItemsFlags")
|
||||
T.check(decoded.hiddenTaken.VIRIDIAN_CITY_14_4,
|
||||
"Viridian City hidden potion imports from wObtainedHiddenItemsFlags")
|
||||
T.check(not decoded.hiddenTaken.ROUTE_9_14_7,
|
||||
"an uncollected hidden item remains available")
|
||||
|
||||
love = love or require("tests.love_stub")
|
||||
local start = require("src.ui.StartMenu").new({
|
||||
data = {}, save = {
|
||||
flags = {}, party = {}, inventory = {}, options = {},
|
||||
player = { name = "RED" }, pokedex = { owned = {} },
|
||||
},
|
||||
})
|
||||
local pokemonRow
|
||||
for _, row in ipairs(start.items) do
|
||||
if row.label == "POKéMON" then pokemonRow = row break end
|
||||
end
|
||||
T.check(pokemonRow and pokemonRow.keepOpen,
|
||||
"the empty-party POKéMON row leaves the start menu open")
|
||||
|
||||
T.finish("open menu bugs 949 and 1149")
|
||||
Reference in New Issue
Block a user