refactor items logic

This commit is contained in:
Peter Stockings
2026-01-22 22:04:23 +11:00
parent 4129f5390f
commit d2039df8c8
8 changed files with 220 additions and 118 deletions

View File

@@ -3,7 +3,7 @@ import { type World, type EntityId, type Vec2, type ActorType } from "../core/ty
import { TILE_SIZE } from "../core/constants";
import { idx, isWall } from "../engine/world/world-logic";
import { GAME_CONFIG } from "../core/config/GameConfig";
import { ITEMS } from "../core/config/Items";
import { ALL_TEMPLATES } from "../core/config/Items";
import { FovManager } from "./FovManager";
import { MinimapRenderer } from "./MinimapRenderer";
import { FxRenderer } from "./FxRenderer";
@@ -328,7 +328,7 @@ export class DungeonRenderer {
// Create sprite
// Look up sprite index from config
const itemConfig = ITEMS[itemId];
const itemConfig = ALL_TEMPLATES[itemId as keyof typeof ALL_TEMPLATES];
const texture = itemConfig?.textureKey ?? "items";
const frame = itemConfig?.spriteIndex ?? 0;