Merge branch '@update/room-widgets' into 'dev'

@update/room widgets

See merge request nitro/nitro-react!61
This commit is contained in:
Bill 2022-07-25 15:47:59 +00:00
commit 3f9a39f623
547 changed files with 9923 additions and 14216 deletions

17
.vscode/settings.json vendored
View File

@ -4,17 +4,24 @@
"typescript.preferences.quoteStyle": "single",
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"typescript.format.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.sortJSON": false,
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"git.ignoreLimitWarning": true,
"git.ignoreLimitWarning": true,
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.wordWrap": "on",
"emmet.showExpandedAbbreviation": "never",
"eslint.validate": [ "javascript", "javascriptreact", "html", "typescriptreact" ],
"eslint.workingDirectories": [ "./src" ]
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"typescriptreact"
],
"eslint.workingDirectories": [
"./src"
]
}

View File

@ -24,20 +24,25 @@ module.exports = {
},
module: {
...webpackConfig.module,
rules: webpackConfig.module.rules.map((rule) =>
{
if(!rule.oneOf) return rule;
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
},
...webpackConfig.module.rules.map((rule) => {
if (!rule.oneOf) return rule;
return {
...rule,
oneOf: rule.oneOf.map((ruleObject) =>
{
if(!new RegExp(ruleObject.test).test('.ts') || !ruleObject.include) return ruleObject;
return {
...rule,
oneOf: rule.oneOf.map((ruleObject) => {
if (!new RegExp(ruleObject.test).test('.ts') || !ruleObject.include) return ruleObject;
return { ...ruleObject, include: undefined };
})
};
})
return { ...ruleObject, include: undefined };
})
};
})
]
}
})
}

View File

@ -3,54 +3,54 @@
"version": "2.0.0",
"private": true,
"scripts": {
"start": "cross-env SKIP_PREFLIGHT_CHECK=true BROWSER=none IMAGE_INLINE_SIZE_LIMIT=100000 craco start",
"build": "cross-env SKIP_PREFLIGHT_CHECK=true GENERATE_SOURCEMAP=false IMAGE_INLINE_SIZE_LIMIT=100000 craco build",
"start": "cross-env SKIP_PREFLIGHT_CHECK=true BROWSER=none IMAGE_INLINE_SIZE_LIMIT=100000 craco --openssl-legacy-provider start",
"build": "cross-env SKIP_PREFLIGHT_CHECK=true GENERATE_SOURCEMAP=false IMAGE_INLINE_SIZE_LIMIT=100000 craco --openssl-legacy-provider build",
"build:prod": "npx browserslist@latest --update-db && yarn build",
"test": "craco test",
"eject": "react-scripts eject",
"eslint": "eslint src --ext .ts,.tsx"
},
"dependencies": {
"@craco/craco": "^6.3.0",
"@fortawesome/fontawesome-svg-core": "^6.1.0",
"@fortawesome/free-solid-svg-icons": "^6.1.0",
"@fortawesome/react-fontawesome": "^0.1.17",
"@nitrots/nitro-renderer": "^1.2.5",
"@types/react-transition-group": "^4.4.4",
"@craco/craco": "^6.4.5",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@nitrots/nitro-renderer": "^1.3.1",
"animate.css": "^4.1.1",
"classnames": "^2.3.1",
"cross-env": "^7.0.3",
"emoji-toolkit": "^6.6.0",
"node-sass": "^6.0.1",
"react": "^18.0.0",
"react": "^18.2.0",
"react-bootstrap": "^2.2.2",
"react-dom": "^18.0.0",
"react-dom": "^18.2.0",
"react-scripts": "4.0.3",
"react-slider": "^2.0.0",
"react-transition-group": "^4.4.2",
"react-virtualized": "^9.22.3",
"react-youtube": "^7.13.1",
"sass": "^1.53.0",
"typescript": "^4.3.5",
"use-between": "^1.3.1"
"use-between": "^1.3.4"
},
"resolutions": {
"react-error-overlay": "6.0.9",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3"
"react-error-overlay": "6.0.11",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6"
},
"devDependencies": {
"@types/node": "^12.20.19",
"@types/react": "^18.0.8",
"@types/react-dom": "^18.0.3",
"@types/node": "^18.6.1",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@types/react-slider": "^1.3.1",
"@types/react-virtualized": "^9.21.13",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"react-error-overlay": "6.0.9"
"@types/react-transition-group": "^4.4.5",
"@types/react-virtualized": "^9.21.21",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"eslint": "^8.20.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"react-error-overlay": "6.0.11"
}
}

View File

@ -17,41 +17,41 @@
"motto.max.length": 38,
"bot.name.max.length": 15,
"navigator.room.models": [
{ "clubLevel": 0, "tileSize": 104, "name": "a" },
{ "clubLevel": 0, "tileSize": 94, "name": "b" },
{ "clubLevel": 0, "tileSize": 36, "name": "c" },
{ "clubLevel": 0, "tileSize": 84, "name": "d" },
{ "clubLevel": 0, "tileSize": 80, "name": "e" },
{ "clubLevel": 0, "tileSize": 80, "name": "f" },
{ "clubLevel": 0, "tileSize": 416, "name": "i" },
{ "clubLevel": 0, "tileSize": 320, "name": "j" },
{ "clubLevel": 0, "tileSize": 448, "name": "k" },
{ "clubLevel": 0, "tileSize": 352, "name": "l" },
{ "clubLevel": 0, "tileSize": 384, "name": "m" },
{ "clubLevel": 0, "tileSize": 372, "name": "n" },
{ "clubLevel": 1, "tileSize": 80, "name": "g" },
{ "clubLevel": 1, "tileSize": 74, "name": "h" },
{ "clubLevel": 1, "tileSize": 416, "name": "o" },
{ "clubLevel": 1, "tileSize": 352, "name": "p" },
{ "clubLevel": 1, "tileSize": 304, "name": "q" },
{ "clubLevel": 1, "tileSize": 336, "name": "r" },
{ "clubLevel": 1, "tileSize": 748, "name": "u" },
{ "clubLevel": 1, "tileSize": 438, "name": "v" },
{ "clubLevel": 2, "tileSize": 540, "name": "t" },
{ "clubLevel": 2, "tileSize": 512, "name": "w" },
{ "clubLevel": 2, "tileSize": 396, "name": "x" },
{ "clubLevel": 2, "tileSize": 440, "name": "y" },
{ "clubLevel": 2, "tileSize": 456, "name": "z" },
{ "clubLevel": 2, "tileSize": 208, "name": "0" },
{ "clubLevel": 2, "tileSize": 1009, "name": "1" },
{ "clubLevel": 2, "tileSize": 1044, "name": "2" },
{ "clubLevel": 2, "tileSize": 183, "name": "3" },
{ "clubLevel": 2, "tileSize": 254, "name": "4" },
{ "clubLevel": 2, "tileSize": 1024, "name": "5" },
{ "clubLevel": 2, "tileSize": 801, "name": "6" },
{ "clubLevel": 2, "tileSize": 354, "name": "7" },
{ "clubLevel": 2, "tileSize": 888, "name": "8" },
{ "clubLevel": 2, "tileSize": 926, "name": "9" }
{ "clubLevel": 0, "tileSize": 104, "name": "a" },
{ "clubLevel": 0, "tileSize": 94, "name": "b" },
{ "clubLevel": 0, "tileSize": 36, "name": "c" },
{ "clubLevel": 0, "tileSize": 84, "name": "d" },
{ "clubLevel": 0, "tileSize": 80, "name": "e" },
{ "clubLevel": 0, "tileSize": 80, "name": "f" },
{ "clubLevel": 0, "tileSize": 416, "name": "i" },
{ "clubLevel": 0, "tileSize": 320, "name": "j" },
{ "clubLevel": 0, "tileSize": 448, "name": "k" },
{ "clubLevel": 0, "tileSize": 352, "name": "l" },
{ "clubLevel": 0, "tileSize": 384, "name": "m" },
{ "clubLevel": 0, "tileSize": 372, "name": "n" },
{ "clubLevel": 1, "tileSize": 80, "name": "g" },
{ "clubLevel": 1, "tileSize": 74, "name": "h" },
{ "clubLevel": 1, "tileSize": 416, "name": "o" },
{ "clubLevel": 1, "tileSize": 352, "name": "p" },
{ "clubLevel": 1, "tileSize": 304, "name": "q" },
{ "clubLevel": 1, "tileSize": 336, "name": "r" },
{ "clubLevel": 1, "tileSize": 748, "name": "u" },
{ "clubLevel": 1, "tileSize": 438, "name": "v" },
{ "clubLevel": 2, "tileSize": 540, "name": "t" },
{ "clubLevel": 2, "tileSize": 512, "name": "w" },
{ "clubLevel": 2, "tileSize": 396, "name": "x" },
{ "clubLevel": 2, "tileSize": 440, "name": "y" },
{ "clubLevel": 2, "tileSize": 456, "name": "z" },
{ "clubLevel": 2, "tileSize": 208, "name": "0" },
{ "clubLevel": 2, "tileSize": 1009, "name": "1" },
{ "clubLevel": 2, "tileSize": 1044, "name": "2" },
{ "clubLevel": 2, "tileSize": 183, "name": "3" },
{ "clubLevel": 2, "tileSize": 254, "name": "4" },
{ "clubLevel": 2, "tileSize": 1024, "name": "5" },
{ "clubLevel": 2, "tileSize": 801, "name": "6" },
{ "clubLevel": 2, "tileSize": 354, "name": "7" },
{ "clubLevel": 2, "tileSize": 888, "name": "8" },
{ "clubLevel": 2, "tileSize": 926, "name": "9" }
],
"hotelview": {
"show.avatar": true,

View File

@ -1,10 +1,10 @@
import { ConfigurationEvent, HabboWebTools, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react';
import { GetCommunication, GetConfiguration, GetNitroInstance, GetUIVersion } from './api';
import { DispatchUiEvent, GetCommunication, GetConfiguration, GetNitroInstance, GetUIVersion } from './api';
import { Base, TransitionAnimation, TransitionAnimationTypes } from './common';
import { LoadingView } from './components/loading/LoadingView';
import { MainView } from './components/main/MainView';
import { DispatchUiEvent, UseConfigurationEvent, UseLocalizationEvent, UseMainEvent, UseRoomEngineEvent } from './hooks';
import { useConfigurationEvent, useLocalizationEvent, useMainEvent, useRoomEngineEvent } from './hooks';
import IntervalWebWorker from './workers/IntervalWebWorker';
import { WorkerBuilder } from './workers/WorkerBuilder';
@ -107,17 +107,17 @@ export const App: FC<{}> = props =>
}
}, []);
UseMainEvent(Nitro.WEBGL_UNAVAILABLE, handler);
UseMainEvent(Nitro.WEBGL_CONTEXT_LOST, handler);
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING, handler);
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKE_FAILED, handler);
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED, handler);
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_ERROR, handler);
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_CLOSED, handler);
UseRoomEngineEvent(RoomEngineEvent.ENGINE_INITIALIZED, handler);
UseLocalizationEvent(NitroLocalizationEvent.LOADED, handler);
UseConfigurationEvent(ConfigurationEvent.LOADED, handler);
UseConfigurationEvent(ConfigurationEvent.FAILED, handler);
useMainEvent(Nitro.WEBGL_UNAVAILABLE, handler);
useMainEvent(Nitro.WEBGL_CONTEXT_LOST, handler);
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING, handler);
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKE_FAILED, handler);
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED, handler);
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_ERROR, handler);
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_CLOSED, handler);
useRoomEngineEvent(RoomEngineEvent.ENGINE_INITIALIZED, handler);
useLocalizationEvent(NitroLocalizationEvent.LOADED, handler);
useConfigurationEvent(ConfigurationEvent.LOADED, handler);
useConfigurationEvent(ConfigurationEvent.FAILED, handler);
useEffect(() =>
{

View File

@ -1,6 +1,5 @@
import { AchievementData } from '@nitrots/nitro-renderer';
import { GetAchievementCategoryProgress } from '.';
import { GetAchievementCategoryMaxProgress } from './GetAchievementCategoryMaxProgress';
import { AchievementUtilities } from './AchievementUtilities';
import { IAchievementCategory } from './IAchievementCategory';
export class AchievementCategory implements IAchievementCategory
@ -16,12 +15,12 @@ export class AchievementCategory implements IAchievementCategory
public getProgress(): number
{
return GetAchievementCategoryProgress(this);
return AchievementUtilities.getAchievementCategoryProgress(this);
}
public getMaxProgress(): number
{
return GetAchievementCategoryMaxProgress(this);
return AchievementUtilities.getAchievementCategoryMaxProgress(this);
}
public get code(): string

View File

@ -0,0 +1,97 @@
import { AchievementData } from '@nitrots/nitro-renderer';
import { GetConfiguration, GetLocalization } from '../nitro';
import { IAchievementCategory } from './IAchievementCategory';
export class AchievementUtilities
{
public static getAchievementBadgeCode(achievement: AchievementData): string
{
if(!achievement) return null;
let badgeId = achievement.badgeId;
if(!achievement.finalLevel) badgeId = GetLocalization().getPreviousLevelBadgeId(badgeId);
return badgeId;
}
public static getAchievementCategoryImageUrl(category: IAchievementCategory, progress: number = null, icon: boolean = false): string
{
const imageUrl = GetConfiguration<string>('achievements.images.url');
let imageName = icon ? 'achicon_' : 'achcategory_';
imageName += category.code;
if(progress !== null) imageName += `_${ ((progress > 0) ? 'active' : 'inactive') }`;
return imageUrl.replace('%image%', imageName);
}
public static getAchievementCategoryMaxProgress(category: IAchievementCategory): number
{
if(!category) return 0;
let progress = 0;
for(const achievement of category.achievements)
{
progress += achievement.levelCount;
}
return progress;
}
public static getAchievementCategoryProgress(category: IAchievementCategory): number
{
if(!category) return 0;
let progress = 0;
for(const achievement of category.achievements) progress += (achievement.finalLevel ? achievement.level : (achievement.level - 1));
return progress;
}
public static getAchievementCategoryTotalUnseen(category: IAchievementCategory): number
{
if(!category) return 0;
let unseen = 0;
for(const achievement of category.achievements) ((achievement.unseen > 0) && unseen++);
return unseen;
}
public static getAchievementHasStarted(achievement: AchievementData): boolean
{
if(!achievement) return false;
if(achievement.finalLevel || ((achievement.level - 1) > 0)) return true;
return false;
}
public static getAchievementIsIgnored(achievement: AchievementData): boolean
{
if(!achievement) return false;
const ignored = GetConfiguration<string[]>('achievements.unseen.ignored');
const value = achievement.badgeId.replace(/[0-9]/g, '');
const index = ignored.indexOf(value);
if(index >= 0) return true;
return false;
}
public static getAchievementLevel(achievement: AchievementData): number
{
if(!achievement) return 0;
if(achievement.finalLevel) return achievement.level;
return (achievement.level - 1);
}
}

View File

@ -1,13 +0,0 @@
import { AchievementData } from '@nitrots/nitro-renderer';
import { GetLocalization } from '..';
export const GetAchievementBadgeCode = (achievement: AchievementData) =>
{
if(!achievement) return null;
let badgeId = achievement.badgeId;
if(!achievement.finalLevel) badgeId = GetLocalization().getPreviousLevelBadgeId(badgeId);
return badgeId;
}

View File

@ -1,14 +0,0 @@
import { GetConfiguration, IAchievementCategory } from '..';
export const GetAchievementCategoryImageUrl = (category: IAchievementCategory, progress: number = null, icon: boolean = false) =>
{
const imageUrl = GetConfiguration<string>('achievements.images.url');
let imageName = icon ? 'achicon_' : 'achcategory_';
imageName += category.code;
if(progress !== null) imageName += `_${ ((progress > 0) ? 'active' : 'inactive') }`;
return imageUrl.replace('%image%', imageName);
}

View File

@ -1,15 +0,0 @@
import { IAchievementCategory } from '.';
export const GetAchievementCategoryMaxProgress = (category: IAchievementCategory) =>
{
if(!category) return 0;
let progress = 0;
for(const achievement of category.achievements)
{
progress += achievement.levelCount;
}
return progress;
}

View File

@ -1,12 +0,0 @@
import { IAchievementCategory } from '.';
export const GetAchievementCategoryProgress = (category: IAchievementCategory) =>
{
if(!category) return 0;
let progress = 0;
for(const achievement of category.achievements) progress += (achievement.finalLevel ? achievement.level : (achievement.level - 1));
return progress;
}

View File

@ -1,12 +0,0 @@
import { IAchievementCategory } from '.';
export const GetAchievementCategoryTotalUnseen = (category: IAchievementCategory) =>
{
if(!category) return 0;
let unseen = 0;
for(const achievement of category.achievements) ((achievement.unseen > 0) && unseen++);
return unseen;
}

View File

@ -1,10 +0,0 @@
import { AchievementData } from '@nitrots/nitro-renderer';
export const GetAchievementHasStarted = (achievement: AchievementData) =>
{
if(!achievement) return false;
if(achievement.finalLevel || ((achievement.level - 1) > 0)) return true;
return false;
}

View File

@ -1,15 +0,0 @@
import { AchievementData } from '@nitrots/nitro-renderer';
import { GetConfiguration } from '..';
export const GetAchievementIsIgnored = (achievement: AchievementData) =>
{
if(!achievement) return false;
const ignored = GetConfiguration<string[]>('achievements.unseen.ignored');
const value = achievement.badgeId.replace(/[0-9]/g, '');
const index = ignored.indexOf(value);
if(index >= 0) return true;
return false;
}

View File

@ -1,10 +0,0 @@
import { AchievementData } from '@nitrots/nitro-renderer';
export const GetAchievementLevel = (achievement: AchievementData) =>
{
if(!achievement) return 0;
if(achievement.finalLevel) return achievement.level;
return (achievement.level - 1);
}

View File

@ -1,10 +1,3 @@
export * from './AchievementCategory';
export * from './GetAchievementBadgeCode';
export * from './GetAchievementCategoryImageUrl';
export * from './GetAchievementCategoryMaxProgress';
export * from './GetAchievementCategoryProgress';
export * from './GetAchievementCategoryTotalUnseen';
export * from './GetAchievementHasStarted';
export * from './GetAchievementIsIgnored';
export * from './GetAchievementLevel';
export * from './AchievementUtilities';
export * from './IAchievementCategory';

View File

@ -1,5 +1,5 @@
import { AvatarFigurePartType, IAvatarImageListener, IAvatarRenderManager, IFigurePart, IFigurePartSet, IGraphicAsset, IPartColor, NitroAlphaFilter, NitroContainer, NitroSprite, TextureUtils } from '@nitrots/nitro-renderer';
import { GetAvatarRenderManager } from '../../../api';
import { GetAvatarRenderManager } from '../nitro';
import { FigureData } from './FigureData';
export class AvatarEditorGridPartItem implements IAvatarImageListener

View File

@ -1,5 +1,5 @@
import { IPartColor } from '@nitrots/nitro-renderer';
import { GetAvatarPalette, GetAvatarRenderManager, GetAvatarSetType, GetClubMemberLevel, GetConfiguration } from '../../../api';
import { GetAvatarPalette, GetAvatarRenderManager, GetAvatarSetType, GetClubMemberLevel, GetConfiguration } from '../nitro';
import { AvatarEditorGridColorItem } from './AvatarEditorGridColorItem';
import { AvatarEditorGridPartItem } from './AvatarEditorGridPartItem';
import { CategoryBaseModel } from './CategoryBaseModel';

View File

@ -1,5 +1,5 @@
import { AvatarEditorFigureCategory, AvatarScaleType, AvatarSetType } from '@nitrots/nitro-renderer';
import { GetAvatarRenderManager } from '../../../api';
import { GetAvatarRenderManager } from '../nitro';
import { AvatarEditorUtilities } from './AvatarEditorUtilities';
import { CategoryBaseModel } from './CategoryBaseModel';
import { FigureData } from './FigureData';

View File

@ -1,6 +1,6 @@
import { AvatarFigureContainer, IFigurePartSet, IPalette, IPartColor, SetType } from '@nitrots/nitro-renderer';
import { GetAvatarRenderManager } from '../../../api';
import { Randomizer } from '../../../api/utils';
import { GetAvatarRenderManager } from '../nitro';
import { Randomizer } from '../utils';
import { FigureData } from './FigureData';
function getTotalColors(partSet: IFigurePartSet): number

13
src/api/avatar/index.ts Normal file
View File

@ -0,0 +1,13 @@
export * from './AvatarEditorAction';
export * from './AvatarEditorGridColorItem';
export * from './AvatarEditorGridPartItem';
export * from './AvatarEditorUtilities';
export * from './BodyModel';
export * from './CategoryBaseModel';
export * from './CategoryData';
export * from './FigureData';
export * from './FigureGenerator';
export * from './HeadModel';
export * from './IAvatarEditorCategoryModel';
export * from './LegModel';
export * from './TorsoModel';

3
src/api/camera/index.ts Normal file
View File

@ -0,0 +1,3 @@
export * from './CameraEditorTabs';
export * from './CameraPicture';
export * from './CameraPictureThumbnail';

View File

@ -1,5 +1,6 @@
export const currentDate = () =>
export const ChatHistoryCurrentDate = () =>
{
const currentTime = new Date();
return `${ currentTime.getHours().toString().padStart(2, '0') }:${ currentTime.getMinutes().toString().padStart(2, '0') }`;
}

View File

@ -0,0 +1,5 @@
export interface IRoomHistoryEntry
{
id: number;
name: string;
}

View File

@ -0,0 +1,4 @@
export * from './ChatEntryType';
export * from './ChatHistoryCurrentDate';
export * from './IChatEntry';
export * from './IRoomHistoryEntry';

View File

@ -0,0 +1,3 @@
import { IEventDispatcher, NitroEvent } from '@nitrots/nitro-renderer';
export const DispatchEvent = (eventDispatcher: IEventDispatcher, event: NitroEvent) => eventDispatcher.dispatchEvent(event);

View File

@ -0,0 +1,5 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../nitro';
import { DispatchEvent } from './DispatchEvent';
export const DispatchMainEvent = (event: NitroEvent) => DispatchEvent(GetNitroInstance().events, event);

View File

@ -0,0 +1,5 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { DispatchEvent } from './DispatchEvent';
import { UI_EVENT_DISPATCHER } from './UI_EVENT_DISPATCHER';
export const DispatchUiEvent = (event: NitroEvent) => DispatchEvent(UI_EVENT_DISPATCHER, event);

4
src/api/events/index.ts Normal file
View File

@ -0,0 +1,4 @@
export * from './DispatchEvent';
export * from './DispatchMainEvent';
export * from './DispatchUiEvent';
export * from './UI_EVENT_DISPATCHER';

View File

@ -1,4 +1,4 @@
export class GroupType
export class MessengerGroupType
{
public static readonly GROUP_CHAT = 0;
public static readonly PRIVATE_CHAT = 1;

View File

@ -1,7 +1,7 @@
import { LocalizeText } from '../utils';
import { GetGroupChatData } from './GetGroupChatData';
import { GroupType } from './GroupType';
import { MessengerFriend } from './MessengerFriend';
import { MessengerGroupType } from './MessengerGroupType';
import { MessengerThreadChat } from './MessengerThreadChat';
import { MessengerThreadChatGroup } from './MessengerThreadChatGroup';
@ -41,7 +41,7 @@ export class MessengerThread
if(!group) return;
if(isGroupChat) group.type = GroupType.GROUP_CHAT;
if(isGroupChat) group.type = MessengerGroupType.GROUP_CHAT;
const chat = new MessengerThreadChat(senderId, message, secondsSinceSent, extraData, type);

View File

@ -1,4 +1,4 @@
import { GroupType } from './GroupType';
import { MessengerGroupType } from './MessengerGroupType';
import { MessengerThreadChat } from './MessengerThreadChat';
export class MessengerThreadChatGroup
@ -7,7 +7,7 @@ export class MessengerThreadChatGroup
private _chats: MessengerThreadChat[];
private _type: number;
constructor(userId: number, type = GroupType.PRIVATE_CHAT)
constructor(userId: number, type = MessengerGroupType.PRIVATE_CHAT)
{
this._userId = userId;
this._chats = [];

View File

@ -1,7 +1,7 @@
export * from './GetGroupChatData';
export * from './GroupType';
export * from './IGroupChatData';
export * from './MessengerFriend';
export * from './MessengerGroupType';
export * from './MessengerIconState';
export * from './MessengerRequest';
export * from './MessengerSettings';

View File

@ -1,5 +1,10 @@
export * from './GetGroupInformation';
export * from './GetGroupManager';
export * from './GetGroupMembers';
export * from './GroupBadgePart';
export * from './GroupMembershipType';
export * from './GroupType';
export * from './IGroupCustomize';
export * from './IGroupData';
export * from './ToggleFavoriteGroup';
export * from './TryJoinGroup';

View File

@ -0,0 +1,3 @@
export * from './GuideSessionState';
export * from './GuideToolMessage';
export * from './GuideToolMessageGroup';

View File

@ -1,4 +1,4 @@
import { IChatEntry } from '../../chat-history/common/IChatEntry';
import { IChatEntry } from '../chat-history';
export interface IHelpReportState
{

4
src/api/help/index.ts Normal file
View File

@ -0,0 +1,4 @@
export * from './CallForHelpResult';
export * from './GetCloseReasonKey';
export * from './IHelpReportState';
export * from './IReportedUser';

View File

@ -1,26 +1,28 @@
export * from './achievements';
export * from './avatar';
export * from './camera';
export * from './campaign';
export * from './catalog';
export * from './core';
export * from './chat-history';
export * from './events';
export * from './friends';
export * from './GetRendererVersion';
export * from './GetUIVersion';
export * from './groups';
export * from './guide-tool';
export * from './hc-center';
export * from './help';
export * from './inventory';
export * from './inventory/unseen';
export * from './navigator';
export * from './nitro';
export * from './nitro/avatar';
export * from './nitro/camera';
export * from './nitro/core';
export * from './nitro/room';
export * from './nitro/room/widgets';
export * from './nitro/room/widgets/events';
export * from './nitro/room/widgets/handlers';
export * from './nitro/room/widgets/messages';
export * from './nitro/session';
export * from './notification';
export * from './purse';
export * from './room';
export * from './user';
export * from './utils';
export * from './wired';

View File

@ -1,6 +1,6 @@
import { IFurnitureItemData, IObjectData } from '@nitrots/nitro-renderer';
import { IFurnitureItem } from '.';
import { GetNitroInstance } from '..';
import { GetNitroInstance } from '../nitro';
import { IFurnitureItem } from './IFurnitureItem';
export class FurnitureItem implements IFurnitureItem
{

View File

@ -1,5 +1,5 @@
import { IObjectData, IRoomEngine } from '@nitrots/nitro-renderer';
import { LocalizeText } from '..';
import { LocalizeText } from '../utils';
import { FurniCategory } from './FurniCategory';
import { FurnitureItem } from './FurnitureItem';
import { IFurnitureItem } from './IFurnitureItem';

View File

@ -1,6 +1,7 @@
import { FurniturePlacePaintComposer, RoomObjectCategory, RoomObjectPlacementSource, RoomObjectType } from '@nitrots/nitro-renderer';
import { FurniCategory, GroupItem } from '.';
import { CreateLinkEvent, GetRoomEngine, GetRoomSessionManager, SendMessageComposer } from '..';
import { CreateLinkEvent, GetRoomEngine, GetRoomSessionManager, SendMessageComposer } from '../nitro';
import { FurniCategory } from './FurniCategory';
import { GroupItem } from './GroupItem';
import { IBotItem } from './IBotItem';
import { IPetItem } from './IPetItem';

View File

@ -2,7 +2,7 @@ import { PetData } from '@nitrots/nitro-renderer';
import { CreateLinkEvent } from '../nitro';
import { cancelRoomObjectPlacement, getPlacingItemId } from './InventoryUtilities';
import { IPetItem } from './IPetItem';
import { UnseenItemCategory } from './unseen';
import { UnseenItemCategory } from './UnseenItemCategory';
export const getAllPetIds = (petItems: IPetItem[]) => petItems.map(item => item.petData.id);

View File

@ -1,26 +0,0 @@
import { LocalizeText, NotificationUtilities } from '..';
import { TradingNotificationType } from './TradingNotificationType';
export const TradingNotificationMessage = (type: number, otherUsername: string = '') =>
{
switch(type)
{
case TradingNotificationType.ALERT_SCAM:
NotificationUtilities.simpleAlert(LocalizeText('inventory.trading.warning.other_not_offering'), null, null, null, LocalizeText('inventory.trading.notification.title'));
return;
case TradingNotificationType.HOTEL_TRADING_DISABLED:
case TradingNotificationType.YOU_NOT_ALLOWED:
case TradingNotificationType.THEY_NOT_ALLOWED:
case TradingNotificationType.ROOM_DISABLED:
case TradingNotificationType.YOU_OPEN:
case TradingNotificationType.THEY_OPEN:
NotificationUtilities.simpleAlert(LocalizeText(`inventory.trading.openfail.${ type }`, [ 'otherusername' ], [ otherUsername ]), null, null, null, LocalizeText('inventory.trading.openfail.title'));
return;
case TradingNotificationType.ERROR_WHILE_COMMIT:
NotificationUtilities.simpleAlert(`${ LocalizeText('inventory.trading.notification.caption') }, ${ LocalizeText('inventory.trading.notification.commiterror.info') }`, null, null, null, LocalizeText('inventory.trading.notification.title'));
return;
case TradingNotificationType.THEY_CANCELLED:
NotificationUtilities.simpleAlert(LocalizeText('inventory.trading.info.closed'), null, null, null, LocalizeText('inventory.trading.notification.title'));
return;
}
}

View File

@ -6,10 +6,10 @@ export * from './IBotItem';
export * from './IFurnitureItem';
export * from './InventoryUtilities';
export * from './IPetItem';
export * from './IUnseenItemTracker';
export * from './PetUtilities';
export * from './TradeState';
export * from './TradeUserData';
export * from './TradingNotificationMessage';
export * from './TradingNotificationType';
export * from './TradingUtilities';
export * from './unseen';
export * from './UnseenItemCategory';

View File

@ -1,2 +0,0 @@
export * from './IUnseenItemTracker';
export * from './UnseenItemCategory';

View File

@ -1,76 +0,0 @@
import { RoomSettingsParser } from '@nitrots/nitro-renderer';
export class RoomSettingsData
{
public roomId: number;
public roomName: string;
public roomOriginalName: string;
public roomDescription: string;
public categoryId: number;
public userCount: number;
public tags: string[];
public tradeState: number;
public allowWalkthrough: boolean;
public lockState: number;
public originalLockState: number;
public password: string;
public confirmPassword: string;
public allowPets: boolean;
public allowPetsEat: boolean;
public usersWithRights: Map<number, string>;
public hideWalls: boolean;
public wallThickness: number;
public floorThickness: number;
public chatBubbleMode: number;
public chatBubbleWeight: number;
public chatBubbleSpeed: number;
public chatFloodProtection: number;
public chatDistance: number;
public muteState: number;
public kickState: number;
public banState: number;
public bannedUsers: any[];
public selectedUserToUnban: number;
constructor(parser: RoomSettingsParser)
{
if(!parser) throw new Error('invalid_parser');
this.roomId = parser.roomId;
this.roomName = parser.name;
this.roomOriginalName = parser.name;
this.roomDescription = parser.description;
this.categoryId = parser.categoryId;
this.userCount = parser.userCount;
this.tags = parser.tags;
this.tradeState = parser.tradeMode;
this.allowWalkthrough = parser.allowWalkthrough;
this.lockState = parser.state;
this.originalLockState = parser.state;
this.password = null;
this.confirmPassword = null;
this.allowPets = parser.allowPets;
this.allowPetsEat = parser.allowPetsEat;
this.usersWithRights = new Map<number, string>();
this.hideWalls = parser.hideWalls;
this.wallThickness = parser.thicknessWall;
this.floorThickness = parser.thicknessFloor;
this.chatBubbleMode = parser.chatSettings.mode;
this.chatBubbleWeight = parser.chatSettings.weight;
this.chatBubbleSpeed = parser.chatSettings.speed;
this.chatFloodProtection = parser.chatSettings.protection;
this.chatDistance = parser.chatSettings.distance;
this.muteState = parser.moderationSettings.allowMute;
this.kickState = parser.moderationSettings.allowKick;
this.banState = parser.moderationSettings.allowBan;
this.bannedUsers = [];
}
}

View File

@ -1,7 +1,7 @@
import { RoomInfoComposer } from '@nitrots/nitro-renderer';
import { GetGuestRoomMessageComposer } from '@nitrots/nitro-renderer';
import { SendMessageComposer } from '../nitro';
export function TryVisitRoom(roomId: number): void
{
SendMessageComposer(new RoomInfoComposer(roomId, false, true));
SendMessageComposer(new GetGuestRoomMessageComposer(roomId, false, true));
}

View File

@ -7,7 +7,6 @@ export * from './IRoomModel';
export * from './IRoomModerationSettings';
export * from './NavigatorSearchResultViewDisplayMode';
export * from './RoomInfoData';
export * from './RoomSettingsData';
export * from './RoomSettingsUtils';
export * from './SearchFilterOptions';
export * from './TryVisitRoom';

16
src/api/nitro/OpenUrl.ts Normal file
View File

@ -0,0 +1,16 @@
import { HabboWebTools } from '@nitrots/nitro-renderer';
import { CreateLinkEvent } from './CreateLinkEvent';
export const OpenUrl = (url: string) =>
{
if(!url || !url.length) return;
if(url.startsWith('http'))
{
HabboWebTools.openWebPage(url);
}
else
{
CreateLinkEvent(url);
}
}

View File

@ -1,5 +1,5 @@
import { INitroCore } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../nitro';
import { GetNitroInstance } from '..';
export function GetNitroCore(): INitroCore
{

View File

@ -2,6 +2,7 @@ export * from './AddLinkEventTracker';
export * from './AddWorkerEventTracker';
export * from './avatar';
export * from './camera';
export * from './core';
export * from './CreateLinkEvent';
export * from './GetCommunication';
export * from './GetConfiguration';
@ -9,13 +10,10 @@ export * from './GetConnection';
export * from './GetLocalization';
export * from './GetNitroInstance';
export * from './GetTicker';
export * from './OpenUrl';
export * from './RemoveLinkEventTracker';
export * from './RemoveWorkerEventTracker';
export * from './room';
export * from './room/widgets';
export * from './room/widgets/events';
export * from './room/widgets/handlers';
export * from './room/widgets/messages';
export * from './SendMessageComposer';
export * from './SendWorkerEvent';
export * from './session';

View File

@ -8,4 +8,3 @@ export * from './InitializeRoomInstanceRenderingCanvas';
export * from './IsFurnitureSelectionDisabled';
export * from './ProcessRoomObjectOperation';
export * from './SetActiveRoomId';
export * from './widgets';

View File

@ -1,48 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetAvatarInfoEvent extends RoomWidgetUpdateEvent
{
public static AVATAR_INFO: string = 'RWAIE_AVATAR_INFO';
private _userId: number;
private _userName: string;
private _userType: number;
private _roomIndex: number;
private _allowNameChange: boolean;
constructor(userId: number, userName: string, userType: number, roomIndex: number, allowNameChange: boolean)
{
super(RoomWidgetAvatarInfoEvent.AVATAR_INFO);
this._userId = userId;
this._userName = userName;
this._userType = userType;
this._roomIndex = roomIndex;
this._allowNameChange = allowNameChange;
}
public get userId(): number
{
return this._userId;
}
public get userName(): string
{
return this._userName;
}
public get userType(): number
{
return this._userType;
}
public get roomIndex(): number
{
return this._roomIndex;
}
public get allowNameChange(): boolean
{
return this._allowNameChange;
}
}

View File

@ -1,22 +0,0 @@
import { RoomObjectItem } from './RoomObjectItem';
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetChooserContentEvent extends RoomWidgetUpdateEvent
{
public static USER_CHOOSER_CONTENT: string = 'RWCCE_USER_CHOOSER_CONTENT';
public static FURNI_CHOOSER_CONTENT: string = 'RWCCE_FURNI_CHOOSER_CONTENT';
private _items: RoomObjectItem[];
constructor(type: string, items: RoomObjectItem[])
{
super(type);
this._items = items;
}
public get items(): RoomObjectItem[]
{
return this._items;
}
}

View File

@ -1,20 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetFloodControlEvent extends RoomWidgetUpdateEvent
{
public static FLOOD_CONTROL: string = 'RWFCE_FLOOD_CONTROL';
private _seconds: number = 0;
constructor(seconds: number)
{
super(RoomWidgetFloodControlEvent.FLOOD_CONTROL);
this._seconds = seconds;
}
public get seconds(): number
{
return this._seconds;
}
}

View File

@ -1,48 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetObjectNameEvent extends RoomWidgetUpdateEvent
{
public static TYPE: string = 'RWONE_TYPE';
private _roomIndex: number;
private _category: number;
private _id: number;
private _name: string;
private _userType: number;
constructor(type: string, roomIndex: number, category: number, id: number, name: string, userType: number)
{
super(type);
this._roomIndex = roomIndex;
this._category = category;
this._id = id;
this._name = name;
this._userType = userType;
}
public get roomIndex(): number
{
return this._roomIndex;
}
public get category(): number
{
return this._category;
}
public get id(): number
{
return this._id;
}
public get name(): string
{
return this._name;
}
public get userType(): number
{
return this._userType;
}
}

View File

@ -1,124 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateChatEvent extends RoomWidgetUpdateEvent
{
public static CHAT_EVENT: string = 'RWUCE_CHAT_EVENT';
public static CHAT_TYPE_SPEAK: number = 0;
public static CHAT_TYPE_WHISPER: number = 1;
public static CHAT_TYPE_SHOUT: number = 2;
public static CHAT_TYPE_RESPECT: number = 3;
public static CHAT_TYPE_PETRESPECT: number = 4;
public static CHAT_TYPE_NOTIFY: number = 5;
public static CHAT_TYPE_PETTREAT: number = 6;
public static CHAT_TYPE_PETREVIVE: number = 7;
public static CHAT_TYPE_PET_REBREED_FERTILIZE: number = 8;
public static CHAT_TYPE_PET_SPEED_FERTILIZE: number = 9;
public static CHAT_TYPE_BOT_SPEAK: number = 10;
public static CHAT_TYPE_BOT_SHOUT: number = 11;
public static CHAT_TYPE_BOT_WHISPER: number = 12;
private _userId: number;
private _text: string;
private _chatType: number;
private _userName: string;
private _links: string[];
private _userX: number;
private _userY: number;
private _userImage: string;
private _userColor: number;
private _roomId: number;
private _userCategory: number;
private _userType: number;
private _petType: number;
private _styleId: number;
constructor(type: string, userId: number, text: string, userName: string, userCategory: number, userType: number, petType: number, userX: number, userY: number, userImage: string, userColor: number, roomId: number, chatType: number = 0, styleId: number = 0, links: string[] = null)
{
super(type);
this._userId = userId;
this._text = text;
this._chatType = chatType;
this._userName = userName;
this._userCategory = userCategory;
this._userType = userType;
this._petType = petType;
this._links = links;
this._userX = userX;
this._userY = userY;
this._userImage = userImage;
this._userColor = userColor;
this._roomId = roomId;
this._styleId = styleId;
}
public get userId(): number
{
return this._userId;
}
public get text(): string
{
return this._text;
}
public get chatType(): number
{
return this._chatType;
}
public get userName(): string
{
return this._userName;
}
public get userCategory(): number
{
return this._userCategory;
}
public get userType(): number
{
return this._userType;
}
public get petType(): number
{
return this._petType;
}
public get links(): string[]
{
return this._links;
}
public get userX(): number
{
return this._userX;
}
public get userY(): number
{
return this._userY;
}
public get userImage(): string
{
return this._userImage;
}
public get userColor(): number
{
return this._userColor;
}
public get roomId(): number
{
return this._roomId;
}
public get styleId(): number
{
return this._styleId;
}
}

View File

@ -1,34 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateCreditFurniEvent extends RoomWidgetUpdateEvent
{
public static CREDIT_FURNI_UPDATE: string = 'RWUCFE_CREDIT_FURNI_UPDATE';
private _objectId: number;
private _value: number;
private _furniType: string;
constructor(type: string, objectId: number, value: number, furniType: string)
{
super(type);
this._objectId = objectId;
this._value = value;
this._furniType = furniType;
}
public get objectId(): number
{
return this._objectId;
}
public get value(): number
{
return this._value;
}
public get furniType(): string
{
return this._furniType;
}
}

View File

@ -1,27 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateCustomStackHeightEvent extends RoomWidgetUpdateEvent
{
public static UPDATE_CUSTOM_STACK_HEIGHT: string = 'RWUCSHE_UPDATE_CUSTOM_STACK_HEIGHT';
private _objectId: number;
private _height: number;
constructor(objectId: number, height: number = 0)
{
super(RoomWidgetUpdateCustomStackHeightEvent.UPDATE_CUSTOM_STACK_HEIGHT);
this._objectId = objectId;
this._height = height;
}
public get objectId(): number
{
return this._objectId;
}
public get height(): number
{
return this._height;
}
}

View File

@ -1,20 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateDanceStatusEvent extends RoomWidgetUpdateEvent
{
public static UPDATE_DANCE: string = 'RWUDSE_UPDATE_DANCE';
private _isDancing: boolean;
constructor(isDancing: boolean)
{
super(RoomWidgetUpdateDanceStatusEvent.UPDATE_DANCE);
this._isDancing = isDancing;
}
public get isDancing(): boolean
{
return this._isDancing;
}
}

View File

@ -1,20 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateDecorateModeEvent extends RoomWidgetUpdateEvent
{
public static UPDATE_DECORATE: string = 'RWUDME_UPDATE_DECORATE';
private _isDecorating: boolean;
constructor(isDecorating: boolean)
{
super(RoomWidgetUpdateDecorateModeEvent.UPDATE_DECORATE);
this._isDecorating = isDecorating;
}
public get isDecorating(): boolean
{
return this._isDecorating;
}
}

View File

@ -1,50 +0,0 @@
import { RoomDimmerPreset } from './RoomDimmerPreset';
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateDimmerEvent extends RoomWidgetUpdateEvent
{
public static PRESETS: string = 'RWUDE_PRESETS';
public static HIDE: string = 'RWUDE_HIDE';
private _selectedPresetId: number = 0;
private _presets: RoomDimmerPreset[];
constructor(type: string)
{
super(type);
this._presets = [];
}
public get presetCount(): number
{
return this._presets.length;
}
public get presets(): RoomDimmerPreset[]
{
return this._presets;
}
public get selectedPresetId(): number
{
return this._selectedPresetId;
}
public set selectedPresetId(k: number)
{
this._selectedPresetId = k;
}
public setPresetValues(id: number, type: number, color: number, brightness: number): void
{
const preset = new RoomDimmerPreset(id, type, color, brightness);
this._presets[(id - 1)] = preset;
}
public getPresetNumber(id: number): RoomDimmerPreset
{
return this._presets[id];
}
}

View File

@ -1,48 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateDimmerStateEvent extends RoomWidgetUpdateEvent
{
public static DIMMER_STATE: string = 'RWUDSE_DIMMER_STATE';
private _state: number;
private _presetId: number;
private _effectId: number;
private _color: number;
private _brightness: number;
constructor(state: number, presetId: number, effectId: number, color: number, brightness: number)
{
super(RoomWidgetUpdateDimmerStateEvent.DIMMER_STATE);
this._state = state;
this._presetId = presetId;
this._effectId = effectId;
this._color = color;
this._brightness = brightness;
}
public get state(): number
{
return this._state;
}
public get presetId(): number
{
return this._presetId;
}
public get effectId(): number
{
return this._effectId;
}
public get color(): number
{
return this._color;
}
public get brightness(): number
{
return this._brightness;
}
}

View File

@ -1,28 +0,0 @@
import { IPhotoData } from './IPhotoData';
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateExternalImageEvent extends RoomWidgetUpdateEvent
{
public static UPDATE_EXTERNAL_IMAGE: string = 'RWUEIE_UPDATE_EXTERNAL_IMAGE';
private _objectId: number;
private _photoData: IPhotoData;
constructor(objectId: number, photoData: IPhotoData = null)
{
super(RoomWidgetUpdateExternalImageEvent.UPDATE_EXTERNAL_IMAGE);
this._objectId = objectId;
this._photoData = photoData;
}
public get objectId(): number
{
return this._objectId;
}
public get photoData(): IPhotoData
{
return this._photoData;
}
}

View File

@ -1,4 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateInfostandEvent extends RoomWidgetUpdateEvent
{}

View File

@ -1,41 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateMannequinEvent extends RoomWidgetUpdateEvent
{
public static MANNEQUIN_UPDATE: string = 'RWUME_MANNEQUIN_UPDATE';
private _objectId: number;
private _figure: string;
private _gender: string;
private _name: string;
constructor(type: string, objectId: number, figure: string, gender: string, name: string)
{
super(type);
this._objectId = objectId;
this._figure = figure;
this._gender = gender;
this._name = name;
}
public get objectId(): number
{
return this._objectId;
}
public get figure(): string
{
return this._figure;
}
public get gender(): string
{
return this._gender;
}
public get name(): string
{
return this._name;
}
}

View File

@ -1,116 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdatePresentDataEvent extends RoomWidgetUpdateEvent
{
public static PACKAGEINFO: string = 'RWUPDE_PACKAGEINFO';
public static CONTENTS: string = 'RWUPDE_CONTENTS';
public static CONTENTS_CLUB: string = 'RWUPDE_CONTENTS_CLUB';
public static CONTENTS_FLOOR: string = 'RWUPDE_CONTENTS_FLOOR';
public static CONTENTS_LANDSCAPE: string = 'RWUPDE_CONTENTS_LANDSCAPE';
public static CONTENTS_WALLPAPER: string = 'RWUPDE_CONTENTS_WALLPAPER';
public static CONTENTS_IMAGE: string = 'RWUPDE_CONTENTS_IMAGE';
private _objectId: number = -1;
private _classId: number = 0;
private _itemType: string = '';
private _giftMessage: string = '';
private _imageUrl: string = null;
private _isController: boolean;
private _purchaserName: string;
private _purchaserFigure: string;
private _placedItemId: number = -1;
private _placedItemType: string = '';
private _placedInRoom: boolean;
constructor(type: string, objectId: number, giftMessage: string, isOwnerOfFurniture: boolean = false, imageUrl: string = null, purchaserName: string = null, purchaserFigure: string = null)
{
super(type);
this._objectId = objectId;
this._giftMessage = giftMessage;
this._imageUrl = imageUrl;
this._isController = isOwnerOfFurniture;
this._purchaserName = purchaserName;
this._purchaserFigure = purchaserFigure;
}
public get objectId(): number
{
return this._objectId;
}
public get classId(): number
{
return this._classId;
}
public set classId(classId: number)
{
this._classId = classId;
}
public get itemType(): string
{
return this._itemType;
}
public set itemType(type: string)
{
this._itemType = type;
}
public get giftMessage(): string
{
return this._giftMessage;
}
public get imageUrl(): string
{
return this._imageUrl;
}
public get isController(): boolean
{
return this._isController;
}
public get purchaserName(): string
{
return this._purchaserName;
}
public get purchaserFigure(): string
{
return this._purchaserFigure;
}
public get placedItemId(): number
{
return this._placedItemId;
}
public set placedItemId(itemId: number)
{
this._placedItemId = itemId;
}
public get placedInRoom(): boolean
{
return this._placedInRoom;
}
public set placedInRoom(flag: boolean)
{
this._placedInRoom = flag;
}
public get placedItemType(): string
{
return this._placedItemType;
}
public set placedItemType(type: string)
{
this._placedItemType = type;
}
}

View File

@ -1,21 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateRoomEngineEvent extends RoomWidgetUpdateEvent
{
public static GAME_MODE: string = 'RWUREE_GAME_MODE';
public static NORMAL_MODE: string = 'RWUREE_NORMAL_MODE';
private _roomId: number = 0;
constructor(type: string, roomId: number)
{
super(type);
this._roomId = roomId;
}
public get roomId(): number
{
return this._roomId;
}
}

View File

@ -1,35 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateSongEvent extends RoomWidgetUpdateEvent
{
public static PLAYING_CHANGED: string = 'RWUSE_PLAYING_CHANGED';
public static DATA_RECEIVED: string = 'RWUSE_DATA_RECEIVED';
private _songId: number;
private _songName: string;
private _songAuthor: string;
constructor(type: string, songId: number, songName: string, songAuthor: string)
{
super(type);
this._songId = songId;
this._songName = songName;
this._songAuthor = songAuthor;
}
public get songId(): number
{
return this._songId;
}
public get songName(): string
{
return this._songName;
}
public get songAuthor(): string
{
return this._songAuthor;
}
}

View File

@ -1,48 +0,0 @@
import { RoomWidgetUpdateEvent } from './RoomWidgetUpdateEvent';
export class RoomWidgetUpdateTrophyEvent extends RoomWidgetUpdateEvent
{
public static TROPHY_UPDATE: string = 'RWUTE_TROPHY_UPDATE';
private _color: number;
private _name: string;
private _date: string;
private _message: string;
private _extra: number;
constructor(type: string, color: number, name: string, date: string, message: string, extra: number)
{
super(type);
this._color = color;
this._name = name;
this._date = date;
this._message = message;
this._extra = extra;
}
public get color(): number
{
return this._color;
}
public get name(): string
{
return this._name;
}
public get date(): string
{
return this._date;
}
public get message(): string
{
return this._message;
}
public get extra(): number
{
return this._extra;
}
}

Some files were not shown because too many files have changed in this diff Show More