From 17243a7d8ba7a69f7e875d23d6bf5f17496e60f3 Mon Sep 17 00:00:00 2001 From: Andrew Quenehen Date: Mon, 3 Aug 2026 15:31:58 -0300 Subject: [PATCH] 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 --- src/battle/BattleState.lua | 5 +++-- src/ui/SurfingMinigame.lua | 2 +- src/ui/TownMap.lua | 9 +++++---- src/ui/TradeAnim.lua | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/battle/BattleState.lua b/src/battle/BattleState.lua index fb9456c3..e2f01d28 100644 --- a/src/battle/BattleState.lua +++ b/src/battle/BattleState.lua @@ -4511,7 +4511,7 @@ end local ballQuads function BattleState:drawBallRow(party, x, y, dx) if ballQuads == nil then - local ok, img = pcall(love.graphics.newImage, "assets/generated/battle/balls.png") + local ok, img = pcall(love.graphics.newImage, require("src.render.Assets").resolve("assets/generated/battle/balls.png")) if ok then ballQuads = { img = img } for i = 0, 3 do @@ -4587,7 +4587,8 @@ local substDoll function BattleState:drawSubstituteDoll(battler) if substDoll == nil then local ok, img = pcall(love.graphics.newImage, - "assets/generated/sprites/monster.png") + require("src.render.Assets").resolve( + "assets/generated/sprites/monster.png")) if ok then local w, h = img:getDimensions() substDoll = { img = img, diff --git a/src/ui/SurfingMinigame.lua b/src/ui/SurfingMinigame.lua index 96659568..c596c540 100644 --- a/src/ui/SurfingMinigame.lua +++ b/src/ui/SurfingMinigame.lua @@ -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") diff --git a/src/ui/TownMap.lua b/src/ui/TownMap.lua index 59048c56..324dfabf 100644 --- a/src/ui/TownMap.lua +++ b/src/ui/TownMap.lua @@ -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 diff --git a/src/ui/TradeAnim.lua b/src/ui/TradeAnim.lua index 423c2d0f..db96f049 100644 --- a/src/ui/TradeAnim.lua +++ b/src/ui/TradeAnim.lua @@ -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