You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
🆕 Added support for wf_slc_users_area and some avatar fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { Container, Texture } from 'pixi.js';
|
import { Container, Texture } from 'pixi.js';
|
||||||
import { IAvatarFigureContainer } from './IAvatarFigureContainer';
|
import { IAvatarFigureContainer } from './IAvatarFigureContainer';
|
||||||
import { IGraphicAsset } from '../../asset';
|
|
||||||
import { IAnimationLayerData, ISpriteDataContainer } from './animation';
|
import { IAnimationLayerData, ISpriteDataContainer } from './animation';
|
||||||
import { IPartColor } from './structure';
|
import { IPartColor } from './structure';
|
||||||
|
|
||||||
@@ -16,7 +15,6 @@ export interface IAvatarImage
|
|||||||
processAsTexture(setType: string, hightlight: boolean, texture?: Texture): Texture;
|
processAsTexture(setType: string, hightlight: boolean, texture?: Texture): Texture;
|
||||||
processAsImageUrl(setType: string): string;
|
processAsImageUrl(setType: string): string;
|
||||||
processAsContainer(setType: string): Container;
|
processAsContainer(setType: string): Container;
|
||||||
getAsset(name: string): IGraphicAsset;
|
|
||||||
getDirection(): number;
|
getDirection(): number;
|
||||||
getFigure(): IAvatarFigureContainer;
|
getFigure(): IAvatarFigureContainer;
|
||||||
getPartColor(_arg_1: string): IPartColor;
|
getPartColor(_arg_1: string): IPartColor;
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ export interface IRoomAreaSelectionManager
|
|||||||
activate(callback: (rootX: number, rootY: number, width: number, height: number) => void, highlightType: string): boolean;
|
activate(callback: (rootX: number, rootY: number, width: number, height: number) => void, highlightType: string): boolean;
|
||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
setHighlight(rootX: number, rootY: number, width: number, height: number): void;
|
setHighlight(rootX: number, rootY: number, width: number, height: number): void;
|
||||||
|
setHighlightType(highlightType: string): void;
|
||||||
readonly areaSelectionState: number;
|
readonly areaSelectionState: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,16 +188,6 @@ export class AvatarLogic extends MovingObjectLogic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isSleeping = (model.getValue<number>(RoomObjectVariable.FIGURE_SLEEP) > 0);
|
|
||||||
|
|
||||||
if(isSleeping)
|
|
||||||
{
|
|
||||||
model.setValue(RoomObjectVariable.FIGURE_BLINK, 0);
|
|
||||||
this._blinkingEndTimestamp = 0;
|
|
||||||
this._blinkingStartTimestamp = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if((this._blinkingStartTimestamp > -1) && (time > this._blinkingStartTimestamp))
|
if((this._blinkingStartTimestamp > -1) && (time > this._blinkingStartTimestamp))
|
||||||
{
|
{
|
||||||
model.setValue(RoomObjectVariable.FIGURE_BLINK, 1);
|
model.setValue(RoomObjectVariable.FIGURE_BLINK, 1);
|
||||||
@@ -212,7 +202,6 @@ export class AvatarLogic extends MovingObjectLogic
|
|||||||
|
|
||||||
this._blinkingEndTimestamp = 0;
|
this._blinkingEndTimestamp = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if((this._effectChangeTimeStamp > 0) && (time > this._effectChangeTimeStamp))
|
if((this._effectChangeTimeStamp > 0) && (time > this._effectChangeTimeStamp))
|
||||||
{
|
{
|
||||||
@@ -316,9 +305,6 @@ export class AvatarLogic extends MovingObjectLogic
|
|||||||
if(message instanceof ObjectAvatarSleepUpdateMessage)
|
if(message instanceof ObjectAvatarSleepUpdateMessage)
|
||||||
{
|
{
|
||||||
model.setValue(RoomObjectVariable.FIGURE_SLEEP, message.isSleeping ? 1 : 0);
|
model.setValue(RoomObjectVariable.FIGURE_SLEEP, message.isSleeping ? 1 : 0);
|
||||||
model.setValue(RoomObjectVariable.FIGURE_BLINK, 0);
|
|
||||||
|
|
||||||
this._blinkingEndTimestamp = 0;
|
|
||||||
|
|
||||||
if(message.isSleeping) this._blinkingStartTimestamp = -1;
|
if(message.isSleeping) this._blinkingStartTimestamp = -1;
|
||||||
else this._blinkingStartTimestamp = (this.time + this.randomBlinkStartTimestamp());
|
else this._blinkingStartTimestamp = (this.time + this.randomBlinkStartTimestamp());
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { AlphaTolerance, AvatarAction, AvatarGuideStatus, AvatarSetType, IAdvancedMap, IAvatarEffectListener, IAvatarImage, IAvatarImageListener, IGraphicAsset, IObjectVisualizationData, IRoomGeometry, IRoomObject, IRoomObjectModel, RoomObjectSpriteType, RoomObjectVariable } from '@nitrots/api';
|
import { AlphaTolerance, AvatarAction, AvatarGuideStatus, AvatarSetType, IAdvancedMap, IAvatarEffectListener, IAvatarImage, IAvatarImageListener, IGraphicAsset, IObjectVisualizationData, IRoomGeometry, IRoomObject, IRoomObjectModel, RoomObjectSpriteType, RoomObjectVariable } from '@nitrots/api';
|
||||||
|
import { GetAssetManager } from '@nitrots/assets';
|
||||||
import { AdvancedMap, GetRenderer } from '@nitrots/utils';
|
import { AdvancedMap, GetRenderer } from '@nitrots/utils';
|
||||||
import { Container, RenderTexture, Sprite, Texture } from 'pixi.js';
|
import { Container, RenderTexture, Sprite, Texture } from 'pixi.js';
|
||||||
import { RoomObjectSpriteVisualization } from '../RoomObjectSpriteVisualization';
|
import { RoomObjectSpriteVisualization } from '../RoomObjectSpriteVisualization';
|
||||||
@@ -428,7 +429,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
|
|
||||||
const assetName = ((((((this._avatarImage.getScale() + '_') + spriteData.member) + '_') + dd) + '_') + frameNumber);
|
const assetName = ((((((this._avatarImage.getScale() + '_') + spriteData.member) + '_') + dd) + '_') + frameNumber);
|
||||||
|
|
||||||
const asset = this._avatarImage.getAsset(assetName);
|
const asset = GetAssetManager().getAsset(assetName);
|
||||||
|
|
||||||
if(!asset) continue;
|
if(!asset) continue;
|
||||||
|
|
||||||
@@ -957,15 +958,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
|
|
||||||
if(this._talk) this._avatarImage.appendAction(AvatarAction.TALK);
|
if(this._talk) this._avatarImage.appendAction(AvatarAction.TALK);
|
||||||
|
|
||||||
if(this._sleep)
|
if(this._sleep || this._blink) this._avatarImage.appendAction(AvatarAction.SLEEP);
|
||||||
{
|
|
||||||
this._avatarImage.appendAction(AvatarAction.SLEEP);
|
|
||||||
}
|
|
||||||
else if(this._blink)
|
|
||||||
{
|
|
||||||
this._avatarImage.appendAction(AvatarAction.BLINK);
|
|
||||||
this._avatarImage.appendAction(AvatarAction.SLEEP);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this._expression > 0)
|
if(this._expression > 0)
|
||||||
{
|
{
|
||||||
@@ -1196,7 +1189,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
{
|
{
|
||||||
sprite.libraryAssetName = 'sh_std_sd_1_0_0';
|
sprite.libraryAssetName = 'sh_std_sd_1_0_0';
|
||||||
|
|
||||||
this._shadow = this._avatarImage.getAsset(sprite.libraryAssetName);
|
this._shadow = GetAssetManager().getAsset(sprite.libraryAssetName);
|
||||||
|
|
||||||
offsetX = -8;
|
offsetX = -8;
|
||||||
offsetY = ((this._canStandUp) ? 6 : -3);
|
offsetY = ((this._canStandUp) ? 6 : -3);
|
||||||
@@ -1205,7 +1198,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement
|
|||||||
{
|
{
|
||||||
sprite.libraryAssetName = 'h_std_sd_1_0_0';
|
sprite.libraryAssetName = 'h_std_sd_1_0_0';
|
||||||
|
|
||||||
this._shadow = this._avatarImage.getAsset(sprite.libraryAssetName);
|
this._shadow = GetAssetManager().getAsset(sprite.libraryAssetName);
|
||||||
|
|
||||||
offsetX = -17;
|
offsetX = -17;
|
||||||
offsetY = ((this._canStandUp) ? 10 : -7);
|
offsetY = ((this._canStandUp) ? 10 : -7);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class RoomAreaSelectionManager implements IRoomAreaSelectionManager
|
|||||||
public static HIGHLIGHT_DARKEN = 'highlight_darken';
|
public static HIGHLIGHT_DARKEN = 'highlight_darken';
|
||||||
public static HIGHLIGHT_BRIGHTEN = 'highlight_brighten';
|
public static HIGHLIGHT_BRIGHTEN = 'highlight_brighten';
|
||||||
public static HIGHLIGHT_BLUE = 'highlight_blue';
|
public static HIGHLIGHT_BLUE = 'highlight_blue';
|
||||||
|
public static HIGHLIGHT_GREEN = 'highlight_green';
|
||||||
|
|
||||||
private static HIGHLIGHT_FILTERS: { [key: string]: ColorMatrixFilter } = {};
|
private static HIGHLIGHT_FILTERS: { [key: string]: ColorMatrixFilter } = {};
|
||||||
|
|
||||||
@@ -72,9 +73,19 @@ export class RoomAreaSelectionManager implements IRoomAreaSelectionManager
|
|||||||
0, 0, 0, 1,
|
0, 0, 0, 1,
|
||||||
-0.0392, -0.0392, -0.0392, 0];
|
-0.0392, -0.0392, -0.0392, 0];
|
||||||
|
|
||||||
|
const greenFilter = new ColorMatrixFilter();
|
||||||
|
|
||||||
|
greenFilter.matrix = [
|
||||||
|
0.5, 0, 0, 0,
|
||||||
|
0, 1.6, 0, 0,
|
||||||
|
0, 0, 0.5, 0,
|
||||||
|
0, 0, 0, 1,
|
||||||
|
0, 0.15, 0, 0];
|
||||||
|
|
||||||
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_DARKEN] = darkenFilter;
|
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_DARKEN] = darkenFilter;
|
||||||
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_BRIGHTEN] = brightenFilter;
|
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_BRIGHTEN] = brightenFilter;
|
||||||
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_BLUE] = blueFilter;
|
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_BLUE] = blueFilter;
|
||||||
|
RoomAreaSelectionManager.HIGHLIGHT_FILTERS[RoomAreaSelectionManager.HIGHLIGHT_GREEN] = greenFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAllFurniture(): IRoomObject[]
|
private getAllFurniture(): IRoomObject[]
|
||||||
@@ -188,6 +199,18 @@ export class RoomAreaSelectionManager implements IRoomAreaSelectionManager
|
|||||||
if(this._callback) this._callback(0, 0, 0, 0);
|
if(this._callback) this._callback(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setHighlightType(highlightType: string): void
|
||||||
|
{
|
||||||
|
if(this._state === RoomAreaSelectionManager.NOT_ACTIVE) return;
|
||||||
|
|
||||||
|
this._highlightType = highlightType;
|
||||||
|
|
||||||
|
if(this._highlightWidth > 0 && this._highlightHeight > 0)
|
||||||
|
{
|
||||||
|
this.setHighlight(this._highlightRootX, this._highlightRootY, this._highlightWidth, this._highlightHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public setHighlight(rootX: number, rootY: number, width: number, height: number): void
|
public setHighlight(rootX: number, rootY: number, width: number, height: number): void
|
||||||
{
|
{
|
||||||
if(this._state === RoomAreaSelectionManager.NOT_ACTIVE) return;
|
if(this._state === RoomAreaSelectionManager.NOT_ACTIVE) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user