mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 14:36:26 +01:00
Updates
This commit is contained in:
parent
9a403d72db
commit
8d7fc1e9b4
@ -4,7 +4,7 @@ import { IRoomCameraWidgetSelectedEffect } from './IRoomCameraWidgetSelectedEffe
|
||||
|
||||
export interface IRoomCameraWidgetManager
|
||||
{
|
||||
init(): void;
|
||||
init(): Promise<void>;
|
||||
applyEffects(texture: Texture, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): Promise<HTMLImageElement>;
|
||||
effects: Map<string, IRoomCameraWidgetEffect>;
|
||||
isLoaded: boolean;
|
||||
|
@ -295,16 +295,6 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
||||
//@ts-ignore
|
||||
this._activeTexture.source.hitMap = null;
|
||||
|
||||
/*
|
||||
if(this._avatarSpriteData)
|
||||
{
|
||||
if(this._avatarSpriteData.paletteIsGrayscale)
|
||||
{
|
||||
this._reusableTexture = this.applyPalette(this._reusableTexture, this._avatarSpriteData.reds, [], []);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
this._changes = false;
|
||||
|
||||
return this._activeTexture;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { IRoomCameraWidgetEffect, IRoomCameraWidgetManager, IRoomCameraWidgetSelectedEffect } from '@nitrots/api';
|
||||
import { GetAssetManager } from '@nitrots/assets';
|
||||
import { GetConfiguration } from '@nitrots/configuration';
|
||||
import { GetEventDispatcher, RoomCameraWidgetManagerEvent } from '@nitrots/events';
|
||||
import { TextureUtils } from '@nitrots/utils';
|
||||
@ -16,7 +17,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager
|
||||
this._isLoaded = false;
|
||||
}
|
||||
|
||||
public init(): void
|
||||
public async init(): Promise<void>
|
||||
{
|
||||
if(this._isLoaded) return;
|
||||
|
||||
@ -37,7 +38,11 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager
|
||||
}
|
||||
else
|
||||
{
|
||||
cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png');
|
||||
const url = `${ imagesUrl }${ effect.name }.png`;
|
||||
|
||||
await GetAssetManager().downloadAsset(url);
|
||||
|
||||
cameraEffect.texture = GetAssetManager().getTexture(url);
|
||||
cameraEffect.blendMode = effect.blendMode;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { AlphaTolerance, IRoomObjectSprite } from '@nitrots/api';
|
||||
import { TextureUtils } from '@nitrots/utils';
|
||||
import { GetTexturePool } from '@nitrots/utils';
|
||||
import { Texture } from 'pixi.js';
|
||||
import { IAvatarAddition } from './IAvatarAddition';
|
||||
|
||||
@ -18,15 +18,19 @@ export class GameClickTargetAddition implements IAvatarAddition
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
this._asset = null;
|
||||
if(this._asset)
|
||||
{
|
||||
GetTexturePool().putTexture(this._asset);
|
||||
|
||||
this._asset = null;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: needs testing
|
||||
public update(sprite: IRoomObjectSprite, scale: number): void
|
||||
{
|
||||
if(!sprite) return;
|
||||
|
||||
if(!this._asset) this._asset = TextureUtils.createRenderTexture(GameClickTargetAddition.WIDTH, GameClickTargetAddition.HEIGHT);
|
||||
if(!this._asset) this._asset = GetTexturePool().getTexture(GameClickTargetAddition.WIDTH, GameClickTargetAddition.HEIGHT);
|
||||
|
||||
sprite.visible = true;
|
||||
sprite.texture = this._asset;
|
||||
|
Loading…
Reference in New Issue
Block a user