mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 20:19:39 +02:00
fix(manavoxel): rename inventory.ts to .svelte.ts for $state runes support
$state() is Svelte 5 runes syntax that only works in .svelte or .svelte.ts files. The Inventory class used $state for reactive slots/heldSlot which caused "ReferenceError: $state is not defined" in production builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
08744cd6fd
commit
13cbdf027b
5 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { type Inventory, type GameItem, MAX_INVENTORY_SLOTS } from '$lib/engine/inventory';
|
||||
import { type Inventory, type GameItem, MAX_INVENTORY_SLOTS } from '$lib/engine/inventory.svelte';
|
||||
|
||||
let {
|
||||
inventory,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import type { GameItem } from '$lib/engine/inventory';
|
||||
import type { GameItem } from '$lib/engine/inventory.svelte';
|
||||
import type { ElementType, Rarity } from '@manavoxel/shared';
|
||||
|
||||
let {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { ParticleSystem } from './particles';
|
|||
import { AreaManager, generateDemoStreet, generateDemoInterior } from './area-manager';
|
||||
import { UndoStack, brushStroke, floodFill, pipette, type ToolType } from '$lib/editor/tools';
|
||||
import { DEFAULT_MATERIALS, MATERIAL_AIR, type Material } from '@manavoxel/shared';
|
||||
import type { Inventory } from './inventory';
|
||||
import type { Inventory } from './inventory.svelte';
|
||||
|
||||
export class GameEngine {
|
||||
app: Application;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import InventoryUI from '$lib/components/Inventory.svelte';
|
||||
import PropertyPanel from '$lib/editor/property-panel.svelte';
|
||||
import TriggerEditor from '$lib/editor/trigger-editor.svelte';
|
||||
import { Inventory, createItem, type GameItem } from '$lib/engine/inventory';
|
||||
import { Inventory, createItem, type GameItem } from '$lib/engine/inventory.svelte';
|
||||
import { gameStore } from '$lib/data/local-store';
|
||||
import { loadWorld, getAllWorlds } from '$lib/data/world-loader';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue