From 9eda85fde18c672c605651165bda0c0fb33edc58 Mon Sep 17 00:00:00 2001 From: duckietm Date: Tue, 24 Feb 2026 08:42:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20Added=20the=20Coords=20/=20Heigh?= =?UTF-8?q?t=20to=20the=20infostand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infostand/InfoStandWidgetFurniView.tsx | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/room/widgets/avatar-info/infostand/InfoStandWidgetFurniView.tsx b/src/components/room/widgets/avatar-info/infostand/InfoStandWidgetFurniView.tsx index 3cda98e..d60e3c2 100644 --- a/src/components/room/widgets/avatar-info/infostand/InfoStandWidgetFurniView.tsx +++ b/src/components/room/widgets/avatar-info/infostand/InfoStandWidgetFurniView.tsx @@ -1,6 +1,6 @@ -import { CrackableDataType, CreateLinkEvent, GetRoomEngine, GetSoundManager, GroupInformationComposer, GroupInformationEvent, NowPlayingEvent, RoomControllerLevel, RoomObjectCategory, RoomObjectOperationType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, SongInfoReceivedEvent, StringDataType } from '@nitrots/nitro-renderer'; +import { CrackableDataType, CreateLinkEvent, FurnitureFloorUpdateEvent, GetRoomEngine, GetSoundManager, GroupInformationComposer, GroupInformationEvent, NowPlayingEvent, RoomControllerLevel, RoomObjectCategory, RoomObjectOperationType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, SongInfoReceivedEvent, StringDataType } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; -import { FaTimes } from 'react-icons/fa'; +import { FaCrosshairs, FaRulerVertical, FaTimes } from 'react-icons/fa'; import { AvatarInfoFurni, GetGroupInformation, LocalizeText, SendMessageComposer } from '../../../../../api'; import { Button, Column, Flex, LayoutBadgeImageView, LayoutLimitedEditionCompactPlateView, LayoutRarityLevelView, LayoutRoomObjectImageView, Text, UserProfileIconView } from '../../../../../common'; import { useMessageEvent, useNitroEvent, useRoom } from '../../../../../hooks'; @@ -40,6 +40,7 @@ export const InfoStandWidgetFurniView: FC = props const [ songId, setSongId ] = useState(-1); const [ songName, setSongName ] = useState(''); const [ songCreator, setSongCreator ] = useState(''); + const [ itemLocation, setItemLocation ] = useState<{ x: number; y: number; z: number }>({ x: -1, y: -1, z: -1 }); useNitroEvent(NowPlayingEvent.NPE_SONG_CHANGED, event => { @@ -77,6 +78,10 @@ export const InfoStandWidgetFurniView: FC = props let furniIsSongDisk = false; let furniSongId = -1; + const roomObjForLocation = GetRoomEngine().getRoomObject(roomSession.roomId, avatarInfo.id, avatarInfo.isWallItem ? RoomObjectCategory.WALL : RoomObjectCategory.FLOOR); + const location = roomObjForLocation?.getLocation(); + if(location) setItemLocation({ x: location.x, y: location.y, z: location.z }); + const isValidController = (avatarInfo.roomControllerLevel >= RoomControllerLevel.GUEST); if(isValidController || avatarInfo.isOwner || avatarInfo.isRoomOwner || avatarInfo.isAnyRoomController) @@ -205,6 +210,16 @@ export const InfoStandWidgetFurniView: FC = props setGroupName(parser.title); }); + useMessageEvent(FurnitureFloorUpdateEvent, event => + { + const parser = event.getParser(); + const item = parser.item; + + if(!avatarInfo || item.itemId !== avatarInfo.id) return; + + setItemLocation({ x: item.x, y: item.y, z: item.z }); + }); + useEffect(() => { const songInfo = GetSoundManager().musicController.getSongInfo(songId); @@ -408,6 +423,18 @@ export const InfoStandWidgetFurniView: FC = props { groupName } } + { (itemLocation.x > -1) && + <> +
+
+ + X: { itemLocation.x } ยท Y: { itemLocation.y } +
+
+ + { LocalizeText('stack.magic.tile.height.label') }: { itemLocation.z < 0.01 ? 0 : itemLocation.z } +
+ } { godMode && <>