🆙 Removed the generic.asset.url

We have removed the generic.asset.url and all is now in the renderer, so easy to edit and no more wrongly loaded assets
This commit is contained in:
duckietm
2026-02-06 13:00:22 +01:00
parent 501f918d0d
commit 4225dbdd90
336 changed files with 292 additions and 6548 deletions
+73
View File
@@ -106,6 +106,16 @@ export class AssetManager implements IAssetManager
case 'room':
await this.loadLocalRoom();
return true;
case 'place_holder':
case 'place_holder_wall':
case 'place_holder_pet':
case 'tile_cursor':
case 'selection_arrow':
case 'avatar_additions':
case 'floor_editor':
case 'group_badge':
await this.loadLocalAsset(key);
return true;
}
return false;
@@ -207,6 +217,69 @@ export class AssetManager implements IAssetManager
collection.define(roomData);
}
private async loadLocalAsset(name: string): Promise<void>
{
let dataModule: any;
switch(name)
{
case 'place_holder':
dataModule = await import('./assets/place_holder/place_holder.asset.json');
break;
case 'place_holder_wall':
dataModule = await import('./assets/place_holder_wall/place_holder_wall.asset.json');
break;
case 'place_holder_pet':
dataModule = await import('./assets/place_holder_pet/place_holder_pet.asset.json');
break;
case 'tile_cursor':
dataModule = await import('./assets/tile_cursor/tile_cursor.asset.json');
break;
case 'selection_arrow':
dataModule = await import('./assets/selection_arrow/selection_arrow.asset.json');
break;
case 'avatar_additions':
dataModule = await import('./assets/avatar_additions/avatar_additions.asset.json');
break;
case 'floor_editor':
dataModule = await import('./assets/floor_editor/floor_editor.asset.json');
break;
case 'group_badge':
dataModule = await import('./assets/group_badge/group_badge.asset.json');
break;
default:
return;
}
const data = (dataModule.default ?? dataModule) as IAssetData;
const collection = this.createCollection(data, null) as GraphicAssetCollection;
if(!collection) return;
const allImages = import.meta.glob('./assets/*/images/*.png', { eager: true });
const prefix = `./assets/${name}/images/`;
for(const path in allImages)
{
if(!path.startsWith(prefix)) continue;
const mod = allImages[path];
const imageUrl = (mod.default ?? mod) as string;
const file = path.split('/').pop()!;
const rawName = file.replace(/\.png$/i, '');
const texture = await Assets.load<Texture>(imageUrl);
if(!texture) continue;
this.setTexture(rawName, texture);
collection.textures.set(name + '_' + rawName, texture);
collection.textures.set(rawName, texture);
}
collection.define(data);
}
private async processAsset(texture: Texture, data: IAssetData): Promise<IGraphicAssetCollection>
{
let spritesheet: Spritesheet<SpritesheetData> = null;
@@ -0,0 +1,4 @@
{
"type": "avatar_additions",
"name": "avatar_additions"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

@@ -0,0 +1,4 @@
{
"type": "floor_editor",
"name": "floor_editor"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

@@ -0,0 +1,4 @@
{
"type": "group_badge",
"name": "group_badge"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Some files were not shown because too many files have changed in this diff Show More