mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 16:21:30 +02:00
fix(switch): route remaining generated-art loads through Assets.resolve
Five more places called love.graphics.newImage directly on assets/generated paths, bypassing the NX prefix rewrite: - TradeAnim: cable/ball/bubble art - TownMap: Kanto background, cursor, nest icon - SurfingMinigame: surf bg/ob sheets - BattleState: party ball row, substitute doll All now resolve through Assets.resolve, which maps to the versioned blue/ or yellow/ save-dir prefix on NX only. Desktop and Android keep the mountVersion overlay behavior unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -92,7 +92,7 @@ function SurfingMinigame.new(game, onDone)
|
||||
self.banner = nil -- {quad, frames}: GOOD!/YEAH-/Oh no..
|
||||
|
||||
local function sheet(path)
|
||||
local ok, img = pcall(love.graphics.newImage, path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
|
||||
return ok and img or nil
|
||||
end
|
||||
self.bg = sheet("assets/generated/minigame/surf_1a.png")
|
||||
|
||||
+5
-4
@@ -104,7 +104,7 @@ local function loadBackground(game)
|
||||
local tm = (game.data.field or {}).townMap or {}
|
||||
local bg = tm.background
|
||||
if not (bg and bg.map and bg.tiles) then return nil end
|
||||
local ok, img = pcall(love.graphics.newImage, bg.tiles.path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(bg.tiles.path))
|
||||
if not ok then return nil end
|
||||
local quads = {}
|
||||
local iw, ih = img:getDimensions()
|
||||
@@ -115,7 +115,7 @@ local function loadBackground(game)
|
||||
end
|
||||
local cursor
|
||||
if bg.cursor then
|
||||
local okc, c = pcall(love.graphics.newImage, bg.cursor.path)
|
||||
local okc, c = pcall(love.graphics.newImage, require("src.render.Assets").resolve(bg.cursor.path))
|
||||
cursor = okc and c or nil
|
||||
end
|
||||
return { img = img, quads = quads, map = bg.map, cursor = cursor }
|
||||
@@ -192,8 +192,9 @@ function TownMap.new(game, opts)
|
||||
-- field.townMap.nest lifts the icon path out of the engine
|
||||
local nest = ((game.data.field or {}).townMap or {}).nest
|
||||
local ok, img = pcall(love.graphics.newImage,
|
||||
(nest and nest.path)
|
||||
or "assets/generated/townmap/nest.png")
|
||||
require("src.render.Assets").resolve(
|
||||
(nest and nest.path)
|
||||
or "assets/generated/townmap/nest.png"))
|
||||
self.nestIcon = ok and img or nil
|
||||
end
|
||||
if opts.fly then
|
||||
|
||||
@@ -29,7 +29,7 @@ local DEFAULT_ART = {
|
||||
|
||||
local function tryImage(path)
|
||||
if not path then return nil end
|
||||
local ok, img = pcall(love.graphics.newImage, path)
|
||||
local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve(path))
|
||||
return ok and img or nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user