mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 14:26:58 +00:00
Full Renderer update -- NOT V2 !!
This commit is contained in:
parent
2f59dff14f
commit
ccd1370666
@ -4,18 +4,13 @@
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
@ -24,73 +19,46 @@
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"no-multi-spaces": [
|
||||
"error"
|
||||
],
|
||||
"no-multi-spaces": ["error"],
|
||||
"no-trailing-spaces": [
|
||||
"error",
|
||||
"error",
|
||||
{
|
||||
"skipBlankLines": false,
|
||||
"ignoreComments": true
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"off"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"brace-style": [
|
||||
"error",
|
||||
"allman"
|
||||
],
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"linebreak-style": ["off"],
|
||||
"quotes": ["error", "single"],
|
||||
"semi": ["error", "always"],
|
||||
"brace-style": ["error", "allman"],
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"keyword-spacing": [
|
||||
"error",
|
||||
{
|
||||
"overrides":
|
||||
{
|
||||
"if":
|
||||
{
|
||||
"overrides": {
|
||||
"if": {
|
||||
"after": false
|
||||
},
|
||||
"for":
|
||||
{
|
||||
"for": {
|
||||
"after": false
|
||||
},
|
||||
"while":
|
||||
{
|
||||
"while": {
|
||||
"after": false
|
||||
},
|
||||
"switch":
|
||||
{
|
||||
"switch": {
|
||||
"after": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": ["off"],
|
||||
"@typescript-eslint/explicit-module-boundary-types": [
|
||||
"off",
|
||||
{
|
||||
"allowedNames": [
|
||||
"getMessageArray"
|
||||
]
|
||||
"allowedNames": ["getMessageArray"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/ban-ts-comment": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/ban-ts-comment": ["off"],
|
||||
"@typescript-eslint/no-empty-function": [
|
||||
"error",
|
||||
{
|
||||
@ -104,9 +72,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": ["off"],
|
||||
"@typescript-eslint/no-inferrable-types": [
|
||||
"error",
|
||||
{
|
||||
@ -117,8 +83,7 @@
|
||||
"@typescript-eslint/ban-types": [
|
||||
"error",
|
||||
{
|
||||
"types":
|
||||
{
|
||||
"types": {
|
||||
"String": true,
|
||||
"Boolean": true,
|
||||
"Number": true,
|
||||
|
51
submodules/renderer/.gitignore
vendored
51
submodules/renderer/.gitignore
vendored
@ -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
|
@ -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
|
32
submodules/renderer/.vscode/settings.json
vendored
32
submodules/renderer/.vscode/settings.json
vendored
@ -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": "."
|
||||
}
|
BIN
submodules/renderer/photo_icon.png
Normal file
BIN
submodules/renderer/photo_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 241 B |
@ -80,7 +80,65 @@ export class AssetManager implements IAssetManager
|
||||
|
||||
public async downloadAsset(url: string): Promise<boolean>
|
||||
{
|
||||
return await this.downloadAssets([url]);
|
||||
const response = await fetch(url);
|
||||
|
||||
if(response.status !== 200) return false;
|
||||
|
||||
let contentType = 'application/octet-stream';
|
||||
|
||||
if(response.headers.has('Content-Type'))
|
||||
{
|
||||
contentType = response.headers.get('Content-Type');
|
||||
}
|
||||
|
||||
switch(contentType)
|
||||
{
|
||||
case 'application/octet-stream': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const nitroBundle = new NitroBundle(buffer);
|
||||
|
||||
await this.processAsset(
|
||||
nitroBundle.baseTexture,
|
||||
nitroBundle.jsonFile as IAssetData
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 'image/png':
|
||||
case 'image/jpeg':
|
||||
case 'image/gif': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const base64 = ArrayBufferToBase64(buffer);
|
||||
const baseTexture = BaseTexture.from(
|
||||
`data:${ contentType };base64,${ base64 }`
|
||||
);
|
||||
|
||||
const createAsset = async () =>
|
||||
{
|
||||
const texture = new Texture(baseTexture);
|
||||
this.setTexture(url, texture);
|
||||
};
|
||||
|
||||
if(baseTexture.valid)
|
||||
{
|
||||
await createAsset();
|
||||
}
|
||||
else
|
||||
{
|
||||
await new Promise<void>((resolve, reject) =>
|
||||
{
|
||||
baseTexture.once('update', async () =>
|
||||
{
|
||||
await createAsset();
|
||||
|
||||
return resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public async downloadAssets(urls: string[]): Promise<boolean>
|
||||
@ -89,66 +147,7 @@ export class AssetManager implements IAssetManager
|
||||
|
||||
try
|
||||
{
|
||||
for(const url of urls)
|
||||
{
|
||||
const response = await fetch(url);
|
||||
|
||||
if(response.status !== 200) continue;
|
||||
|
||||
let contentType = 'application/octet-stream';
|
||||
|
||||
if(response.headers.has('Content-Type'))
|
||||
{
|
||||
contentType = response.headers.get('Content-Type');
|
||||
}
|
||||
|
||||
switch(contentType)
|
||||
{
|
||||
case 'application/octet-stream': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const nitroBundle = new NitroBundle(buffer);
|
||||
|
||||
await this.processAsset(
|
||||
nitroBundle.baseTexture,
|
||||
nitroBundle.jsonFile as IAssetData
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 'image/png':
|
||||
case 'image/jpeg':
|
||||
case 'image/gif': {
|
||||
const buffer = await response.arrayBuffer();
|
||||
const base64 = ArrayBufferToBase64(buffer);
|
||||
const baseTexture = BaseTexture.from(
|
||||
`data:${ contentType };base64,${ base64 }`
|
||||
);
|
||||
|
||||
const createAsset = async () =>
|
||||
{
|
||||
const texture = new Texture(baseTexture);
|
||||
this.setTexture(url, texture);
|
||||
};
|
||||
|
||||
if(baseTexture.valid)
|
||||
{
|
||||
await createAsset();
|
||||
}
|
||||
else
|
||||
{
|
||||
await new Promise<void>((resolve, reject) =>
|
||||
{
|
||||
baseTexture.once('update', async () =>
|
||||
{
|
||||
await createAsset();
|
||||
|
||||
return resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
await Promise.all(urls.map(async (url) => await this.downloadAsset(url)));
|
||||
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ export class Nitro implements INitro
|
||||
{
|
||||
this.sendHeartBeat();
|
||||
|
||||
setInterval(this.sendHeartBeat, 10000);
|
||||
window.setInterval(this.sendHeartBeat, 10000);
|
||||
}
|
||||
|
||||
private sendHeartBeat(): void
|
||||
|
@ -51,40 +51,20 @@ export class AvatarAssetDownloadManager extends EventDispatcher
|
||||
|
||||
private loadFigureMap(): void
|
||||
{
|
||||
const request = new XMLHttpRequest();
|
||||
|
||||
try
|
||||
{
|
||||
request.open('GET', NitroConfiguration.getValue<string>('avatar.figuremap.url'));
|
||||
|
||||
request.send();
|
||||
|
||||
request.onloadend = e =>
|
||||
const url = NitroConfiguration.getValue<string>('avatar.figuremap.url');
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data =>
|
||||
{
|
||||
if(request.responseText)
|
||||
{
|
||||
const data = JSON.parse(request.responseText);
|
||||
this.processFigureMap(data.libraries);
|
||||
|
||||
this.processFigureMap(data.libraries);
|
||||
this.processMissingLibraries();
|
||||
|
||||
this.processMissingLibraries();
|
||||
this._isReady = true;
|
||||
|
||||
this._isReady = true;
|
||||
|
||||
this.dispatchEvent(new NitroEvent(AvatarAssetDownloadManager.DOWNLOADER_READY));
|
||||
}
|
||||
};
|
||||
|
||||
request.onerror = e =>
|
||||
{
|
||||
throw new Error('invalid_avatar_figure_map');
|
||||
};
|
||||
}
|
||||
|
||||
catch (e)
|
||||
{
|
||||
NitroLogger.error(e);
|
||||
}
|
||||
this.dispatchEvent(new NitroEvent(AvatarAssetDownloadManager.DOWNLOADER_READY));
|
||||
})
|
||||
.catch(err => NitroLogger.error(err));
|
||||
}
|
||||
|
||||
private processFigureMap(data: any): void
|
||||
@ -106,6 +86,12 @@ export class AvatarAssetDownloadManager extends EventDispatcher
|
||||
|
||||
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)
|
||||
{
|
||||
const id = (part.id as string);
|
||||
|
@ -137,35 +137,20 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
|
||||
|
||||
if(defaultActions) this._structure.initActions(GetAssetManager(), defaultActions);
|
||||
|
||||
const request = new XMLHttpRequest();
|
||||
|
||||
try
|
||||
{
|
||||
request.open('GET', NitroConfiguration.getValue<string>('avatar.actions.url'));
|
||||
|
||||
request.send();
|
||||
|
||||
request.onloadend = e =>
|
||||
const url = NitroConfiguration.getValue<string>('avatar.actions.url');
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data =>
|
||||
{
|
||||
if(!this._structure) return;
|
||||
|
||||
this._structure.updateActions(JSON.parse(request.responseText));
|
||||
this._structure.updateActions(data);
|
||||
|
||||
this._actionsReady = true;
|
||||
|
||||
this.checkReady();
|
||||
};
|
||||
|
||||
request.onerror = e =>
|
||||
{
|
||||
throw new Error('invalid_avatar_actions');
|
||||
};
|
||||
}
|
||||
|
||||
catch (e)
|
||||
{
|
||||
NitroLogger.error(e);
|
||||
}
|
||||
})
|
||||
.catch(err => NitroLogger.error(err));
|
||||
}
|
||||
|
||||
private loadAnimations(): void
|
||||
|
@ -19,34 +19,14 @@ export class AvatarStructureDownload extends EventDispatcher
|
||||
|
||||
private download(url: string): void
|
||||
{
|
||||
const request = new XMLHttpRequest();
|
||||
|
||||
try
|
||||
{
|
||||
request.open('GET', url);
|
||||
|
||||
request.send();
|
||||
|
||||
request.onloadend = e =>
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data =>
|
||||
{
|
||||
const response = request.responseText;
|
||||
|
||||
if(!response || !response.length) throw new Error('invalid_figure_data');
|
||||
|
||||
if(this._dataReceiver) this._dataReceiver.appendJSON(JSON.parse(response));
|
||||
if(this._dataReceiver) this._dataReceiver.appendJSON(data);
|
||||
|
||||
this.dispatchEvent(new NitroEvent(AvatarStructureDownload.AVATAR_STRUCTURE_DONE));
|
||||
};
|
||||
|
||||
request.onerror = e =>
|
||||
{
|
||||
throw new Error('invalid_avatar_figure_data');
|
||||
};
|
||||
}
|
||||
|
||||
catch (e)
|
||||
{
|
||||
NitroLogger.error(e);
|
||||
}
|
||||
})
|
||||
.catch(err => NitroLogger.error(err));
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ export class NitroCommunicationDemo extends NitroManager implements INitroCommun
|
||||
}
|
||||
|
||||
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.font = "16px 'Arial'";
|
||||
t.textBaseline = 'alphabetic';
|
||||
|
File diff suppressed because one or more lines are too long
@ -401,7 +401,6 @@ export class IncomingHeader
|
||||
public static POLL_CONTENTS = 2997;
|
||||
public static POLL_ERROR = 662;
|
||||
public static POLL_OFFER = 3785;
|
||||
public static POLL_ROOM_RESULT = 5201;
|
||||
public static POLL_START_ROOM = 5200;
|
||||
public static QUESTION_ANSWERED = 2589;
|
||||
public static QUESTION_FINISHED = 1066;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -4,5 +4,4 @@ export * from './PollOfferEvent';
|
||||
export * from './QuestionAnsweredEvent';
|
||||
export * from './QuestionEvent';
|
||||
export * from './QuestionFinishedEvent';
|
||||
export * from './RoomPollResultEvent';
|
||||
export * from './StartRoomPollEvent';
|
||||
|
@ -443,7 +443,6 @@ export class OutgoingHeader
|
||||
public static POLL_ANSWER = 3505;
|
||||
public static POLL_REJECT = 1773;
|
||||
public static POLL_START = 109;
|
||||
public static POLL_VOTE_COUNTER = 6200;
|
||||
public static DISCONNECT = 2445;
|
||||
public static SCR_GET_KICKBACK_INFO = 869;
|
||||
public static COMPOST_PLANT = 3835;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
export * from './PollAnswerComposer';
|
||||
export * from './PollRejectComposer';
|
||||
export * from './PollStartComposer';
|
||||
export * from './VotePollCounterMessageComposer';
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ export * from './ExtendRentOrBuyoutStripItemMessageComposer';
|
||||
export * from './floor';
|
||||
export * from './FurnitureAliasesComposer';
|
||||
export * from './FurnitureGroupInfoComposer';
|
||||
export * from './FurniturePickupAllComposer';
|
||||
export * from './FurniturePickupComposer';
|
||||
export * from './FurniturePlaceComposer';
|
||||
export * from './FurniturePlacePaintComposer';
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -6,5 +6,4 @@ export * from './PollQuestion';
|
||||
export * from './QuestionAnsweredParser';
|
||||
export * from './QuestionFinishedParser';
|
||||
export * from './QuestionParser';
|
||||
export * from './RoomPollResultParser';
|
||||
export * from './RoomPollDataParser';
|
||||
|
@ -6,7 +6,7 @@ import { FurnitureLogic } from './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[]
|
||||
{
|
||||
|
@ -14,42 +14,35 @@ export class FurnitureDynamicThumbnailVisualization extends IsometricImageFurniV
|
||||
this._hasOutline = true;
|
||||
}
|
||||
|
||||
protected updateModel(scale: number): boolean
|
||||
{
|
||||
if(this.object)
|
||||
{
|
||||
const thumbnailUrl = this.getThumbnailURL();
|
||||
protected updateModel(scale: number): boolean {
|
||||
if (this.object) {
|
||||
const thumbnailUrl = this.getThumbnailURL();
|
||||
|
||||
if(this._cachedUrl !== thumbnailUrl)
|
||||
{
|
||||
this._cachedUrl = thumbnailUrl;
|
||||
if (this._cachedUrl !== thumbnailUrl) {
|
||||
this._cachedUrl = thumbnailUrl;
|
||||
|
||||
if(this._cachedUrl && (this._cachedUrl !== ''))
|
||||
{
|
||||
const image = new Image();
|
||||
if (this._cachedUrl && this._cachedUrl !== '') {
|
||||
const image = new Image();
|
||||
|
||||
image.src = thumbnailUrl;
|
||||
image.crossOrigin = '*';
|
||||
image.src = thumbnailUrl;
|
||||
image.crossOrigin = '*';
|
||||
|
||||
image.onload = () =>
|
||||
{
|
||||
const texture = Texture.from(image);
|
||||
image.onload = () => {
|
||||
const texture = Texture.from(image);
|
||||
|
||||
texture.baseTexture.scaleMode = SCALE_MODES.LINEAR;
|
||||
texture.baseTexture.scaleMode = SCALE_MODES.LINEAR;
|
||||
|
||||
this.setThumbnailImages(texture);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setThumbnailImages(null);
|
||||
}
|
||||
this.setThumbnailImages(texture);
|
||||
};
|
||||
} else {
|
||||
this.setThumbnailImages(null);
|
||||
}
|
||||
}
|
||||
|
||||
return super.updateModel(scale);
|
||||
}
|
||||
|
||||
return super.updateModel(scale);
|
||||
}
|
||||
|
||||
protected getThumbnailURL(): string
|
||||
{
|
||||
throw (new Error('This method must be overridden!'));
|
||||
|
@ -30,9 +30,9 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
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;
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
this._thumbnailDirection = this.direction;
|
||||
}
|
||||
|
||||
private addThumbnailAsset(k: Texture<Resource>, scale: number): void
|
||||
private addThumbnailAsset(texture: Texture<Resource>, scale: number): void
|
||||
{
|
||||
let layerId = 0;
|
||||
|
||||
@ -77,7 +77,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
|
||||
if(asset)
|
||||
{
|
||||
const _local_6 = this.generateTransformedThumbnail(k, asset);
|
||||
const _local_6 = this.generateTransformedThumbnail(texture, asset);
|
||||
const _local_7 = this.getThumbnailAssetName(scale);
|
||||
|
||||
this.asset.disposeAsset(_local_7);
|
||||
@ -113,36 +113,24 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
texture = TextureUtils.generateTexture(container);
|
||||
}
|
||||
|
||||
const scale = 1.1;
|
||||
texture.orig.width = asset.width;
|
||||
texture.orig.height = asset.height;
|
||||
|
||||
const matrix = new Matrix();
|
||||
const difference = (asset.width / texture.width);
|
||||
|
||||
switch(this.direction)
|
||||
{
|
||||
case 2:
|
||||
matrix.a = difference;
|
||||
matrix.b = (-0.5 * difference);
|
||||
matrix.c = 0;
|
||||
matrix.d = (difference * scale);
|
||||
matrix.tx = 0;
|
||||
matrix.ty = ((0.5 * difference) * texture.width);
|
||||
matrix.b = -(0.5);
|
||||
matrix.d /= 1.6;
|
||||
matrix.ty = ((0.5) * texture.width);
|
||||
break;
|
||||
case 0:
|
||||
case 4:
|
||||
matrix.a = difference;
|
||||
matrix.b = (0.5 * difference);
|
||||
matrix.c = 0;
|
||||
matrix.d = (difference * scale);
|
||||
matrix.tx = 0;
|
||||
matrix.ty = 0;
|
||||
matrix.b = (0.5);
|
||||
matrix.d /= 1.6;
|
||||
matrix.tx = -0.5;
|
||||
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);
|
||||
|
@ -261,7 +261,6 @@ export class RoomPlane implements IRoomPlane
|
||||
this._bitmapMasks = null;
|
||||
this._rectangleMasks = null;
|
||||
this._maskPixels = null;
|
||||
|
||||
this._disposed = true;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { IConnection, IRoomHandlerListener } from '../../../api';
|
||||
import { RoomSessionPollEvent, RoomSessionVoteEvent } from '../../../events';
|
||||
import { PollContentsEvent, PollErrorEvent, PollOfferEvent, StartRoomPollEvent, RoomPollResultEvent } from '../../communication';
|
||||
import { PollContentsEvent, PollErrorEvent, PollOfferEvent, StartRoomPollEvent } from '../../communication';
|
||||
import { BaseHandler } from './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 PollErrorEvent(this.onPollErrorEvent.bind(this)));
|
||||
connection.addMessageEvent(new StartRoomPollEvent(this.onStartRoomPollEvent.bind(this)));
|
||||
connection.addMessageEvent(new RoomPollResultEvent(this.onRoomPollResultEvent.bind(this)));
|
||||
}
|
||||
|
||||
private onPollContentsEvent(event: PollContentsEvent): void
|
||||
@ -94,21 +93,4 @@ export class PollHandler extends BaseHandler
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
export class FigureDataContainer
|
||||
export class FigureDataContainer
|
||||
{
|
||||
private static MALE: string = 'M';
|
||||
private static FEMALE: string = 'F';
|
||||
@ -10,11 +10,14 @@
|
||||
private static HAIR: string = 'hr';
|
||||
private static HAT: string = 'ha';
|
||||
private static HEAD_ACCESSORIES: string = 'he';
|
||||
private static EARRINGS: string = 'er';
|
||||
private static EYE_ACCESSORIES: string = 'ea';
|
||||
private static FACE_ACCESSORIES: string = 'fa';
|
||||
private static JACKET: string = 'cc';
|
||||
private static SHIRT: string = 'ch';
|
||||
private static CHEST_ACCESSORIES: string = 'ca';
|
||||
private static PURSES: string = 'pu';
|
||||
private static BACKPACKS: string = 'bp';
|
||||
private static CHEST_PRINTS: string = 'cp';
|
||||
private static TROUSERS: string = 'lg';
|
||||
private static SHOES: string = 'sh';
|
||||
@ -27,13 +30,13 @@
|
||||
private _isDisposed: boolean;
|
||||
private _avatarEffectType: number = -1;
|
||||
|
||||
public loadAvatarData(figure: string, gender: string): void
|
||||
public loadAvatarData(k: string, _arg_2: string): void
|
||||
{
|
||||
this._data = new Map();
|
||||
this._colors = new Map();
|
||||
this._gender = gender;
|
||||
this._gender = _arg_2;
|
||||
|
||||
this.parseFigureString(figure);
|
||||
this.parseFigureString(k);
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
@ -104,7 +107,7 @@
|
||||
|
||||
const sets: string[] = [];
|
||||
|
||||
for(const [key, value] of this._data.entries())
|
||||
for(const [ key, value ] of this._data.entries())
|
||||
{
|
||||
let set = ((key + '-') + value);
|
||||
|
||||
@ -143,11 +146,14 @@
|
||||
case FigureDataContainer.HAIR:
|
||||
case FigureDataContainer.HAT:
|
||||
case FigureDataContainer.HEAD_ACCESSORIES:
|
||||
case FigureDataContainer.EARRINGS:
|
||||
case FigureDataContainer.EYE_ACCESSORIES:
|
||||
case FigureDataContainer.FACE_ACCESSORIES:
|
||||
case FigureDataContainer.SHIRT:
|
||||
case FigureDataContainer.JACKET:
|
||||
case FigureDataContainer.CHEST_ACCESSORIES:
|
||||
case FigureDataContainer.PURSES:
|
||||
case FigureDataContainer.BACKPACKS:
|
||||
case FigureDataContainer.CHEST_PRINTS:
|
||||
case FigureDataContainer.TROUSERS:
|
||||
case FigureDataContainer.SHOES:
|
||||
@ -171,11 +177,14 @@
|
||||
case FigureDataContainer.HAIR:
|
||||
case FigureDataContainer.HAT:
|
||||
case FigureDataContainer.HEAD_ACCESSORIES:
|
||||
case FigureDataContainer.EARRINGS:
|
||||
case FigureDataContainer.EYE_ACCESSORIES:
|
||||
case FigureDataContainer.FACE_ACCESSORIES:
|
||||
case FigureDataContainer.SHIRT:
|
||||
case FigureDataContainer.JACKET:
|
||||
case FigureDataContainer.CHEST_ACCESSORIES:
|
||||
case FigureDataContainer.PURSES:
|
||||
case FigureDataContainer.BACKPACKS:
|
||||
case FigureDataContainer.CHEST_PRINTS:
|
||||
case FigureDataContainer.TROUSERS:
|
||||
case FigureDataContainer.SHOES:
|
||||
@ -187,7 +196,7 @@
|
||||
|
||||
public getFigureStringWithFace(k: number): string
|
||||
{
|
||||
const partSets: string[] = [FigureDataContainer.HD];
|
||||
const partSets: string[] = [ FigureDataContainer.HD ];
|
||||
|
||||
let figure = '';
|
||||
const sets: string[] = [];
|
||||
|
@ -6,7 +6,7 @@ export class Motions
|
||||
private static _QUEUED_MOTIONS: Motion[] = [];
|
||||
private static _RUNNING_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;
|
||||
|
||||
public static get TIMER_TIME(): number
|
||||
@ -164,7 +164,7 @@ export class Motions
|
||||
{
|
||||
if(!Motions._TIMER)
|
||||
{
|
||||
Motions._TIMER = setInterval(Motions.onTick, Motions.TIMER_TIME);
|
||||
Motions._TIMER = window.setInterval(Motions.onTick, Motions.TIMER_TIME);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,35 +1,27 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"outDir": "./dist",
|
||||
"sourceMap": false,
|
||||
"declaration": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"isolatedModules": true,
|
||||
"resolveJsonModule": true,
|
||||
"downlevelIteration": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"target": "ES6",
|
||||
"lib": [
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ESNext"
|
||||
],
|
||||
"module": "ES6",
|
||||
"paths": {
|
||||
"mini-signals": [
|
||||
"node_modules/mini-signals/index.js"
|
||||
]
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"outDir": "./dist",
|
||||
"sourceMap": false,
|
||||
"declaration": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"isolatedModules": true,
|
||||
"resolveJsonModule": true,
|
||||
"downlevelIteration": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"target": "ES6",
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"module": "ES6",
|
||||
"paths": {
|
||||
"mini-signals": ["node_modules/mini-signals/index.js"]
|
||||
}
|
||||
},
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
"include": ["src"]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
import { ViteMinifyPlugin } from 'vite-plugin-minify';
|
||||
|
||||
|
||||
const resolvePath = str => resolve(__dirname, str);
|
||||
|
||||
@ -14,8 +14,8 @@ export default defineConfig({
|
||||
'declaration': true,
|
||||
exclude: resolvePath('./node_modules/**'),
|
||||
allowSyntheticDefaultImports: true
|
||||
}),
|
||||
ViteMinifyPlugin()
|
||||
})
|
||||
|
||||
],
|
||||
build: {
|
||||
lib: {
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user