From abd5828c1d5fdef4cb72ea100fc0a3b5e80e7982 Mon Sep 17 00:00:00 2001 From: Snaiker Date: Wed, 16 Mar 2022 18:31:18 +0000 Subject: [PATCH 1/3] Fix issue: room owner can see furni ids --- .../widgets/infostand/InfoStandWidgetFurniView.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx b/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx index 55def41f..9f9e43bd 100644 --- a/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx +++ b/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx @@ -33,6 +33,7 @@ export const InfoStandWidgetFurniView: FC = props const [ crackableHits, setCrackableHits ] = useState(0); const [ crackableTarget, setCrackableTarget ] = useState(0); const [ godMode, setGodMode ] = useState(false); + const [ canSeeFurniId, setCanSeeFurniId ] = useState(false); const [ groupName, setGroupName ] = useState(null); useEffect(() => @@ -49,6 +50,7 @@ export const InfoStandWidgetFurniView: FC = props let crackableHits = 0; let crackableTarget = 0; let godMode = false; + let canSeeFurniId = false; const isValidController = (furniData.roomControllerLevel >= RoomControllerLevel.GUEST); @@ -59,6 +61,11 @@ export const InfoStandWidgetFurniView: FC = props if(furniData.roomControllerLevel >= RoomControllerLevel.MODERATOR) godMode = true; } + + if(furniData.isAnyRoomController) + { + canSeeFurniId = true; + } if((((furniData.usagePolicy === RoomWidgetFurniInfoUsagePolicyEnum.EVERYBODY) || ((furniData.usagePolicy === RoomWidgetFurniInfoUsagePolicyEnum.CONTROLLER) && isValidController)) || ((furniData.extraParam === RoomWidgetEnumItemExtradataParameter.JUKEBOX) && isValidController)) || ((furniData.extraParam === RoomWidgetEnumItemExtradataParameter.USABLE_PRODUCT) && isValidController)) canUse = true; @@ -133,6 +140,7 @@ export const InfoStandWidgetFurniView: FC = props setCrackableHits(crackableHits); setCrackableTarget(crackableTarget); setGodMode(godMode); + setCanSeeFurniId(canSeeFurniId); setGroupName(null); }); @@ -312,7 +320,7 @@ export const InfoStandWidgetFurniView: FC = props { godMode && <>
- ID: { furniData.id } + { canSeeFurniId && ID: { furniData.id } } { (furniKeys.length > 0) && <>
From 6536b36514b76011967c34b9a85336388dc10a96 Mon Sep 17 00:00:00 2001 From: Layne Date: Wed, 16 Mar 2022 15:23:39 -0400 Subject: [PATCH 2/3] optional sounds notif/resp --- public/ui-config.json.example | 4 ++++ src/api/nitro/room/widgets/handlers/RoomWidgetChatHandler.ts | 4 +++- src/api/notification/NotificationUtilities.ts | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/ui-config.json.example b/public/ui-config.json.example index 5463c31e..3410db79 100644 --- a/public/ui-config.json.example +++ b/public/ui-config.json.example @@ -59,6 +59,10 @@ "catalog.buy": "habbo_club", "catalog.gifts": "club_gifts" }, + "respect.options": { + "enabled": false, + "sound": "sound_respect_received" + }, "currency.display.number.short": false, "currency.asset.icon.url": "${images.url}/wallet/%type%.png", "catalog.asset.url": "${image.library.url}catalogue", diff --git a/src/api/nitro/room/widgets/handlers/RoomWidgetChatHandler.ts b/src/api/nitro/room/widgets/handlers/RoomWidgetChatHandler.ts index 53ca74f2..80e20be9 100644 --- a/src/api/nitro/room/widgets/handlers/RoomWidgetChatHandler.ts +++ b/src/api/nitro/room/widgets/handlers/RoomWidgetChatHandler.ts @@ -1,5 +1,5 @@ import { AvatarFigurePartType, AvatarScaleType, AvatarSetType, IAvatarImageListener, INitroPoint, IVector3D, NitroEvent, NitroPoint, PetFigureData, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomSessionChatEvent, RoomWidgetEnum, SystemChatStyleEnum, TextureUtils, Vector3d } from '@nitrots/nitro-renderer'; -import { GetAvatarRenderManager, GetRoomEngine } from '../../../..'; +import { GetAvatarRenderManager, GetConfigurationManager, GetRoomEngine, PlaySound } from '../../../..'; import { LocalizeText } from '../../../../utils/LocalizeText'; import { RoomWidgetUpdateChatEvent, RoomWidgetUpdateEvent } from '../events'; import { RoomWidgetMessage } from '../messages'; @@ -64,6 +64,8 @@ export class RoomWidgetChatHandler extends RoomWidgetHandler implements IAvatarI { case RoomSessionChatEvent.CHAT_TYPE_RESPECT: text = LocalizeText('widgets.chatbubble.respect', [ 'username' ], [ username ]); + if(GetConfigurationManager().getValue('respect.options')['enabled']) + PlaySound(GetConfigurationManager().getValue('respect.options')['sound']) break; case RoomSessionChatEvent.CHAT_TYPE_PETRESPECT: text = LocalizeText('widget.chatbubble.petrespect', [ 'petname' ], [ username ]); diff --git a/src/api/notification/NotificationUtilities.ts b/src/api/notification/NotificationUtilities.ts index 45cc6311..067e7a1d 100644 --- a/src/api/notification/NotificationUtilities.ts +++ b/src/api/notification/NotificationUtilities.ts @@ -1,5 +1,5 @@ import { HabboWebTools, RoomEnterEffect } from '@nitrots/nitro-renderer'; -import { CreateLinkEvent, GetConfiguration, GetNitroInstance, LocalizeText } from '..'; +import { CreateLinkEvent, GetConfiguration, GetNitroInstance, LocalizeText, PlaySound } from '..'; import { NotificationAlertEvent, NotificationConfirmEvent } from '../../events'; import { NotificationBubbleEvent } from '../../events/notification-center/NotificationBubbleEvent'; import { DispatchUiEvent } from '../../hooks'; @@ -85,6 +85,8 @@ export class NotificationUtilities { this.simpleAlert(message, NotificationAlertType.EVENT, linkUrl, linkTitle, title, image); } + + if(options.get('sound')) PlaySound(options.get('sound')); } public static showSingleBubble(message: string, type: string, imageUrl: string = null, internalLink: string = null): void From 967811b84d52e3189d7d5eded0bae6129d25351c Mon Sep 17 00:00:00 2001 From: Layne Date: Wed, 16 Mar 2022 15:43:17 -0400 Subject: [PATCH 3/3] mod tools alert_only room mod --- src/components/mod-tools/views/room/ModToolsRoomView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/mod-tools/views/room/ModToolsRoomView.tsx b/src/components/mod-tools/views/room/ModToolsRoomView.tsx index 16f878d3..c8fd6e65 100644 --- a/src/components/mod-tools/views/room/ModToolsRoomView.tsx +++ b/src/components/mod-tools/views/room/ModToolsRoomView.tsx @@ -59,12 +59,13 @@ export const ModToolsRoomView: FC = props => if(message.trim().length === 0) return; SendMessageComposer(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_ALERT, message, '')); + SendMessageComposer(new ModerateRoomMessageComposer(roomId, lockRoom ? 1 : 0, changeRoomName ? 1 : 0, kickUsers ? 1 : 0)); return; case 'send_message': if(message.trim().length === 0) return; SendMessageComposer(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_MESSAGE, message, '')); - SendMessageComposer(new ModerateRoomMessageComposer(roomId, lockRoom ? 1 : 0, changeRoomName ? 1 : 0, kickUsers ? 1 : 0)) + SendMessageComposer(new ModerateRoomMessageComposer(roomId, lockRoom ? 1 : 0, changeRoomName ? 1 : 0, kickUsers ? 1 : 0)); return; } }, [ changeRoomName, kickUsers, lockRoom, message, roomId ]);