Merge pull request #30 from duckietm/Dev

Dev
This commit is contained in:
DuckieTM
2026-03-26 16:33:03 +01:00
committed by GitHub
3 changed files with 51 additions and 1 deletions
@@ -8,4 +8,5 @@
public static WARDROBE: string = 'wardrobe';
public static EFFECTS: string = 'effects';
public static PETS: string = 'pets';
}
public static NFT: string = 'nft';
}
@@ -243,6 +243,28 @@ export class AvatarAssetDownloadManager
return pendingLibraries;
}
public isNftPartSet(partSet: { parts: { type: string, id: number }[] }): boolean
{
if(!partSet || !partSet.parts) return false;
for(const part of partSet.parts)
{
if(!part) continue;
const name = (part.type + ':' + part.id);
const libraries = this._figureMap.get(name);
if(!libraries) continue;
for(const library of libraries)
{
if(library && library.libraryName.toLowerCase().includes('nft')) return true;
}
}
return false;
}
public downloadAvatarFigure(container: IAvatarFigureContainer, listener: IAvatarImageListener): void
{
const figure = container.getFigureString();
@@ -4,11 +4,13 @@ export class FigureSetIdsMessageParser implements IMessageParser
{
private _figureSetIds: number[];
private _boundFurnitureNames: string[];
private _figureSetNameMap: { [index: number]: string };
public flush(): boolean
{
this._figureSetIds = [];
this._boundFurnitureNames = [];
this._figureSetNameMap = {};
return true;
}
@@ -35,6 +37,26 @@ export class FigureSetIdsMessageParser implements IMessageParser
totalFurnitureNames--;
}
if(wrapper.bytesAvailable)
{
let totalMappings = wrapper.readInt();
while(totalMappings > 0)
{
const furnitureName = wrapper.readString();
let totalMappedSetIds = wrapper.readInt();
while(totalMappedSetIds > 0)
{
this._figureSetNameMap[wrapper.readInt()] = furnitureName;
totalMappedSetIds--;
}
totalMappings--;
}
}
return true;
}
@@ -47,4 +69,9 @@ export class FigureSetIdsMessageParser implements IMessageParser
{
return this._boundFurnitureNames;
}
public get figureSetNameMap(): { [index: number]: string }
{
return this._figureSetNameMap;
}
}