Update typings

This commit is contained in:
Bill 2021-07-14 03:10:54 -04:00
parent daf41b4b85
commit 1571d0ac89
49 changed files with 209 additions and 127 deletions

View File

@ -1,6 +1,6 @@
import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js';
import { BaseTexture, ILoaderResource, Loader, LoaderResource, Resource, Spritesheet, Texture } from 'pixi.js';
import { IGraphicAsset } from '../../room';
import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection';
import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset';
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
import { Disposable } from '../common/disposable/Disposable';
import { INitroLogger } from '../common/logger/INitroLogger';
@ -12,7 +12,7 @@ import { NitroBundle } from './NitroBundle';
export class AssetManager extends Disposable implements IAssetManager
{
private _logger: INitroLogger;
private _textures: Map<string, Texture>;
private _textures: Map<string, Texture<Resource>>;
private _collections: Map<string, IGraphicAssetCollection>;
constructor()
@ -29,7 +29,7 @@ export class AssetManager extends Disposable implements IAssetManager
return (name.substring(0, name.lastIndexOf('.')) || name);
}
public getTexture(name: string): Texture
public getTexture(name: string): Texture<Resource>
{
if(!name) return null;
@ -40,7 +40,7 @@ export class AssetManager extends Disposable implements IAssetManager
return existing;
}
public setTexture(name: string, texture: Texture): void
public setTexture(name: string, texture: Texture<Resource>): void
{
if(!name || !texture) return;

View File

@ -1,5 +1,5 @@
import { Spritesheet, Texture } from 'pixi.js';
import { Resource, Spritesheet, Texture } from 'pixi.js';
import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset';
import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection';
import { IAssetData } from './interfaces';
@ -7,8 +7,8 @@ import { IAssetData } from './interfaces';
export interface IAssetManager
{
dispose(): void;
getTexture(name: string): Texture;
setTexture(name: string, texture: Texture): void;
getTexture(name: string): Texture<Resource>;
setTexture(name: string, texture: Texture<Resource>): void;
getAsset(name: string): IGraphicAsset;
getCollection(name: string): IGraphicAssetCollection;
createCollection(data: IAssetData, spritesheet: Spritesheet): IGraphicAssetCollection;

View File

@ -1,15 +1,15 @@
import { Container, Point, Rectangle, Texture } from 'pixi.js';
import { Container, Point, Rectangle, Resource, Texture } from 'pixi.js';
export class ImageData
{
private _texture: Texture;
private _texture: Texture<Resource>;
private _container: Container;
private _rect: Rectangle;
private _regPoint: Point;
private _flipH: boolean;
private _colorTransform: number;
constructor(texture: Texture, rectangle: Rectangle, _arg_3: Point, flipH: boolean, color: number, container: Container = null)
constructor(texture: Texture<Resource>, rectangle: Rectangle, _arg_3: Point, flipH: boolean, color: number, container: Container = null)
{
this._texture = texture;
this._container = container;
@ -28,7 +28,7 @@ export class ImageData
this._colorTransform = null;
}
public get texture(): Texture
public get texture(): Texture<Resource>
{
return this._texture;
}

View File

@ -1,11 +1,11 @@
import { ColorMatrix } from '@pixi/filter-color-matrix';
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
export interface IRoomCameraWidgetEffect
{
name: string;
minLevel: number;
texture: Texture;
texture: Texture<Resource>;
colorMatrix: ColorMatrix;
blendMode: number;
}

View File

@ -1,16 +1,16 @@
import { ColorMatrix } from '@pixi/filter-color-matrix';
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect';
export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect
{
private _name: string;
private _minLevel: number = -1;
private _texture: Texture = null;
private _texture: Texture<Resource> = null;
private _colorMatrix: ColorMatrix = null;
private _blendMode: number = null;
constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: ColorMatrix = null, blendMode: number = null)
constructor(name: string, minLevel: number = -1, texture: Texture<Resource> = null, colorMatrix: ColorMatrix = null, blendMode: number = null)
{
this._name = name;
this._minLevel = minLevel;
@ -24,12 +24,12 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect
return this._name;
}
public get texture(): Texture
public get texture(): Texture<Resource>
{
return this._texture;
}
public set texture(texture: Texture)
public set texture(texture: Texture<Resource>)
{
this._texture = texture;
}

View File

@ -1,5 +1,5 @@
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from './messages';
import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from './messages';
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent';
import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent';
@ -639,6 +639,7 @@ export class NitroMessages implements IMessageConfiguration
// PET
this._events.set(IncomingHeader.PET_FIGURE_UPDATE, PetFigureUpdateEvent);
this._events.set(IncomingHeader.PET_INFO, PetInfoEvent);
this._events.set(IncomingHeader.PET_EXPERIENCE, PetExperienceEvent);
// SESSION
this._events.set(IncomingHeader.PLAYING_GAME, YouArePlayingGameEvent);

View File

@ -251,4 +251,5 @@ export class IncomingHeader
public static CATALOG_RECEIVE_PET_BREEDS = 3331;
public static CATALOG_APPROVE_NAME_RESULT = 1503;
public static OBJECTS_DATA_UPDATE = 1453;
public static PET_EXPERIENCE = 2156;
}

View File

@ -0,0 +1,15 @@
import { IMessageEvent, MessageEvent } from '../../../../../../core/communication/messages';
import { PetExperienceParser } from '../../../parser';
export class PetExperienceEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, PetExperienceParser);
}
public getParser(): PetExperienceParser
{
return this.parser as PetExperienceParser;
}
}

View File

@ -1,5 +1,6 @@
export * from './BreedingPetInfo';
export * from './PetBreedingResultData';
export * from './PetExperienceEvent';
export * from './PetFigureUpdateEvent';
export * from './PetInfoEvent';
export * from './RarityCategoryData';

View File

@ -0,0 +1,43 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
export class PetExperienceParser implements IMessageParser
{
private _petId: number;
private _roomIndex: number;
private _gainedExperience: number;
public flush(): boolean
{
this._petId = -1;
this._roomIndex = -1;
this._gainedExperience = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._petId = wrapper.readInt();
this._roomIndex = wrapper.readInt();
this._gainedExperience = wrapper.readInt();
return true;
}
public get petId(): number
{
return this._petId;
}
public get roomIndex(): number
{
return this._roomIndex;
}
public get gainedExperience(): number
{
return this._gainedExperience;
}
}

View File

@ -1,2 +1,3 @@
export * from './PetExperienceParser';
export * from './PetFigureUpdateParser';
export * from './PetInfoParser';

View File

@ -1,4 +1,4 @@
import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js';
import { BaseTexture, ILoaderResource, Loader, LoaderResource, Resource, Spritesheet, Texture } from 'pixi.js';
import { IAssetData } from '../../core/asset/interfaces';
import { NitroBundle } from '../../core/asset/NitroBundle';
import { INitroLogger } from '../../core/common/logger/INitroLogger';
@ -316,7 +316,7 @@ export class RoomContentLoader implements IFurnitureDataListener
return image;
}
public addAssetToCollection(collectionName: string, assetName: string, texture: Texture): boolean
public addAssetToCollection(collectionName: string, assetName: string, texture: Texture<Resource>): boolean
{
const collection = this.getCollection(collectionName);

View File

@ -1,4 +1,4 @@
import { Container, DisplayObject, Matrix, Point, Rectangle, RenderTexture, Sprite, Texture } from 'pixi.js';
import { Container, DisplayObject, Matrix, Point, Rectangle, RenderTexture, Resource, Sprite, Texture } from 'pixi.js';
import { IDisposable } from '../../core/common/disposable/IDisposable';
import { IUpdateReceiver } from '../../core/common/IUpdateReceiver';
import { NitroLogger } from '../../core/common/logger/NitroLogger';
@ -2727,7 +2727,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
this._roomObjectEventHandler.cancelRoomObjectInsert(this._activeRoomId);
}
private addOverlayIconSprite(k: Sprite, _arg_2: string, _arg_3: Texture, scale: number = 1): Sprite
private addOverlayIconSprite(k: Sprite, _arg_2: string, _arg_3: Texture<Resource>, scale: number = 1): Sprite
{
if(!k || !_arg_3) return;

View File

@ -3,7 +3,7 @@ import { IConnection } from '../../core/communication/connections/IConnection';
import { IVector3D } from '../../room/utils/IVector3D';
import { Vector3d } from '../../room/utils/Vector3d';
import { PetType } from '../avatar/pets/PetType';
import { ObjectsDataUpdateEvent } from '../communication';
import { ObjectsDataUpdateEvent, PetExperienceEvent } from '../communication';
import { ObjectsRollingEvent } from '../communication/messages/incoming/room/engine/ObjectsRollingEvent';
import { FurnitureFloorAddEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorAddEvent';
import { FurnitureFloorEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorEvent';
@ -142,6 +142,7 @@ export class RoomMessageHandler extends Disposable
this._connection.addMessageEvent(new RoomUnitChatWhisperEvent(this.onRoomUnitChatEvent.bind(this)));
this._connection.addMessageEvent(new RoomUnitTypingEvent(this.onRoomUnitTypingEvent.bind(this)));
this._connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this)));
this._connection.addMessageEvent(new PetExperienceEvent(this.onPetExperienceEvent.bind(this)));
this._connection.addMessageEvent(new YouArePlayingGameEvent(this.onYouArePlayingGameEvent.bind(this)));
this._connection.addMessageEvent(new FurnitureState2Event(this.onFurnitureState2Event.bind(this)));
this._connection.addMessageEvent(new IgnoreResultEvent(this.onIgnoreResultEvent.bind(this)));
@ -859,6 +860,15 @@ export class RoomMessageHandler extends Disposable
this._roomCreator.updateRoomObjectUserFigure(this._currentRoomId, parser.roomIndex, parser.figureData.figuredata, '' , '', parser.isRiding);
}
private onPetExperienceEvent(event: PetExperienceEvent): void
{
const parser = event.getParser();
if(!parser) return;
this._roomCreator.updateRoomObjectUserAction(this._currentRoomId, parser.roomIndex, RoomObjectVariable.FIGURE_GAINED_EXPERIENCE, parser.gainedExperience);
}
private onYouArePlayingGameEvent(event: YouArePlayingGameEvent): void
{
if(!event) return;

View File

@ -28,6 +28,7 @@ export class RoomObjectVariable
public static FIGURE_IS_TYPING: string = 'figure_is_typing';
public static FIGURE_IS_MUTED: string = 'figure_is_muted';
public static FIGURE_GAINED_EXPERIENCE: string = 'figure_gained_experience';
public static FIGURE_EXPERIENCE_TIMESTAMP: string = 'figure_experience_timestamp';
public static FIGURE_NUMBER_VALUE: string = 'figure_number_value';
public static FIGURE_IS_PLAYING_GAME: string = 'figure_is_playing_game';
public static FIGURE_GUIDE_STATUS: string = 'figure_guide_status';

View File

@ -9,6 +9,7 @@ import { PetFigureData } from '../../../../avatar/pets/PetFigureData';
import { PetType } from '../../../../avatar/pets/PetType';
import { MouseEventType } from '../../../../ui/MouseEventType';
import { RoomObjectMoveEvent } from '../../../events/RoomObjectMoveEvent';
import { ObjectAvatarExperienceUpdateMessage } from '../../../messages';
import { ObjectAvatarChatUpdateMessage } from '../../../messages/ObjectAvatarChatUpdateMessage';
import { ObjectAvatarFigureUpdateMessage } from '../../../messages/ObjectAvatarFigureUpdateMessage';
import { ObjectAvatarPetGestureUpdateMessage } from '../../../messages/ObjectAvatarPetGestureUpdateMessage';
@ -213,6 +214,14 @@ export class PetLogic extends MovingObjectLogic
return;
}
if(message instanceof ObjectAvatarExperienceUpdateMessage)
{
model.setValue(RoomObjectVariable.FIGURE_EXPERIENCE_TIMESTAMP, this.time);
model.setValue(RoomObjectVariable.FIGURE_GAINED_EXPERIENCE, message.gainedExperience);
return;
}
}
public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void

View File

@ -1,4 +1,4 @@
import { BLEND_MODES, Texture } from 'pixi.js';
import { BLEND_MODES, Resource, Texture } from 'pixi.js';
import { AdvancedMap } from '../../../../../core/utils/AdvancedMap';
import { AlphaTolerance } from '../../../../../room/object/enum/AlphaTolerance';
import { RoomObjectSpriteType } from '../../../../../room/object/enum/RoomObjectSpriteType';
@ -1090,7 +1090,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
}
}
public getAvatarRenderAsset(name: string): Texture
public getAvatarRenderAsset(name: string): Texture<Resource>
{
const url = (Nitro.instance.getConfiguration<string>('images.url') + '/additions/' + name + '.png');

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IAssetData } from '../../../../../core/asset/interfaces';
import { Disposable } from '../../../../../core/common/disposable/Disposable';
import { IObjectVisualizationData } from '../../../../../room/object/visualization/IRoomObjectVisualizationData';
@ -37,7 +37,7 @@ export class AvatarVisualizationData extends Disposable implements IObjectVisual
return avatarImage;
}
public getAvatarRendererAsset(name: string): Texture
public getAvatarRendererAsset(name: string): Texture<Resource>
{
if(!this._avatarRenderer) return null;
@ -58,4 +58,4 @@ export class AvatarVisualizationData extends Disposable implements IObjectVisual
{
return 0;
}
}
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite';
import { Nitro } from '../../../../../Nitro';
import { AvatarVisualization } from '../AvatarVisualization';
@ -12,7 +12,7 @@ export class FloatingHeartAddition extends ExpressionAddition
private static STATE_FLOAT: number = 2;
private static STATE_COMPLETE: number = 3;
private _asset: Texture;
private _asset: Texture<Resource>;
private _startTime: number;
private _delta: number;
private _offsetY: number;

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite';
import { Nitro } from '../../../../../Nitro';
import { AvatarVisualization } from '../AvatarVisualization';
@ -14,7 +14,7 @@ export class FloatingIdleZAddition implements IAvatarAddition
private _id: number;
private _visualization: AvatarVisualization;
private _asset: Texture;
private _asset: Texture<Resource>;
private _startTime: number;
private _offsetY: number;
private _scale: number;

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite';
import { AvatarVisualization } from '../AvatarVisualization';
import { IAvatarAddition } from './IAvatarAddition';
@ -7,7 +7,7 @@ export class MutedBubbleAddition implements IAvatarAddition
{
private _id: number;
private _visualization: AvatarVisualization;
private _asset: Texture;
private _asset: Texture<Resource>;
constructor(id: number, visualization: AvatarVisualization)
{

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite';
import { AvatarVisualization } from '../AvatarVisualization';
import { IAvatarAddition } from './IAvatarAddition';
@ -7,7 +7,7 @@ export class NumberBubbleAddition implements IAvatarAddition
{
private _id: number;
private _visualization: AvatarVisualization;
private _asset: Texture;
private _asset: Texture<Resource>;
private _scale: number;
private _number: number;
private _numberValueFadeDirection: number;
@ -180,4 +180,4 @@ export class NumberBubbleAddition implements IAvatarAddition
{
return this._id;
}
}
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite';
import { AvatarVisualization } from '../AvatarVisualization';
import { IAvatarAddition } from './IAvatarAddition';
@ -7,7 +7,7 @@ export class TypingBubbleAddition implements IAvatarAddition
{
private _id: number;
private _visualization: AvatarVisualization;
private _asset: Texture;
private _asset: Texture<Resource>;
private _relativeDepth: number;
constructor(id: number, visualization: AvatarVisualization)
@ -96,4 +96,4 @@ export class TypingBubbleAddition implements IAvatarAddition
{
this._relativeDepth = depth;
}
}
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { Nitro } from '../../../../Nitro';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureVisualization } from './FurnitureVisualization';
@ -80,7 +80,7 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization
return flag;
}
protected imageReady(texture: Texture, imageUrl: string): void
protected imageReady(texture: Texture<Resource>, imageUrl: string): void
{
if(!texture)
{

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { DirectionalOffsetData } from '../data/DirectionalOffsetData';
import { FurnitureBrandedImageVisualization } from './FurnitureBrandedImageVisualization';
@ -6,7 +6,7 @@ export class FurnitureRoomBackgroundVisualization extends FurnitureBrandedImageV
{
private _imageOffset: DirectionalOffsetData;
protected imageReady(texture: Texture, imageUrl: string): void
protected imageReady(texture: Texture<Resource>, imageUrl: string): void
{
super.imageReady(texture, imageUrl);
@ -56,4 +56,4 @@ export class FurnitureRoomBackgroundVisualization extends FurnitureBrandedImageV
{
return super.getLayerZOffset(scale, direction, layerId) + (-(this._offsetZ));
}
}
}

View File

@ -1,4 +1,4 @@
import { Matrix, Rectangle, Sprite, Texture } from 'pixi.js';
import { Matrix, Rectangle, Resource, Sprite, Texture } from 'pixi.js';
import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset';
import { TextureUtils } from '../../../../../room/utils/TextureUtils';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
@ -8,7 +8,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat
protected static THUMBNAIL: string = 'THUMBNAIL';
private _thumbnailAssetNameNormal: string;
private _thumbnailImageNormal: Texture;
private _thumbnailImageNormal: Texture<Resource>;
private _thumbnailDirection: number;
private _thumbnailChanged: boolean;
@ -27,7 +27,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat
return !(this._thumbnailImageNormal == null);
}
public setThumbnailImages(k: Texture): void
public setThumbnailImages(k: Texture<Resource>): void
{
this._thumbnailImageNormal = k;
this._thumbnailChanged = true;
@ -61,7 +61,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat
this._thumbnailDirection = this.direction;
}
private addThumbnailAsset(k: Texture, scale: number): void
private addThumbnailAsset(k: Texture<Resource>, scale: number): void
{
let layerId = 0;
@ -88,7 +88,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat
}
}
private generateTransformedThumbnail(texture: Texture, asset: IGraphicAsset): Texture
private generateTransformedThumbnail(texture: Texture<Resource>, asset: IGraphicAsset): Texture<Resource>
{
const _local_3 = 1.1;
const matrix = new Matrix();

View File

@ -1,4 +1,4 @@
import { Graphics, Matrix, Point, Rectangle, RenderTexture, Texture } from 'pixi.js';
import { Graphics, Matrix, Point, Rectangle, RenderTexture, Resource, Texture } from 'pixi.js';
import { IRoomPlane } from '../../../../../room/object/visualization/IRoomPlane';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { IVector3D } from '../../../../../room/utils/IVector3D';
@ -149,7 +149,7 @@ export class RoomPlane implements IRoomPlane
return this._canBeVisible;
}
public get bitmapData(): Texture
public get bitmapData(): Texture<Resource>
{
if(!this.visible || !this._bitmapData) return null;
@ -295,7 +295,7 @@ export class RoomPlane implements IRoomPlane
this._disposed = true;
}
public copyBitmapData(k: Texture): Texture
public copyBitmapData(k: Texture<Resource>): Texture<Resource>
{
if(!this.visible || !this._bitmapData || !k) return null;

View File

@ -1,4 +1,4 @@
import { Rectangle, RenderTexture, Texture } from 'pixi.js';
import { Rectangle, RenderTexture, Resource, Texture } from 'pixi.js';
import { AdvancedMap } from '../../../../../core/utils/AdvancedMap';
import { AlphaTolerance } from '../../../../../room/object/enum/AlphaTolerance';
import { RoomObjectSpriteType } from '../../../../../room/object/enum/RoomObjectSpriteType';
@ -982,7 +982,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements
k.name = ((_arg_3 + '_') + this._assetUpdateCounter);
}
private getPlaneBitmap(k: RoomPlane, _arg_2: string): Texture
private getPlaneBitmap(k: RoomPlane, _arg_2: string): Texture<Resource>
{
return k.bitmapData;
}

View File

@ -1,4 +1,4 @@
import { Graphics, Point, Texture } from 'pixi.js';
import { Graphics, Point, Resource, Texture } from 'pixi.js';
import { IGraphicAsset } from '../../../../../../../room/object/visualization/utils/IGraphicAsset';
import { IGraphicAssetCollection } from '../../../../../../../room/object/visualization/utils/IGraphicAssetCollection';
import { IRoomGeometry } from '../../../../../../../room/utils/IRoomGeometry';
@ -252,7 +252,7 @@ export class PlaneRasterizer implements IPlaneRasterizer
if(texture)
{
let newTexture: Texture = texture;
let newTexture: Texture<Resource> = texture;
if(asset.flipH)
{

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IVector3D } from '../../../../../../../room/utils/IVector3D';
import { PlaneTextureBitmap } from './PlaneTextureBitmap';
@ -29,12 +29,12 @@ export class PlaneTexture
}
}
public addBitmap(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null): void
public addBitmap(k: Texture<Resource>, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null): void
{
this._bitmaps.push(new PlaneTextureBitmap(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6));
}
public getBitmap(k: IVector3D): Texture
public getBitmap(k: IVector3D): Texture<Resource>
{
const _local_2 = this.getPlaneTextureBitmap(k);

View File

@ -1,18 +1,18 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
export class PlaneTextureBitmap
{
public static MIN_NORMAL_COORDINATE_VALUE: number = -1;
public static MAX_NORMAL_COORDINATE_VALUE: number = 1;
private _bitmap: Texture;
private _bitmap: Texture<Resource>;
private _normalMinX: number;
private _normalMaxX: number;
private _normalMinY: number;
private _normalMaxY: number;
private _assetName: string;
constructor(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null)
constructor(k: Texture<Resource>, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null)
{
this._normalMinX = _arg_2;
this._normalMaxX = _arg_3;
@ -22,7 +22,7 @@ export class PlaneTextureBitmap
this._bitmap = k;
}
public get bitmap(): Texture
public get bitmap(): Texture<Resource>
{
return this._bitmap;
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IAssetManager } from '../../core/asset/IAssetManager';
import { IEventDispatcher } from '../../core/events/IEventDispatcher';
import { Nitro } from '../Nitro';
@ -26,7 +26,7 @@ export class BadgeImageManager
this._assets = null;
}
public getBadgeImage(badgeName: string, type: string = 'normal_badge', load: boolean = true): Texture
public getBadgeImage(badgeName: string, type: string = 'normal_badge', load: boolean = true): Texture<Resource>
{
let badge = this.getBadgeTexture(badgeName, type);
@ -51,7 +51,7 @@ export class BadgeImageManager
return null;
}
private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture
private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture<Resource>
{
const existing = this._assets.getTexture(badgeName);
@ -79,7 +79,7 @@ export class BadgeImageManager
return null;
}
private getBadgePlaceholder(): Texture
private getBadgePlaceholder(): Texture<Resource>
{
const existing = this._assets.getTexture('loading_icon');

View File

@ -1,17 +1,17 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
export class BadgeInfo
{
private _image: Texture;
private _image: Texture<Resource>;
private _placeHolder: boolean;
constructor(image: Texture, placeHolder: boolean)
constructor(image: Texture<Resource>, placeHolder: boolean)
{
this._image = image;
this._placeHolder = placeHolder;
}
public get image(): Texture
public get image(): Texture<Resource>
{
return this._image;
}
@ -20,4 +20,4 @@ export class BadgeInfo
{
return this._placeHolder;
}
}
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { INitroManager } from '../../core/common/INitroManager';
import { INitroCommunicationManager } from '../communication/INitroCommunicationManager';
import { IFurnitureData } from './furniture/IFurnitureData';
@ -17,9 +17,9 @@ export interface ISessionDataManager extends INitroManager
getProductData(type: string): IProductData;
getBadgeUrl(name: string): string;
getGroupBadgeUrl(name: string): string;
getBadgeImage(name: string): Texture;
getBadgeImage(name: string): Texture<Resource>;
loadBadgeImage(name: string): string;
getGroupBadgeImage(name: string): Texture;
getGroupBadgeImage(name: string): Texture<Resource>;
loadGroupBadgeImage(name: string): string;
hasSecurity(level: number): boolean;
giveRespect(userId: number): void;

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { NitroManager } from '../../core/common/NitroManager';
import { IMessageComposer } from '../../core/communication/messages/IMessageComposer';
import { NitroEvent } from '../../core/events/NitroEvent';
@ -472,12 +472,12 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
return this._badgeImageManager.getBadgeUrl(name, BadgeImageManager.GROUP_BADGE);
}
public getBadgeImage(name: string): Texture
public getBadgeImage(name: string): Texture<Resource>
{
return this._badgeImageManager.getBadgeImage(name);
}
public getGroupBadgeImage(name: string): Texture
public getGroupBadgeImage(name: string): Texture<Resource>
{
return this._badgeImageManager.getBadgeImage(name, BadgeImageManager.GROUP_BADGE);
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { NitroEvent } from '../../../core/events/NitroEvent';
export class BadgeImageReadyEvent extends NitroEvent
@ -6,9 +6,9 @@ export class BadgeImageReadyEvent extends NitroEvent
public static IMAGE_READY: string = 'BIME_BADGE_IMAGE_READY';
private _badgeId: string;
private _image: Texture;
private _image: Texture<Resource>;
constructor(badgeId: string, image: Texture)
constructor(badgeId: string, image: Texture<Resource>)
{
super(BadgeImageReadyEvent.IMAGE_READY);
@ -21,8 +21,8 @@ export class BadgeImageReadyEvent extends NitroEvent
return this._badgeId;
}
public get image(): Texture
public get image(): Texture<Resource>
{
return this._image;
}
}
}

View File

@ -1,4 +1,4 @@
import { Container, Matrix, Renderer, Texture } from 'pixi.js';
import { Container, Matrix, Renderer, Resource, Texture } from 'pixi.js';
import { Constant } from './Constant';
import { RectTileLayer } from './RectTileLayer';
@ -118,9 +118,9 @@ export class CompositeRectTileLayer extends Container
return this;
}
addFrame(texture_: Texture | string | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number, alpha?: number, yaxis?: number, xaxis?: number): this
addFrame(texture_: Texture<Resource> | string | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number, alpha?: number, yaxis?: number, xaxis?: number): this
{
let texture: Texture;
let texture: Texture<Resource>;
let layer: RectTileLayer = null;
let ind = 0;
const children = this.children;

View File

@ -45,7 +45,7 @@ export class MultiTextureResource extends Resource
boundSprites: Array<Sprite> = [];
dirties: Array<number> = [];
setTexture(ind: number, texture: Texture)
setTexture(ind: number, texture: Texture<Resource>)
{
const spr = this.boundSprites[ind];
if(spr.texture.baseTexture === texture.baseTexture)

View File

@ -1,4 +1,4 @@
import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Texture } from 'pixi.js';
import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Resource, Texture } from 'pixi.js';
import { Constant } from './Constant';
import { RectTileGeom } from './RectTileShader';
import { TileRenderer } from './TileRenderer';
@ -24,7 +24,7 @@ export const POINT_STRUCT_SIZE_TWO = (Object.keys(PointStruct).length / 2);
//export const POINT_STRUCT_SIZE = 12;
export class RectTileLayer extends Container
{
constructor(zIndex: number, texture: Texture | Array<Texture>)
constructor(zIndex: number, texture: Texture<Resource> | Array<Texture>)
{
super();
this.initialize(zIndex, texture);
@ -44,7 +44,7 @@ export class RectTileLayer extends Container
offsetY = 0;
compositeParent = false;
initialize(zIndex: number, textures: Texture | Array<Texture>)
initialize(zIndex: number, textures: Texture<Resource> | Array<Texture>)
{
if(!textures)
{
@ -67,9 +67,9 @@ export class RectTileLayer extends Container
this.hasAnim = false;
}
addFrame(texture_: Texture | string | number, x: number, y: number, animX: number, animY: number)
addFrame(texture_: Texture<Resource> | string | number, x: number, y: number, animX: number, animY: number)
{
let texture: Texture;
let texture: Texture<Resource>;
let textureIndex = 0;
if(typeof texture_ === 'number')

View File

@ -1,4 +1,4 @@
import { Container, Filter, Texture } from 'pixi.js';
import { Container, Filter, Resource, Texture } from 'pixi.js';
export interface IRoomObjectSprite
{
@ -6,7 +6,7 @@ export interface IRoomObjectSprite
name: string;
type: string;
spriteType: number;
texture: Texture;
texture: Texture<Resource>;
container: Container;
width: number;
height: number;

View File

@ -1,4 +1,4 @@
import { BLEND_MODES, Container, Filter, Texture } from 'pixi.js';
import { BLEND_MODES, Container, Filter, Resource, Texture } from 'pixi.js';
import { AlphaTolerance } from '../enum/AlphaTolerance';
import { RoomObjectSpriteType } from '../enum/RoomObjectSpriteType';
import { IRoomObjectSprite } from './IRoomObjectSprite';
@ -11,7 +11,7 @@ export class RoomObjectSprite implements IRoomObjectSprite
private _name: string;
private _type: string;
private _spriteType: number;
private _texture: Texture;
private _texture: Texture<Resource>;
private _container: Container;
private _width: number;
@ -123,12 +123,12 @@ export class RoomObjectSprite implements IRoomObjectSprite
this._spriteType = type;
}
public get texture(): Texture
public get texture(): Texture<Resource>
{
return this._texture;
}
public set texture(texture: Texture)
public set texture(texture: Texture<Resource>)
{
if(this._texture === texture) return;

View File

@ -1,4 +1,4 @@
import { Rectangle, Texture } from 'pixi.js';
import { Rectangle, Resource, Texture } from 'pixi.js';
import { IGraphicAsset } from './IGraphicAsset';
export class GraphicAsset implements IGraphicAsset
@ -7,7 +7,7 @@ export class GraphicAsset implements IGraphicAsset
private _name: string;
private _source: string;
private _texture: Texture;
private _texture: Texture<Resource>;
private _usesPalette: boolean;
private _x: number;
private _y: number;
@ -18,7 +18,7 @@ export class GraphicAsset implements IGraphicAsset
private _rectangle: Rectangle;
private _initialized: boolean;
public static createAsset(name: string, source: string, texture: Texture, x: number, y: number, flipH: boolean = false, flipV: boolean = false, usesPalette: boolean = false): GraphicAsset
public static createAsset(name: string, source: string, texture: Texture<Resource>, x: number, y: number, flipH: boolean = false, flipV: boolean = false, usesPalette: boolean = false): GraphicAsset
{
const graphicAsset = (GraphicAsset.GRAPHIC_POOL.length ? GraphicAsset.GRAPHIC_POOL.pop() : new GraphicAsset());
@ -73,7 +73,7 @@ export class GraphicAsset implements IGraphicAsset
return this._source;
}
public get texture(): Texture
public get texture(): Texture<Resource>
{
return this._texture;
}
@ -137,4 +137,4 @@ export class GraphicAsset implements IGraphicAsset
return this._rectangle;
}
}
}

View File

@ -161,7 +161,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
}
}
private createAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean
private createAsset(name: string, source: string, texture: Texture<Resource>, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean
{
if(this._assets.get(name)) return false;
@ -172,7 +172,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
return true;
}
private replaceAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean
private replaceAsset(name: string, source: string, texture: Texture<Resource>, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean
{
const existing = this._assets.get(name);
@ -254,7 +254,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
return existing;
}
public addAsset(name: string, texture: Texture, override: boolean, x: number = 0, y: number = 0, flipH: boolean = false, flipV: boolean = false): boolean
public addAsset(name: string, texture: Texture<Resource>, override: boolean, x: number = 0, y: number = 0, flipH: boolean = false, flipV: boolean = false): boolean
{
if(!name || !texture) return false;
@ -301,7 +301,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection
existing.recycle();
}
public getLibraryAsset(name: string): Texture
public getLibraryAsset(name: string): Texture<Resource>
{
if(!name) return null;

View File

@ -1,4 +1,4 @@
import { Sprite, Texture } from 'pixi.js';
import { Resource, Sprite, Texture } from 'pixi.js';
import { TextureUtils } from '../../../utils';
export class GraphicAssetPalette
@ -22,7 +22,7 @@ export class GraphicAssetPalette
}
public applyPalette(texture: Texture): Texture
public applyPalette(texture: Texture<Resource>): Texture<Resource>
{
const sprite = Sprite.from(texture);
const textureCanvas = TextureUtils.generateCanvas(sprite);

View File

@ -1,10 +1,10 @@
import { Rectangle, Texture } from 'pixi.js';
import { Rectangle, Resource, Texture } from 'pixi.js';
export interface IGraphicAsset
{
name: string;
source: string;
texture: Texture;
texture: Texture<Resource>;
usesPalette: boolean;
x: number;
y: number;
@ -15,4 +15,4 @@ export interface IGraphicAsset
flipH: boolean;
flipV: boolean;
rectangle: Rectangle;
}
}

View File

@ -1,4 +1,4 @@
import { Texture } from 'pixi.js';
import { Resource, Texture } from 'pixi.js';
import { IAssetData } from '../../../../core/asset/interfaces';
import { GraphicAssetPalette } from './GraphicAssetPalette';
import { IGraphicAsset } from './IGraphicAsset';
@ -14,10 +14,10 @@ export interface IGraphicAssetCollection
getPaletteNames(): string[];
getPaletteColors(paletteName: string): number[];
getPalette(name: string): GraphicAssetPalette;
addAsset(name: string, texture: Texture, override: boolean, x?: number, y?: number, flipH?: boolean, flipV?: boolean): boolean;
addAsset(name: string, texture: Texture<Resource>, override: boolean, x?: number, y?: number, flipH?: boolean, flipV?: boolean): boolean;
disposeAsset(name: string): void;
referenceCount: number;
referenceTimestamp: number;
name: string;
data: IAssetData;
}
}

View File

@ -1,4 +1,4 @@
import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js';
import { BaseTexture, BLEND_MODES, Point, RenderTexture, Resource, Sprite, Texture } from 'pixi.js';
import { TextureUtils } from '../../utils';
export class ExtendedSprite extends Sprite
@ -13,7 +13,7 @@ export class ExtendedSprite extends Sprite
private _pairedSpriteId: number;
private _pairedSpriteUpdateCounter: number;
constructor(texture: Texture = null)
constructor(texture: Texture<Resource> = null)
{
super(texture);
@ -45,7 +45,7 @@ export class ExtendedSprite extends Sprite
super.calculateVertices();
}
public setTexture(texture: Texture): void
public setTexture(texture: Texture<Resource>): void
{
if(!texture) texture = Texture.EMPTY;

View File

@ -1,4 +1,4 @@
import { Graphics, Matrix, Texture } from 'pixi.js';
import { Graphics, Matrix, Resource, Texture } from 'pixi.js';
import { TextureUtils } from './TextureUtils';
export class Rasterizer
@ -61,7 +61,7 @@ export class Rasterizer
// k.unlock();
// }
public static getFlipHBitmapData(k: Texture): Texture
public static getFlipHBitmapData(k: Texture<Resource>): Texture<Resource>
{
if(!k) return null;
@ -83,7 +83,7 @@ export class Rasterizer
return TextureUtils.generateTexture(graphic);
}
public static getFlipVBitmapData(k: Texture): Texture
public static getFlipVBitmapData(k: Texture<Resource>): Texture<Resource>
{
if(!k) return null;
@ -105,7 +105,7 @@ export class Rasterizer
return TextureUtils.generateTexture(graphic);
}
public static getFlipHVBitmapData(k: Texture): Texture
public static getFlipHVBitmapData(k: Texture<Resource>): Texture<Resource>
{
if(!k) return null;

View File

@ -1,5 +1,5 @@
import { Extract } from '@pixi/extract';
import { AbstractRenderer, DisplayObject, Rectangle, Renderer, RenderTexture, SCALE_MODES, Texture } from 'pixi.js';
import { AbstractRenderer, DisplayObject, Rectangle, Renderer, RenderTexture, Resource, SCALE_MODES, Texture } from 'pixi.js';
import { Nitro } from '../../nitro/Nitro';
export class TextureUtils
@ -13,7 +13,7 @@ export class TextureUtils
return TextureUtils.getRenderer().generateTexture(displayObject, scaleMode, resolution, region);
}
public static generateTextureFromImage(image: HTMLImageElement): Texture
public static generateTextureFromImage(image: HTMLImageElement): Texture<Resource>
{
if(!image) return null;