mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-07 14:22:36 +01:00
Updates
This commit is contained in:
parent
2185919df7
commit
d26cceee0e
@ -1,5 +1,4 @@
|
||||
import { Texture } from 'pixi.js';
|
||||
import { ICommunicationManager } from '../../communication';
|
||||
import { IFurnitureData } from './IFurnitureData';
|
||||
import { IGroupInformationManager } from './IGroupInformationManager';
|
||||
import { IIgnoredUsersManager } from './IIgnoredUsersManager';
|
||||
@ -29,7 +28,6 @@ export interface ISessionDataManager
|
||||
unignoreUser(name: string): void;
|
||||
isUserIgnored(name: string): boolean;
|
||||
getGroupBadge(groupId: number): string;
|
||||
communication: ICommunicationManager;
|
||||
userId: number;
|
||||
userName: string;
|
||||
figure: string;
|
||||
|
@ -99,37 +99,34 @@ export class AssetManager implements IAssetManager
|
||||
{
|
||||
if(!url || !url.length) return false;
|
||||
|
||||
const response = await fetch(url);
|
||||
|
||||
if(!response || response.status !== 200) return false;
|
||||
|
||||
const contentType = response.headers.get('Content-Type');
|
||||
|
||||
switch(contentType)
|
||||
if(url.endsWith('.nitro') || url.endsWith('.gif'))
|
||||
{
|
||||
case 'application/octet-stream': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const nitroBundle = await NitroBundle.from(buffer);
|
||||
const response = await fetch(url);
|
||||
|
||||
if(!response || response.status !== 200) return false;
|
||||
|
||||
const arrayBuffer = await response.arrayBuffer();
|
||||
|
||||
if(url.endsWith('.nitro'))
|
||||
{
|
||||
const nitroBundle = await NitroBundle.from(arrayBuffer);
|
||||
|
||||
await this.processAsset(nitroBundle.texture, nitroBundle.jsonFile as IAssetData);
|
||||
break;
|
||||
}
|
||||
case 'image/png':
|
||||
case 'image/jpeg': {
|
||||
const texture = await Assets.load<Texture>(url);
|
||||
|
||||
if(texture) this.setTexture(url, texture);
|
||||
break;
|
||||
}
|
||||
case 'image/gif': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const animatedGif = AnimatedGIF.fromBuffer(buffer);
|
||||
else
|
||||
{
|
||||
const animatedGif = AnimatedGIF.fromBuffer(arrayBuffer);
|
||||
const texture = animatedGif.texture;
|
||||
|
||||
if(texture) this.setTexture(url, texture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const texture = await Assets.load<Texture>(url);
|
||||
|
||||
if(texture) this.setTexture(url, texture);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -4,19 +4,8 @@ export * from './GetRoomManager';
|
||||
export * from './GetRoomMessageHandler';
|
||||
export * from './GetRoomObjectLogicFactory';
|
||||
export * from './GetRoomObjectVisualizationFactory';
|
||||
export * from './GetRoomPreviewerInstance';
|
||||
export * from './ImageResult';
|
||||
export * from './PetColorResult';
|
||||
export * from './RoomContentLoader';
|
||||
export * from './RoomEngine';
|
||||
export * from './RoomInstance';
|
||||
export * from './RoomManager';
|
||||
export * from './RoomMessageHandler';
|
||||
export * from './RoomObjectEventHandler';
|
||||
export * from './RoomObjectLogicFactory';
|
||||
export * from './RoomObjectManager';
|
||||
export * from './RoomObjectVisualizationFactory';
|
||||
export * from './RoomPreviewer';
|
||||
export * from './RoomVariableEnum';
|
||||
export * from './messages';
|
||||
export * from './object';
|
||||
export * from './object/logic';
|
||||
@ -30,7 +19,19 @@ export * from './object/visualization/pet';
|
||||
export * from './object/visualization/room';
|
||||
export * from './object/visualization/room/mask';
|
||||
export * from './object/visualization/room/utils';
|
||||
export * from './PetColorResult';
|
||||
export * from './renderer';
|
||||
export * from './renderer/cache';
|
||||
export * from './renderer/utils';
|
||||
export * from './RoomContentLoader';
|
||||
export * from './RoomEngine';
|
||||
export * from './RoomInstance';
|
||||
export * from './RoomManager';
|
||||
export * from './RoomMessageHandler';
|
||||
export * from './RoomObjectEventHandler';
|
||||
export * from './RoomObjectLogicFactory';
|
||||
export * from './RoomObjectManager';
|
||||
export * from './RoomObjectVisualizationFactory';
|
||||
export * from './RoomPreviewer';
|
||||
export * from './RoomVariableEnum';
|
||||
export * from './utils';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ICommunicationManager, IFurnitureData, IGroupInformationManager, IMessageComposer, IProductData, ISessionDataManager, NoobnessLevelEnum, SecurityLevel } from '@nitrots/api';
|
||||
import { IFurnitureData, IGroupInformationManager, IMessageComposer, IProductData, ISessionDataManager, NoobnessLevelEnum, SecurityLevel } from '@nitrots/api';
|
||||
import { AccountSafetyLockStatusChangeMessageEvent, AccountSafetyLockStatusChangeParser, AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, EmailStatusResultEvent, FigureUpdateEvent, GetCommunication, GetUserTagsComposer, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, PetScratchFailedMessageEvent, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer, UserTagsMessageEvent } from '@nitrots/communication';
|
||||
import { GetConfiguration } from '@nitrots/configuration';
|
||||
import { GetEventDispatcher, MysteryBoxKeysUpdateEvent, NitroSettingsEvent, SessionDataPreferencesEvent, UserNameUpdateEvent } from '@nitrots/events';
|
||||
@ -401,11 +401,6 @@ export class SessionDataManager implements ISessionDataManager
|
||||
GetCommunication().connection.send(composer);
|
||||
}
|
||||
|
||||
public get communication(): ICommunicationManager
|
||||
{
|
||||
return GetCommunication();
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
|
Loading…
x
Reference in New Issue
Block a user