Full Renderer update -- NOT V2 !!

This commit is contained in:
duckietm 2024-03-27 15:11:21 +01:00
parent 2f59dff14f
commit ccd1370666
32 changed files with 215 additions and 2090 deletions

View File

@ -4,18 +4,13 @@
"es2021": true, "es2021": true,
"node": true "node": true
}, },
"extends": [ "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"ecmaVersion": 12, "ecmaVersion": 12,
"sourceType": "module" "sourceType": "module"
}, },
"plugins": [ "plugins": ["@typescript-eslint"],
"@typescript-eslint"
],
"rules": { "rules": {
"indent": [ "indent": [
"error", "error",
@ -24,9 +19,7 @@
"SwitchCase": 1 "SwitchCase": 1
} }
], ],
"no-multi-spaces": [ "no-multi-spaces": ["error"],
"error"
],
"no-trailing-spaces": [ "no-trailing-spaces": [
"error", "error",
{ {
@ -34,63 +27,38 @@
"ignoreComments": true "ignoreComments": true
} }
], ],
"linebreak-style": [ "linebreak-style": ["off"],
"off" "quotes": ["error", "single"],
], "semi": ["error", "always"],
"quotes": [ "brace-style": ["error", "allman"],
"error", "object-curly-spacing": ["error", "always"],
"single"
],
"semi": [
"error",
"always"
],
"brace-style": [
"error",
"allman"
],
"object-curly-spacing": [
"error",
"always"
],
"keyword-spacing": [ "keyword-spacing": [
"error", "error",
{ {
"overrides": "overrides": {
{ "if": {
"if":
{
"after": false "after": false
}, },
"for": "for": {
{
"after": false "after": false
}, },
"while": "while": {
{
"after": false "after": false
}, },
"switch": "switch": {
{
"after": false "after": false
} }
} }
} }
], ],
"@typescript-eslint/no-explicit-any": [ "@typescript-eslint/no-explicit-any": ["off"],
"off"
],
"@typescript-eslint/explicit-module-boundary-types": [ "@typescript-eslint/explicit-module-boundary-types": [
"off", "off",
{ {
"allowedNames": [ "allowedNames": ["getMessageArray"]
"getMessageArray"
]
} }
], ],
"@typescript-eslint/ban-ts-comment": [ "@typescript-eslint/ban-ts-comment": ["off"],
"off"
],
"@typescript-eslint/no-empty-function": [ "@typescript-eslint/no-empty-function": [
"error", "error",
{ {
@ -104,9 +72,7 @@
] ]
} }
], ],
"@typescript-eslint/no-unused-vars": [ "@typescript-eslint/no-unused-vars": ["off"],
"off"
],
"@typescript-eslint/no-inferrable-types": [ "@typescript-eslint/no-inferrable-types": [
"error", "error",
{ {
@ -117,8 +83,7 @@
"@typescript-eslint/ban-types": [ "@typescript-eslint/ban-types": [
"error", "error",
{ {
"types": "types": {
{
"String": true, "String": true,
"Boolean": true, "Boolean": true,
"Number": true, "Number": true,

View File

@ -1,51 +0,0 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
.git
# System Files
.DS_Store
Thumbs.db
*.zip
*.as
*.bin

View File

@ -1,25 +0,0 @@
image: node:16.3
stages:
- test
- compile
ESLinter:
stage: test
script:
- npm i
- node ./node_modules/eslint/bin/eslint.js src/
cache:
key: ${CI_COMMIT_BRANCH}
paths:
- node_modules
Compile:
stage: compile
script:
- yarn install
- yarn compile
cache:
key: ${CI_COMMIT_BRANCH}
paths:
- node_modules

View File

@ -1,32 +0,0 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.quoteStyle": "single",
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"editor.wordWrap": "on",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.sortJSON": false,
"source.organizeImports": true
},
"editor.formatOnSave": false,
"git.ignoreLimitWarning": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"emmet.showExpandedAbbreviation": "never",
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"typescript"
],
"eslint.workingDirectories": [
{
"pattern": "./src"
}
],
"javascript.format.enable": false,
"thunder-client.saveToWorkspace": false,
"thunder-client.workspaceRelativePath": "."
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View File

@ -79,21 +79,10 @@ export class AssetManager implements IAssetManager
} }
public async downloadAsset(url: string): Promise<boolean> public async downloadAsset(url: string): Promise<boolean>
{
return await this.downloadAssets([url]);
}
public async downloadAssets(urls: string[]): Promise<boolean>
{
if(!urls || !urls.length) return Promise.resolve(true);
try
{
for(const url of urls)
{ {
const response = await fetch(url); const response = await fetch(url);
if(response.status !== 200) continue; if(response.status !== 200) return false;
let contentType = 'application/octet-stream'; let contentType = 'application/octet-stream';
@ -148,8 +137,18 @@ export class AssetManager implements IAssetManager
break; break;
} }
} }
return true;
} }
public async downloadAssets(urls: string[]): Promise<boolean>
{
if(!urls || !urls.length) return Promise.resolve(true);
try
{
await Promise.all(urls.map(async (url) => await this.downloadAsset(url)));
return Promise.resolve(true); return Promise.resolve(true);
} }
catch (err) catch (err)

View File

@ -270,7 +270,7 @@ export class Nitro implements INitro
{ {
this.sendHeartBeat(); this.sendHeartBeat();
setInterval(this.sendHeartBeat, 10000); window.setInterval(this.sendHeartBeat, 10000);
} }
private sendHeartBeat(): void private sendHeartBeat(): void

View File

@ -51,20 +51,11 @@ export class AvatarAssetDownloadManager extends EventDispatcher
private loadFigureMap(): void private loadFigureMap(): void
{ {
const request = new XMLHttpRequest(); const url = NitroConfiguration.getValue<string>('avatar.figuremap.url');
fetch(url)
try .then(response => response.json())
.then(data =>
{ {
request.open('GET', NitroConfiguration.getValue<string>('avatar.figuremap.url'));
request.send();
request.onloadend = e =>
{
if(request.responseText)
{
const data = JSON.parse(request.responseText);
this.processFigureMap(data.libraries); this.processFigureMap(data.libraries);
this.processMissingLibraries(); this.processMissingLibraries();
@ -72,19 +63,8 @@ export class AvatarAssetDownloadManager extends EventDispatcher
this._isReady = true; this._isReady = true;
this.dispatchEvent(new NitroEvent(AvatarAssetDownloadManager.DOWNLOADER_READY)); this.dispatchEvent(new NitroEvent(AvatarAssetDownloadManager.DOWNLOADER_READY));
} })
}; .catch(err => NitroLogger.error(err));
request.onerror = e =>
{
throw new Error('invalid_avatar_figure_map');
};
}
catch (e)
{
NitroLogger.error(e);
}
} }
private processFigureMap(data: any): void private processFigureMap(data: any): void
@ -106,6 +86,12 @@ export class AvatarAssetDownloadManager extends EventDispatcher
downloadLibrary.addEventListener(AvatarRenderLibraryEvent.DOWNLOAD_COMPLETE, this.onLibraryLoaded); downloadLibrary.addEventListener(AvatarRenderLibraryEvent.DOWNLOAD_COMPLETE, this.onLibraryLoaded);
if(library.parts == undefined)
{
console.error('Missing parts for ' + id, library);
continue;
}
for(const part of library.parts) for(const part of library.parts)
{ {
const id = (part.id as string); const id = (part.id as string);

View File

@ -137,35 +137,20 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
if(defaultActions) this._structure.initActions(GetAssetManager(), defaultActions); if(defaultActions) this._structure.initActions(GetAssetManager(), defaultActions);
const request = new XMLHttpRequest(); const url = NitroConfiguration.getValue<string>('avatar.actions.url');
fetch(url)
try .then(response => response.json())
{ .then(data =>
request.open('GET', NitroConfiguration.getValue<string>('avatar.actions.url'));
request.send();
request.onloadend = e =>
{ {
if(!this._structure) return; if(!this._structure) return;
this._structure.updateActions(JSON.parse(request.responseText)); this._structure.updateActions(data);
this._actionsReady = true; this._actionsReady = true;
this.checkReady(); this.checkReady();
}; })
.catch(err => NitroLogger.error(err));
request.onerror = e =>
{
throw new Error('invalid_avatar_actions');
};
}
catch (e)
{
NitroLogger.error(e);
}
} }
private loadAnimations(): void private loadAnimations(): void

View File

@ -19,34 +19,14 @@ export class AvatarStructureDownload extends EventDispatcher
private download(url: string): void private download(url: string): void
{ {
const request = new XMLHttpRequest(); fetch(url)
.then(response => response.json())
try .then(data =>
{ {
request.open('GET', url); if(this._dataReceiver) this._dataReceiver.appendJSON(data);
request.send();
request.onloadend = e =>
{
const response = request.responseText;
if(!response || !response.length) throw new Error('invalid_figure_data');
if(this._dataReceiver) this._dataReceiver.appendJSON(JSON.parse(response));
this.dispatchEvent(new NitroEvent(AvatarStructureDownload.AVATAR_STRUCTURE_DONE)); this.dispatchEvent(new NitroEvent(AvatarStructureDownload.AVATAR_STRUCTURE_DONE));
}; })
.catch(err => NitroLogger.error(err));
request.onerror = e =>
{
throw new Error('invalid_avatar_figure_data');
};
}
catch (e)
{
NitroLogger.error(e);
}
} }
} }

View File

@ -131,7 +131,7 @@ export class NitroCommunicationDemo extends NitroManager implements INitroCommun
} }
private getCanvas(): any { private getCanvas(): any {
const e = document.createElement('canvas'), t = e.getContext('2d'), userAgent = navigator.userAgent, screenInfo = '${window.screen.width}x${window.screen.height}', currentDate = new Date().toString(), s = 'ThiosIsVefwsdcse02wefw83721##@@@_moreStuff! | ${userAgent} | ${screenInfo} | ${currentDate}'; const e = document.createElement('canvas'), t = e.getContext('2d'), userAgent = navigator.userAgent, screenInfo = '${window.screen.width}x${window.screen.height}', currentDate = new Date().toString(), s = 'ThiosIsVerrySeCuRe02938883721##@@@_moreStuff! | ${userAgent} | ${screenInfo} | ${currentDate}';
t.textBaseline = 'top'; t.textBaseline = 'top';
t.font = "16px 'Arial'"; t.font = "16px 'Arial'";
t.textBaseline = 'alphabetic'; t.textBaseline = 'alphabetic';

File diff suppressed because one or more lines are too long

View File

@ -401,7 +401,6 @@ export class IncomingHeader
public static POLL_CONTENTS = 2997; public static POLL_CONTENTS = 2997;
public static POLL_ERROR = 662; public static POLL_ERROR = 662;
public static POLL_OFFER = 3785; public static POLL_OFFER = 3785;
public static POLL_ROOM_RESULT = 5201;
public static POLL_START_ROOM = 5200; public static POLL_START_ROOM = 5200;
public static QUESTION_ANSWERED = 2589; public static QUESTION_ANSWERED = 2589;
public static QUESTION_FINISHED = 1066; public static QUESTION_FINISHED = 1066;

View File

@ -1,16 +0,0 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../events';
import { RoomPollResultParser } from '../../parser';
export class RoomPollResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, RoomPollResultParser);
}
public getParser(): RoomPollResultParser
{
return this.parser as RoomPollResultParser;
}
}

View File

@ -4,5 +4,4 @@ export * from './PollOfferEvent';
export * from './QuestionAnsweredEvent'; export * from './QuestionAnsweredEvent';
export * from './QuestionEvent'; export * from './QuestionEvent';
export * from './QuestionFinishedEvent'; export * from './QuestionFinishedEvent';
export * from './RoomPollResultEvent';
export * from './StartRoomPollEvent'; export * from './StartRoomPollEvent';

View File

@ -443,7 +443,6 @@ export class OutgoingHeader
public static POLL_ANSWER = 3505; public static POLL_ANSWER = 3505;
public static POLL_REJECT = 1773; public static POLL_REJECT = 1773;
public static POLL_START = 109; public static POLL_START = 109;
public static POLL_VOTE_COUNTER = 6200;
public static DISCONNECT = 2445; public static DISCONNECT = 2445;
public static SCR_GET_KICKBACK_INFO = 869; public static SCR_GET_KICKBACK_INFO = 869;
public static COMPOST_PLANT = 3835; public static COMPOST_PLANT = 3835;

View File

@ -1,21 +0,0 @@
import { IMessageComposer } from '../../../../../api';
export class VotePollCounterMessageComposer implements IMessageComposer<ConstructorParameters<typeof VotePollCounterMessageComposer>>
{
private _data: ConstructorParameters<typeof VotePollCounterMessageComposer>;
constructor(counter: number)
{
this._data = [counter];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -1,4 +1,3 @@
export * from './PollAnswerComposer'; export * from './PollAnswerComposer';
export * from './PollRejectComposer'; export * from './PollRejectComposer';
export * from './PollStartComposer'; export * from './PollStartComposer';
export * from './VotePollCounterMessageComposer';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class FurniturePickupAllComposer implements IMessageComposer<ConstructorParameters<typeof FurniturePickupAllComposer>>
{
private _data: ConstructorParameters<typeof FurniturePickupAllComposer>;
constructor(...objectId: number[])
{
this._data = [objectId.length, ...objectId];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -5,6 +5,7 @@ export * from './ExtendRentOrBuyoutStripItemMessageComposer';
export * from './floor'; export * from './floor';
export * from './FurnitureAliasesComposer'; export * from './FurnitureAliasesComposer';
export * from './FurnitureGroupInfoComposer'; export * from './FurnitureGroupInfoComposer';
export * from './FurniturePickupAllComposer';
export * from './FurniturePickupComposer'; export * from './FurniturePickupComposer';
export * from './FurniturePlaceComposer'; export * from './FurniturePlaceComposer';
export * from './FurniturePlacePaintComposer'; export * from './FurniturePlacePaintComposer';

View File

@ -1,59 +0,0 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class RoomPollResultParser implements IMessageParser
{
private _question: string;
private _choices: string[];
private _SafeStr_7651: any[];
private _SafeStr_7654: number;
flush(): boolean
{
this._question = null;
this._choices = [];
this._SafeStr_7651 = [];
this._SafeStr_7654 = -1;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._question = wrapper.readString();
this._choices = [];
this._SafeStr_7651 = [];
let totalChoices = wrapper.readInt();
while(totalChoices > 0)
{
this._choices.push(wrapper.readString());
this._SafeStr_7651.push(wrapper.readInt());
totalChoices--;
}
this._SafeStr_7654 = wrapper.readInt();
return true;
}
public get question(): string
{
return this._question;
}
public get choices(): string[]
{
return this._choices;
}
public get SafeStr_7651(): any[]
{
return this._SafeStr_7651;
}
public get SafeStr_7654(): number
{
return this._SafeStr_7654;
}
}

View File

@ -6,5 +6,4 @@ export * from './PollQuestion';
export * from './QuestionAnsweredParser'; export * from './QuestionAnsweredParser';
export * from './QuestionFinishedParser'; export * from './QuestionFinishedParser';
export * from './QuestionParser'; export * from './QuestionParser';
export * from './RoomPollResultParser';
export * from './RoomPollDataParser'; export * from './RoomPollDataParser';

View File

@ -6,7 +6,7 @@ import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureStickieLogic extends FurnitureLogic export class FurnitureStickieLogic extends FurnitureLogic
{ {
private static STICKIE_COLORS: string[] = ['9CCEFF', 'FF9CFF', '9CFF9C', 'FFFF33']; private static STICKIE_COLORS: string[] = [ '9CCEFF', 'FF9CFF', '9CFF9C', 'FFFF33', 'FF9C9D', 'FFCD9C', 'C3B1E1', 'DBDEFB', 'FFFFFF', '282828' ];
public getEventTypes(): string[] public getEventTypes(): string[]
{ {

View File

@ -14,41 +14,34 @@ export class FurnitureDynamicThumbnailVisualization extends IsometricImageFurniV
this._hasOutline = true; this._hasOutline = true;
} }
protected updateModel(scale: number): boolean protected updateModel(scale: number): boolean {
{ if (this.object) {
if(this.object)
{
const thumbnailUrl = this.getThumbnailURL(); const thumbnailUrl = this.getThumbnailURL();
if(this._cachedUrl !== thumbnailUrl) if (this._cachedUrl !== thumbnailUrl) {
{
this._cachedUrl = thumbnailUrl; this._cachedUrl = thumbnailUrl;
if(this._cachedUrl && (this._cachedUrl !== '')) if (this._cachedUrl && this._cachedUrl !== '') {
{
const image = new Image(); const image = new Image();
image.src = thumbnailUrl; image.src = thumbnailUrl;
image.crossOrigin = '*'; image.crossOrigin = '*';
image.onload = () => image.onload = () => {
{
const texture = Texture.from(image); const texture = Texture.from(image);
texture.baseTexture.scaleMode = SCALE_MODES.LINEAR; texture.baseTexture.scaleMode = SCALE_MODES.LINEAR;
this.setThumbnailImages(texture); this.setThumbnailImages(texture);
}; };
} } else {
else
{
this.setThumbnailImages(null); this.setThumbnailImages(null);
} }
} }
} }
return super.updateModel(scale); return super.updateModel(scale);
} }
protected getThumbnailURL(): string protected getThumbnailURL(): string
{ {

View File

@ -30,9 +30,9 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
return !(this._thumbnailImageNormal == null); return !(this._thumbnailImageNormal == null);
} }
public setThumbnailImages(k: Texture<Resource>): void public setThumbnailImages(texture: Texture<Resource>): void
{ {
this._thumbnailImageNormal = k; this._thumbnailImageNormal = texture;
this._thumbnailChanged = true; this._thumbnailChanged = true;
} }
@ -64,7 +64,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
this._thumbnailDirection = this.direction; this._thumbnailDirection = this.direction;
} }
private addThumbnailAsset(k: Texture<Resource>, scale: number): void private addThumbnailAsset(texture: Texture<Resource>, scale: number): void
{ {
let layerId = 0; let layerId = 0;
@ -77,7 +77,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
if(asset) if(asset)
{ {
const _local_6 = this.generateTransformedThumbnail(k, asset); const _local_6 = this.generateTransformedThumbnail(texture, asset);
const _local_7 = this.getThumbnailAssetName(scale); const _local_7 = this.getThumbnailAssetName(scale);
this.asset.disposeAsset(_local_7); this.asset.disposeAsset(_local_7);
@ -113,36 +113,24 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
texture = TextureUtils.generateTexture(container); texture = TextureUtils.generateTexture(container);
} }
const scale = 1.1; texture.orig.width = asset.width;
texture.orig.height = asset.height;
const matrix = new Matrix(); const matrix = new Matrix();
const difference = (asset.width / texture.width);
switch(this.direction) switch(this.direction)
{ {
case 2: case 2:
matrix.a = difference; matrix.b = -(0.5);
matrix.b = (-0.5 * difference); matrix.d /= 1.6;
matrix.c = 0; matrix.ty = ((0.5) * texture.width);
matrix.d = (difference * scale);
matrix.tx = 0;
matrix.ty = ((0.5 * difference) * texture.width);
break; break;
case 0: case 0:
case 4: case 4:
matrix.a = difference; matrix.b = (0.5);
matrix.b = (0.5 * difference); matrix.d /= 1.6;
matrix.c = 0; matrix.tx = -0.5;
matrix.d = (difference * scale);
matrix.tx = 0;
matrix.ty = 0;
break; break;
default:
matrix.a = difference;
matrix.b = 0;
matrix.c = 0;
matrix.d = difference;
matrix.tx = 0;
matrix.ty = 0;
} }
const sprite = new NitroSprite(texture); const sprite = new NitroSprite(texture);

View File

@ -261,7 +261,6 @@ export class RoomPlane implements IRoomPlane
this._bitmapMasks = null; this._bitmapMasks = null;
this._rectangleMasks = null; this._rectangleMasks = null;
this._maskPixels = null; this._maskPixels = null;
this._disposed = true; this._disposed = true;
} }

View File

@ -1,6 +1,6 @@
import { IConnection, IRoomHandlerListener } from '../../../api'; import { IConnection, IRoomHandlerListener } from '../../../api';
import { RoomSessionPollEvent, RoomSessionVoteEvent } from '../../../events'; import { RoomSessionPollEvent, RoomSessionVoteEvent } from '../../../events';
import { PollContentsEvent, PollErrorEvent, PollOfferEvent, StartRoomPollEvent, RoomPollResultEvent } from '../../communication'; import { PollContentsEvent, PollErrorEvent, PollOfferEvent, StartRoomPollEvent } from '../../communication';
import { BaseHandler } from './BaseHandler'; import { BaseHandler } from './BaseHandler';
export class PollHandler extends BaseHandler export class PollHandler extends BaseHandler
@ -13,7 +13,6 @@ export class PollHandler extends BaseHandler
connection.addMessageEvent(new PollOfferEvent(this.onPollOfferEvent.bind(this))); connection.addMessageEvent(new PollOfferEvent(this.onPollOfferEvent.bind(this)));
connection.addMessageEvent(new PollErrorEvent(this.onPollErrorEvent.bind(this))); connection.addMessageEvent(new PollErrorEvent(this.onPollErrorEvent.bind(this)));
connection.addMessageEvent(new StartRoomPollEvent(this.onStartRoomPollEvent.bind(this))); connection.addMessageEvent(new StartRoomPollEvent(this.onStartRoomPollEvent.bind(this)));
connection.addMessageEvent(new RoomPollResultEvent(this.onRoomPollResultEvent.bind(this)));
} }
private onPollContentsEvent(event: PollContentsEvent): void private onPollContentsEvent(event: PollContentsEvent): void
@ -94,21 +93,4 @@ export class PollHandler extends BaseHandler
this.listener.events.dispatchEvent(pollEvent); this.listener.events.dispatchEvent(pollEvent);
} }
private onRoomPollResultEvent(event: RoomPollResultEvent): void
{
if(!this.listener) return;
const session = this.listener.getSession(this.roomId);
if(!session) return;
const parser = event.getParser();
if(!parser) return;
const pollEvent = new RoomSessionVoteEvent(RoomSessionVoteEvent.VOTE_RESULT, session, parser.question, parser.choices, parser.SafeStr_7651, parser.SafeStr_7654);
this.listener.events.dispatchEvent(pollEvent);
}
} }

View File

@ -1,4 +1,4 @@
export class FigureDataContainer export class FigureDataContainer
{ {
private static MALE: string = 'M'; private static MALE: string = 'M';
private static FEMALE: string = 'F'; private static FEMALE: string = 'F';
@ -10,11 +10,14 @@
private static HAIR: string = 'hr'; private static HAIR: string = 'hr';
private static HAT: string = 'ha'; private static HAT: string = 'ha';
private static HEAD_ACCESSORIES: string = 'he'; private static HEAD_ACCESSORIES: string = 'he';
private static EARRINGS: string = 'er';
private static EYE_ACCESSORIES: string = 'ea'; private static EYE_ACCESSORIES: string = 'ea';
private static FACE_ACCESSORIES: string = 'fa'; private static FACE_ACCESSORIES: string = 'fa';
private static JACKET: string = 'cc'; private static JACKET: string = 'cc';
private static SHIRT: string = 'ch'; private static SHIRT: string = 'ch';
private static CHEST_ACCESSORIES: string = 'ca'; private static CHEST_ACCESSORIES: string = 'ca';
private static PURSES: string = 'pu';
private static BACKPACKS: string = 'bp';
private static CHEST_PRINTS: string = 'cp'; private static CHEST_PRINTS: string = 'cp';
private static TROUSERS: string = 'lg'; private static TROUSERS: string = 'lg';
private static SHOES: string = 'sh'; private static SHOES: string = 'sh';
@ -27,13 +30,13 @@
private _isDisposed: boolean; private _isDisposed: boolean;
private _avatarEffectType: number = -1; private _avatarEffectType: number = -1;
public loadAvatarData(figure: string, gender: string): void public loadAvatarData(k: string, _arg_2: string): void
{ {
this._data = new Map(); this._data = new Map();
this._colors = new Map(); this._colors = new Map();
this._gender = gender; this._gender = _arg_2;
this.parseFigureString(figure); this.parseFigureString(k);
} }
public dispose(): void public dispose(): void
@ -104,7 +107,7 @@
const sets: string[] = []; const sets: string[] = [];
for(const [key, value] of this._data.entries()) for(const [ key, value ] of this._data.entries())
{ {
let set = ((key + '-') + value); let set = ((key + '-') + value);
@ -143,11 +146,14 @@
case FigureDataContainer.HAIR: case FigureDataContainer.HAIR:
case FigureDataContainer.HAT: case FigureDataContainer.HAT:
case FigureDataContainer.HEAD_ACCESSORIES: case FigureDataContainer.HEAD_ACCESSORIES:
case FigureDataContainer.EARRINGS:
case FigureDataContainer.EYE_ACCESSORIES: case FigureDataContainer.EYE_ACCESSORIES:
case FigureDataContainer.FACE_ACCESSORIES: case FigureDataContainer.FACE_ACCESSORIES:
case FigureDataContainer.SHIRT: case FigureDataContainer.SHIRT:
case FigureDataContainer.JACKET: case FigureDataContainer.JACKET:
case FigureDataContainer.CHEST_ACCESSORIES: case FigureDataContainer.CHEST_ACCESSORIES:
case FigureDataContainer.PURSES:
case FigureDataContainer.BACKPACKS:
case FigureDataContainer.CHEST_PRINTS: case FigureDataContainer.CHEST_PRINTS:
case FigureDataContainer.TROUSERS: case FigureDataContainer.TROUSERS:
case FigureDataContainer.SHOES: case FigureDataContainer.SHOES:
@ -171,11 +177,14 @@
case FigureDataContainer.HAIR: case FigureDataContainer.HAIR:
case FigureDataContainer.HAT: case FigureDataContainer.HAT:
case FigureDataContainer.HEAD_ACCESSORIES: case FigureDataContainer.HEAD_ACCESSORIES:
case FigureDataContainer.EARRINGS:
case FigureDataContainer.EYE_ACCESSORIES: case FigureDataContainer.EYE_ACCESSORIES:
case FigureDataContainer.FACE_ACCESSORIES: case FigureDataContainer.FACE_ACCESSORIES:
case FigureDataContainer.SHIRT: case FigureDataContainer.SHIRT:
case FigureDataContainer.JACKET: case FigureDataContainer.JACKET:
case FigureDataContainer.CHEST_ACCESSORIES: case FigureDataContainer.CHEST_ACCESSORIES:
case FigureDataContainer.PURSES:
case FigureDataContainer.BACKPACKS:
case FigureDataContainer.CHEST_PRINTS: case FigureDataContainer.CHEST_PRINTS:
case FigureDataContainer.TROUSERS: case FigureDataContainer.TROUSERS:
case FigureDataContainer.SHOES: case FigureDataContainer.SHOES:
@ -187,7 +196,7 @@
public getFigureStringWithFace(k: number): string public getFigureStringWithFace(k: number): string
{ {
const partSets: string[] = [FigureDataContainer.HD]; const partSets: string[] = [ FigureDataContainer.HD ];
let figure = ''; let figure = '';
const sets: string[] = []; const sets: string[] = [];

View File

@ -6,7 +6,7 @@ export class Motions
private static _QUEUED_MOTIONS: Motion[] = []; private static _QUEUED_MOTIONS: Motion[] = [];
private static _RUNNING_MOTIONS: Motion[] = []; private static _RUNNING_MOTIONS: Motion[] = [];
private static _REMOVED_MOTIONS: Motion[] = []; private static _REMOVED_MOTIONS: Motion[] = [];
private static _TIMER: ReturnType<typeof setInterval> = null; private static _TIMER: number = null;
private static _IS_UPDATING: boolean = false; private static _IS_UPDATING: boolean = false;
public static get TIMER_TIME(): number public static get TIMER_TIME(): number
@ -164,7 +164,7 @@ export class Motions
{ {
if(!Motions._TIMER) if(!Motions._TIMER)
{ {
Motions._TIMER = setInterval(Motions.onTick, Motions.TIMER_TIME); Motions._TIMER = window.setInterval(Motions.onTick, Motions.TIMER_TIME);
} }
} }

View File

@ -17,19 +17,11 @@
"skipLibCheck": true, "skipLibCheck": true,
"noEmit": true, "noEmit": true,
"target": "ES6", "target": "ES6",
"lib": [ "lib": ["DOM", "DOM.Iterable", "ESNext"],
"DOM",
"DOM.Iterable",
"ESNext"
],
"module": "ES6", "module": "ES6",
"paths": { "paths": {
"mini-signals": [ "mini-signals": ["node_modules/mini-signals/index.js"]
"node_modules/mini-signals/index.js" }
]
}, },
}, "include": ["src"]
"include": [
"src"
]
} }

View File

@ -2,7 +2,7 @@
import typescript from '@rollup/plugin-typescript'; import typescript from '@rollup/plugin-typescript';
import { resolve } from 'path'; import { resolve } from 'path';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { ViteMinifyPlugin } from 'vite-plugin-minify';
const resolvePath = str => resolve(__dirname, str); const resolvePath = str => resolve(__dirname, str);
@ -14,8 +14,8 @@ export default defineConfig({
'declaration': true, 'declaration': true,
exclude: resolvePath('./node_modules/**'), exclude: resolvePath('./node_modules/**'),
allowSyntheticDefaultImports: true allowSyntheticDefaultImports: true
}), })
ViteMinifyPlugin()
], ],
build: { build: {
lib: { lib: {

File diff suppressed because it is too large Load Diff