mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
WIP preserve local changes before duckie merge
This commit is contained in:
@@ -148,6 +148,10 @@ export class Offer implements IPurchasableOffer
|
||||
|
||||
public get localizationName(): string
|
||||
{
|
||||
const furnitureProduct = this.product;
|
||||
|
||||
if(furnitureProduct?.furnitureData?.name?.length) return furnitureProduct.furnitureData.name;
|
||||
|
||||
const productData = GetProductDataForLocalization(this._localizationId);
|
||||
|
||||
if(productData) return productData.name;
|
||||
@@ -157,6 +161,10 @@ export class Offer implements IPurchasableOffer
|
||||
|
||||
public get localizationDescription(): string
|
||||
{
|
||||
const furnitureProduct = this.product;
|
||||
|
||||
if(furnitureProduct?.furnitureData?.description?.length) return furnitureProduct.furnitureData.description;
|
||||
|
||||
const productData = GetProductDataForLocalization(this._localizationId);
|
||||
|
||||
if(productData) return productData.description;
|
||||
|
||||
@@ -11,6 +11,11 @@ export interface IChatEntry
|
||||
chatType?: number;
|
||||
imageUrl?: string;
|
||||
color?: string;
|
||||
showTranslation?: boolean;
|
||||
originalMessage?: string;
|
||||
translatedMessage?: string;
|
||||
detectedLanguage?: string;
|
||||
targetLanguage?: string;
|
||||
roomId: number;
|
||||
timestamp: string;
|
||||
type: number;
|
||||
|
||||
@@ -48,6 +48,18 @@ export class MessengerThread
|
||||
return chat;
|
||||
}
|
||||
|
||||
public getChat(chatId: number): MessengerThreadChat
|
||||
{
|
||||
for(const group of this._groups)
|
||||
{
|
||||
const chat = group.chats.find(existingChat => (existingChat.id === chatId));
|
||||
|
||||
if(chat) return chat;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private pruneChats(): void
|
||||
{
|
||||
let totalChats = this._groups.reduce((total, current) => (total + current.chats.length), 0);
|
||||
|
||||
@@ -4,22 +4,49 @@ export class MessengerThreadChat
|
||||
public static ROOM_INVITE: number = 1;
|
||||
public static STATUS_NOTIFICATION: number = 2;
|
||||
public static SECURITY_NOTIFICATION: number = 3;
|
||||
private static CHAT_ID: number = 0;
|
||||
|
||||
private _id: number;
|
||||
private _type: number;
|
||||
private _senderId: number;
|
||||
private _message: string;
|
||||
private _secondsSinceSent: number;
|
||||
private _extraData: string;
|
||||
private _date: Date;
|
||||
private _showTranslation: boolean;
|
||||
private _originalMessage: string;
|
||||
private _translatedMessage: string;
|
||||
private _detectedLanguage: string;
|
||||
private _targetLanguage: string;
|
||||
|
||||
constructor(senderId: number, message: string, secondsSinceSent: number = 0, extraData: string = null, type: number = 0)
|
||||
{
|
||||
this._id = ++MessengerThreadChat.CHAT_ID;
|
||||
this._type = type;
|
||||
this._senderId = senderId;
|
||||
this._message = message;
|
||||
this._secondsSinceSent = secondsSinceSent;
|
||||
this._extraData = extraData;
|
||||
this._date = new Date();
|
||||
this._showTranslation = false;
|
||||
this._originalMessage = message;
|
||||
this._translatedMessage = '';
|
||||
this._detectedLanguage = '';
|
||||
this._targetLanguage = '';
|
||||
}
|
||||
|
||||
public setTranslation(originalMessage: string, translatedMessage: string, detectedLanguage: string, targetLanguage: string): void
|
||||
{
|
||||
this._showTranslation = true;
|
||||
this._originalMessage = originalMessage || this._message || '';
|
||||
this._translatedMessage = translatedMessage || this._originalMessage;
|
||||
this._detectedLanguage = detectedLanguage || '';
|
||||
this._targetLanguage = targetLanguage || '';
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get type(): number
|
||||
@@ -51,4 +78,29 @@ export class MessengerThreadChat
|
||||
{
|
||||
return this._date;
|
||||
}
|
||||
|
||||
public get showTranslation(): boolean
|
||||
{
|
||||
return this._showTranslation;
|
||||
}
|
||||
|
||||
public get originalMessage(): string
|
||||
{
|
||||
return this._originalMessage;
|
||||
}
|
||||
|
||||
public get translatedMessage(): string
|
||||
{
|
||||
return this._translatedMessage;
|
||||
}
|
||||
|
||||
public get detectedLanguage(): string
|
||||
{
|
||||
return this._detectedLanguage;
|
||||
}
|
||||
|
||||
public get targetLanguage(): string
|
||||
{
|
||||
return this._targetLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,12 @@ export class GroupItem
|
||||
this.setDescription();
|
||||
}
|
||||
|
||||
public refreshLocalization(): void
|
||||
{
|
||||
this.setName();
|
||||
this.setDescription();
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface INickIconItem
|
||||
{
|
||||
id: number;
|
||||
iconKey: string;
|
||||
displayName: string;
|
||||
points: number;
|
||||
pointsType: number;
|
||||
owned: boolean;
|
||||
active: boolean;
|
||||
}
|
||||
@@ -1,9 +1,15 @@
|
||||
export interface IPrefixItem
|
||||
{
|
||||
id: number;
|
||||
displayName?: string;
|
||||
text: string;
|
||||
color: string;
|
||||
icon: string;
|
||||
effect: string;
|
||||
font?: string;
|
||||
active: boolean;
|
||||
isCustom?: boolean;
|
||||
points?: number;
|
||||
pointsType?: number;
|
||||
catalogPrefixId?: number;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ export * from './FurnitureUtilities';
|
||||
export * from './GroupItem';
|
||||
export * from './IBotItem';
|
||||
export * from './IFurnitureItem';
|
||||
export * from './INickIconItem';
|
||||
export * from './IPetItem';
|
||||
export * from './IPrefixItem';
|
||||
export * from './IUnseenItemTracker';
|
||||
|
||||
@@ -12,6 +12,13 @@ export class AvatarInfoUser implements IAvatarInfo
|
||||
|
||||
public name: string = '';
|
||||
public motto: string = '';
|
||||
public nickIcon: string = '';
|
||||
public prefixText: string = '';
|
||||
public prefixColor: string = '';
|
||||
public prefixIcon: string = '';
|
||||
public prefixEffect: string = '';
|
||||
public prefixFont: string = '';
|
||||
public displayOrder: string = 'icon-prefix-name';
|
||||
public achievementScore: number = 0;
|
||||
public backgroundId: number = 0;
|
||||
public standId: number = 0;
|
||||
|
||||
@@ -32,17 +32,16 @@ export class AvatarInfoUtilities
|
||||
else
|
||||
{
|
||||
let furniData: IFurnitureData = null;
|
||||
|
||||
const typeId = roomObject.model.getValue<number>(RoomObjectVariable.FURNITURE_TYPE_ID);
|
||||
const className = roomObject.type;
|
||||
|
||||
if(category === RoomObjectCategory.FLOOR)
|
||||
{
|
||||
furniData = GetSessionDataManager().getFloorItemData(typeId);
|
||||
furniData = GetSessionDataManager().getFloorItemDataByName(className);
|
||||
}
|
||||
|
||||
else if(category === RoomObjectCategory.WALL)
|
||||
{
|
||||
furniData = GetSessionDataManager().getWallItemData(typeId);
|
||||
furniData = GetSessionDataManager().getWallItemDataByName(className);
|
||||
}
|
||||
|
||||
if(!furniData) break;
|
||||
@@ -102,18 +101,17 @@ export class AvatarInfoUtilities
|
||||
}
|
||||
else
|
||||
{
|
||||
const typeId = model.getValue<number>(RoomObjectVariable.FURNITURE_TYPE_ID);
|
||||
|
||||
let furnitureData: IFurnitureData = null;
|
||||
const className = roomObject.type;
|
||||
|
||||
if(category === RoomObjectCategory.FLOOR)
|
||||
{
|
||||
furnitureData = GetSessionDataManager().getFloorItemData(typeId);
|
||||
furnitureData = GetSessionDataManager().getFloorItemDataByName(className);
|
||||
}
|
||||
|
||||
else if(category === RoomObjectCategory.WALL)
|
||||
{
|
||||
furnitureData = GetSessionDataManager().getWallItemData(typeId);
|
||||
furnitureData = GetSessionDataManager().getWallItemDataByName(className);
|
||||
}
|
||||
|
||||
if(furnitureData)
|
||||
@@ -183,6 +181,13 @@ export class AvatarInfoUtilities
|
||||
userInfo.isSpectatorMode = roomSession.isSpectator;
|
||||
userInfo.name = userData.name;
|
||||
userInfo.motto = userData.custom;
|
||||
userInfo.nickIcon = userData.nickIcon;
|
||||
userInfo.prefixText = userData.prefixText;
|
||||
userInfo.prefixColor = userData.prefixColor;
|
||||
userInfo.prefixIcon = userData.prefixIcon;
|
||||
userInfo.prefixEffect = userData.prefixEffect;
|
||||
userInfo.prefixFont = userData.prefixFont;
|
||||
userInfo.displayOrder = userData.displayOrder;
|
||||
userInfo.backgroundId = userData.background;
|
||||
userInfo.standId = userData.stand;
|
||||
userInfo.overlayId = userData.overlay;
|
||||
|
||||
@@ -11,6 +11,16 @@ export class ChatBubbleMessage
|
||||
public prefixColor: string = '';
|
||||
public prefixIcon: string = '';
|
||||
public prefixEffect: string = '';
|
||||
public prefixFont: string = '';
|
||||
public nickIcon: string = '';
|
||||
public displayOrder: string = 'icon-prefix-name';
|
||||
public originalText: string = '';
|
||||
public originalFormattedText: string = '';
|
||||
public translatedText: string = '';
|
||||
public translatedFormattedText: string = '';
|
||||
public showTranslation: boolean = false;
|
||||
public translationDetectedLanguage: string = '';
|
||||
public translationTargetLanguage: string = '';
|
||||
|
||||
private _top: number = 0;
|
||||
private _left: number = 0;
|
||||
@@ -30,6 +40,8 @@ export class ChatBubbleMessage
|
||||
)
|
||||
{
|
||||
this.id = ++ChatBubbleMessage.BUBBLE_COUNTER;
|
||||
this.originalText = text;
|
||||
this.originalFormattedText = formattedText;
|
||||
}
|
||||
|
||||
public get top(): number
|
||||
|
||||
@@ -3,4 +3,5 @@ export class LocalStorageKeys
|
||||
public static CATALOG_PLACE_MULTIPLE_OBJECTS: string = 'catalogPlaceMultipleObjects';
|
||||
public static CATALOG_SKIP_PURCHASE_CONFIRMATION: string = 'catalogSkipPurchaseConfirmation';
|
||||
public static CHAT_WINDOW_ENABLED: string = 'chatWindowEnabled';
|
||||
public static CHAT_TRANSLATION_SETTINGS: string = 'chatTranslationSettings';
|
||||
}
|
||||
|
||||
@@ -1,11 +1,41 @@
|
||||
export const PRESET_PREFIX_EFFECTS: { id: string; label: string; icon: string }[] = [
|
||||
{ id: '', label: 'None', icon: '—' },
|
||||
{ id: 'glow', label: 'Glow', icon: '✨' },
|
||||
{ id: 'shadow', label: 'Shadow', icon: '🌑' },
|
||||
{ id: 'italic', label: 'Italic', icon: '𝑰' },
|
||||
{ id: 'outline', label: 'Outline', icon: '🔲' },
|
||||
{ id: 'pulse', label: 'Pulse', icon: '💫' },
|
||||
{ id: 'bold-glow', label: 'Neon', icon: '💡' },
|
||||
export type PrefixFontTier = 'basic' | 'premium';
|
||||
export type PrefixFontOption = {
|
||||
id: string;
|
||||
label: string;
|
||||
family: string;
|
||||
tier: PrefixFontTier;
|
||||
};
|
||||
|
||||
export const PRESET_PREFIX_FONTS: PrefixFontOption[] = [
|
||||
{ id: '', label: 'Default', family: 'Ubuntu, sans-serif', tier: 'basic' },
|
||||
{ id: 'pixel', label: 'Pixelify Sans', family: '"Pixelify Sans", cursive', tier: 'premium' },
|
||||
{ id: 'cherry', label: 'Cherry Bomb One', family: '"Cherry Bomb One", cursive', tier: 'premium' },
|
||||
{ id: 'vampiro', label: 'Vampiro One', family: '"Vampiro One", cursive', tier: 'premium' }
|
||||
];
|
||||
|
||||
export const PRESET_PREFIX_EFFECTS: { id: string; label: string; icon: string; tier: 'basic' | 'premium' }[] = [
|
||||
{ id: '', label: 'None', icon: '-', tier: 'basic' },
|
||||
{ id: 'glow', label: 'Glow', icon: '*', tier: 'basic' },
|
||||
{ id: 'shadow', label: 'Shadow', icon: 'S', tier: 'basic' },
|
||||
{ id: 'italic', label: 'Italic', icon: 'I', tier: 'basic' },
|
||||
{ id: 'outline', label: 'Outline', icon: 'O', tier: 'basic' },
|
||||
{ id: 'underline', label: 'Underline', icon: 'U', tier: 'basic' },
|
||||
{ id: 'pulse', label: 'Pulse', icon: 'P', tier: 'basic' },
|
||||
{ id: 'bounce', label: 'Bounce', icon: 'B', tier: 'basic' },
|
||||
{ id: 'wave', label: 'Wave', icon: 'W', tier: 'basic' },
|
||||
{ id: 'shake', label: 'Shake', icon: '!', tier: 'basic' },
|
||||
{ id: 'discord-neon', label: 'Discord Neon', icon: 'D', tier: 'premium' },
|
||||
{ id: 'cartoon', label: 'Cartoon', icon: 'C', tier: 'premium' },
|
||||
{ id: 'toon', label: 'Toon', icon: 'T', tier: 'premium' },
|
||||
{ id: 'pop', label: 'Pop', icon: 'P+', tier: 'premium' },
|
||||
{ id: 'bold-glow', label: 'Neon', icon: 'N', tier: 'premium' },
|
||||
{ id: 'rainbow', label: 'Rainbow', icon: 'R', tier: 'premium' },
|
||||
{ id: 'frost', label: 'Frost', icon: 'F', tier: 'premium' },
|
||||
{ id: 'gold', label: 'Gold Shine', icon: 'G', tier: 'premium' },
|
||||
{ id: 'glitch', label: 'Glitch', icon: 'X', tier: 'premium' },
|
||||
{ id: 'fire', label: 'Fire', icon: 'H', tier: 'premium' },
|
||||
{ id: 'matrix', label: 'Matrix', icon: 'M', tier: 'premium' },
|
||||
{ id: 'sparkle', label: 'Sparkle', icon: '+', tier: 'premium' }
|
||||
];
|
||||
|
||||
export const parsePrefixColors = (text: string, colorStr: string): string[] =>
|
||||
@@ -16,6 +46,15 @@ export const parsePrefixColors = (text: string, colorStr: string): string[] =>
|
||||
return [ ...text ].map((_, i) => colors[Math.min(i, colors.length - 1)]);
|
||||
};
|
||||
|
||||
export const getPrefixFontStyle = (font: string): Record<string, string> =>
|
||||
{
|
||||
const option = PRESET_PREFIX_FONTS.find(entry => entry.id === font);
|
||||
|
||||
if(!option || !option.id.length) return {};
|
||||
|
||||
return { fontFamily: option.family };
|
||||
};
|
||||
|
||||
export const getPrefixEffectStyle = (effect: string, color?: string): Record<string, string | number> =>
|
||||
{
|
||||
const baseColor = color || '#FFFFFF';
|
||||
@@ -33,13 +72,95 @@ export const getPrefixEffectStyle = (effect: string, color?: string): Record<str
|
||||
WebkitTextStroke: '0.5px rgba(0,0,0,0.6)',
|
||||
textShadow: '1px 1px 0 rgba(0,0,0,0.3), -1px -1px 0 rgba(0,0,0,0.3), 1px -1px 0 rgba(0,0,0,0.3), -1px 1px 0 rgba(0,0,0,0.3)'
|
||||
};
|
||||
case 'underline':
|
||||
return {
|
||||
textDecoration: 'underline',
|
||||
textDecorationThickness: '2px',
|
||||
textUnderlineOffset: '2px'
|
||||
};
|
||||
case 'pulse':
|
||||
return { animation: 'prefix-pulse 1.5s ease-in-out infinite' };
|
||||
case 'bounce':
|
||||
return {
|
||||
animation: 'prefix-bounce 1.2s ease-in-out infinite',
|
||||
display: 'inline-block'
|
||||
};
|
||||
case 'wave':
|
||||
return {
|
||||
animation: 'prefix-wave 1.6s ease-in-out infinite',
|
||||
display: 'inline-block',
|
||||
transformOrigin: 'center bottom'
|
||||
};
|
||||
case 'shake':
|
||||
return {
|
||||
animation: 'prefix-shake 0.9s ease-in-out infinite',
|
||||
display: 'inline-block'
|
||||
};
|
||||
case 'discord-neon':
|
||||
return {
|
||||
textShadow: `0 0 5px ${ baseColor }, 0 0 10px ${ baseColor }, 0 0 18px ${ baseColor }90`,
|
||||
fontWeight: 900,
|
||||
letterSpacing: '0.2px'
|
||||
};
|
||||
case 'cartoon':
|
||||
return {
|
||||
WebkitTextStroke: '1px rgba(0,0,0,0.75)',
|
||||
textShadow: '2px 2px 0 rgba(0,0,0,0.55)',
|
||||
fontWeight: 900
|
||||
};
|
||||
case 'toon':
|
||||
return {
|
||||
WebkitTextStroke: '0.8px rgba(0,0,0,0.65)',
|
||||
textShadow: '1px 2px 0 rgba(0,0,0,0.45)',
|
||||
fontWeight: 900,
|
||||
transform: 'skew(-4deg)'
|
||||
};
|
||||
case 'pop':
|
||||
return {
|
||||
textShadow: '0 2px 0 rgba(0,0,0,0.28), 0 4px 8px rgba(0,0,0,0.2)',
|
||||
fontWeight: 900,
|
||||
letterSpacing: '0.3px'
|
||||
};
|
||||
case 'bold-glow':
|
||||
return {
|
||||
textShadow: `0 0 4px ${ baseColor }, 0 0 8px ${ baseColor }, 0 0 16px ${ baseColor }60`,
|
||||
fontWeight: 900
|
||||
};
|
||||
case 'rainbow':
|
||||
return {
|
||||
animation: 'prefix-rainbow 2.6s linear infinite',
|
||||
textShadow: '0 0 8px rgba(255,255,255,0.35)'
|
||||
};
|
||||
case 'frost':
|
||||
return {
|
||||
textShadow: '0 0 4px rgba(255,255,255,0.75), 0 0 10px rgba(125,211,252,0.45)',
|
||||
filter: 'drop-shadow(0 0 2px rgba(191,219,254,0.75))'
|
||||
};
|
||||
case 'gold':
|
||||
return {
|
||||
animation: 'prefix-gold 2s ease-in-out infinite',
|
||||
textShadow: '0 0 6px rgba(255,215,0,0.45), 0 0 14px rgba(255,193,7,0.35)'
|
||||
};
|
||||
case 'glitch':
|
||||
return {
|
||||
animation: 'prefix-glitch 0.8s steps(2, end) infinite',
|
||||
textShadow: '-1px 0 rgba(255,0,102,0.75), 1px 0 rgba(0,255,255,0.75)'
|
||||
};
|
||||
case 'fire':
|
||||
return {
|
||||
animation: 'prefix-fire 1.1s ease-in-out infinite',
|
||||
textShadow: '0 0 5px rgba(255,120,0,0.7), 0 -1px 8px rgba(255,200,0,0.55), 0 -2px 12px rgba(255,60,0,0.45)'
|
||||
};
|
||||
case 'matrix':
|
||||
return {
|
||||
animation: 'prefix-matrix 1.8s linear infinite',
|
||||
textShadow: '0 0 6px rgba(57,255,20,0.65), 0 0 12px rgba(57,255,20,0.35)'
|
||||
};
|
||||
case 'sparkle':
|
||||
return {
|
||||
animation: 'prefix-sparkle 1.4s ease-in-out infinite',
|
||||
textShadow: `0 0 4px ${ baseColor }, 0 0 10px ${ baseColor }80, 0 0 16px rgba(255,255,255,0.45)`
|
||||
};
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
@@ -50,4 +171,57 @@ export const PREFIX_EFFECT_KEYFRAMES = `
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
@keyframes prefix-bounce {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-2px); }
|
||||
}
|
||||
|
||||
@keyframes prefix-wave {
|
||||
0%, 100% { transform: rotate(0deg); }
|
||||
25% { transform: rotate(-5deg); }
|
||||
75% { transform: rotate(5deg); }
|
||||
}
|
||||
|
||||
@keyframes prefix-shake {
|
||||
0%, 100% { transform: translateX(0); }
|
||||
20% { transform: translateX(-1px); }
|
||||
40% { transform: translateX(1px); }
|
||||
60% { transform: translateX(-1px); }
|
||||
80% { transform: translateX(1px); }
|
||||
}
|
||||
|
||||
@keyframes prefix-rainbow {
|
||||
0% { filter: hue-rotate(0deg); }
|
||||
100% { filter: hue-rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes prefix-gold {
|
||||
0%, 100% { filter: brightness(1); }
|
||||
50% { filter: brightness(1.25) saturate(1.2); }
|
||||
}
|
||||
|
||||
@keyframes prefix-glitch {
|
||||
0%, 100% { transform: translate(0, 0); }
|
||||
20% { transform: translate(-1px, 0); }
|
||||
40% { transform: translate(1px, 0); }
|
||||
60% { transform: translate(-1px, 1px); }
|
||||
80% { transform: translate(1px, -1px); }
|
||||
}
|
||||
|
||||
@keyframes prefix-fire {
|
||||
0%, 100% { transform: translateY(0); filter: brightness(1); }
|
||||
50% { transform: translateY(-1px); filter: brightness(1.15); }
|
||||
}
|
||||
|
||||
@keyframes prefix-matrix {
|
||||
0% { opacity: 0.85; letter-spacing: 0; }
|
||||
50% { opacity: 1; letter-spacing: 0.4px; }
|
||||
100% { opacity: 0.85; letter-spacing: 0; }
|
||||
}
|
||||
|
||||
@keyframes prefix-sparkle {
|
||||
0%, 100% { opacity: 1; filter: brightness(1); }
|
||||
50% { opacity: 0.92; filter: brightness(1.35); }
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -10,6 +10,10 @@ export class WiredSelectionVisualizer
|
||||
lineColor: [ 0.45, 0.78, 1 ],
|
||||
color: [ 0.20, 0.52, 0.95 ]
|
||||
});
|
||||
private static _variableHighlightShader: WiredFilter = new WiredFilter({
|
||||
lineColor: [ 0.52, 0.92, 1 ],
|
||||
color: [ 0.20, 0.70, 1 ]
|
||||
});
|
||||
|
||||
public static show(furniId: number): void
|
||||
{
|
||||
@@ -73,12 +77,37 @@ export class WiredSelectionVisualizer
|
||||
|
||||
if(roomId < 0) return;
|
||||
|
||||
const roomObjects = roomEngine.getRoomObjects(roomId, RoomObjectCategory.FLOOR);
|
||||
const roomObjects = [
|
||||
...roomEngine.getRoomObjects(roomId, RoomObjectCategory.FLOOR),
|
||||
...roomEngine.getRoomObjects(roomId, RoomObjectCategory.WALL),
|
||||
...roomEngine.getRoomObjects(roomId, RoomObjectCategory.UNIT)
|
||||
];
|
||||
|
||||
for(const roomObject of roomObjects)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._selectionShader);
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._secondarySelectionShader);
|
||||
WiredSelectionVisualizer.clearSelectionShader(roomObject, WiredSelectionVisualizer._variableHighlightShader);
|
||||
}
|
||||
}
|
||||
|
||||
public static applyVariableHighlightToObjects(objects: Array<{ category: number; objectId: number; }>): void
|
||||
{
|
||||
for(const object of objects)
|
||||
{
|
||||
WiredSelectionVisualizer.applySelectionShader(
|
||||
WiredSelectionVisualizer.getRoomObjectByCategory(object.objectId, object.category),
|
||||
WiredSelectionVisualizer._variableHighlightShader);
|
||||
}
|
||||
}
|
||||
|
||||
public static clearVariableHighlightFromObjects(objects: Array<{ category: number; objectId: number; }>): void
|
||||
{
|
||||
for(const object of objects)
|
||||
{
|
||||
WiredSelectionVisualizer.clearSelectionShader(
|
||||
WiredSelectionVisualizer.getRoomObjectByCategory(object.objectId, object.category),
|
||||
WiredSelectionVisualizer._variableHighlightShader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +118,13 @@ export class WiredSelectionVisualizer
|
||||
return roomEngine.getRoomObject(roomEngine.activeRoomId, objectId, RoomObjectCategory.FLOOR);
|
||||
}
|
||||
|
||||
private static getRoomObjectByCategory(objectId: number, category: number): IRoomObject
|
||||
{
|
||||
const roomEngine = GetRoomEngine();
|
||||
|
||||
return roomEngine.getRoomObject(roomEngine.activeRoomId, objectId, category);
|
||||
}
|
||||
|
||||
private static applySelectionShader(roomObject: IRoomObject, filter: WiredFilter): void
|
||||
{
|
||||
if(!roomObject) return;
|
||||
|
||||
Reference in New Issue
Block a user