mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Merge pull request #218 from hotellidev/item-descriptions
Add furni description and configuration options
This commit is contained in:
@@ -15,6 +15,9 @@
|
|||||||
"camera.publish.disabled": false,
|
"camera.publish.disabled": false,
|
||||||
"hc.disabled": false,
|
"hc.disabled": false,
|
||||||
"badge.descriptions.enabled": true,
|
"badge.descriptions.enabled": true,
|
||||||
|
"furni.descriptions.enabled": true,
|
||||||
|
"furni.location.enabled": true,
|
||||||
|
"furni.location.require.access": true,
|
||||||
"motto.max.length": 38,
|
"motto.max.length": 38,
|
||||||
"bot.name.max.length": 15,
|
"bot.name.max.length": 15,
|
||||||
"pet.package.name.max.length": 15,
|
"pet.package.name.max.length": 15,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { CrackableDataType, CreateLinkEvent, FurnitureFloorUpdateEvent, GetRoomE
|
|||||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { FaCrosshairs, FaTimes } from 'react-icons/fa';
|
import { FaCrosshairs, FaTimes } from 'react-icons/fa';
|
||||||
import { GrFormNextLink, GrRotateLeft, GrRotateRight } from 'react-icons/gr';
|
import { GrFormNextLink, GrRotateLeft, GrRotateRight } from 'react-icons/gr';
|
||||||
import { AvatarInfoFurni, GetGroupInformation, LocalizeText, SendMessageComposer } from '../../../../../api';
|
import { AvatarInfoFurni, GetGroupInformation, LocalizeText, SendMessageComposer, GetConfigurationValue } from '../../../../../api';
|
||||||
import { Button, Column, Flex, LayoutBadgeImageView, LayoutCurrencyIcon, LayoutLimitedEditionCompactPlateView, LayoutRarityLevelView, LayoutRoomObjectImageView, Text, UserProfileIconView } from '../../../../../common';
|
import { Button, Column, Flex, LayoutBadgeImageView, LayoutCurrencyIcon, LayoutLimitedEditionCompactPlateView, LayoutRarityLevelView, LayoutRoomObjectImageView, Text, UserProfileIconView } from '../../../../../common';
|
||||||
import { useHasPermission, useMessageEvent, useNitroEvent, useRareValues, useRoom, useWiredTools } from '../../../../../hooks';
|
import { useHasPermission, useMessageEvent, useNitroEvent, useRareValues, useRoom, useWiredTools } from '../../../../../hooks';
|
||||||
import { NitroInput } from '../../../../../layout';
|
import { NitroInput } from '../../../../../layout';
|
||||||
@@ -76,7 +76,9 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
const isModerator = useHasPermission('acc_anyroomowner');
|
const isModerator = useHasPermission('acc_anyroomowner');
|
||||||
const { getValue: getRareValue } = useRareValues();
|
const { getValue: getRareValue } = useRareValues();
|
||||||
const rareValue = useMemo(() => (avatarInfo ? getRareValue(avatarInfo.spriteId) : null), [ avatarInfo, getRareValue ]);
|
const rareValue = useMemo(() => (avatarInfo ? getRareValue(avatarInfo.spriteId) : null), [ avatarInfo, getRareValue ]);
|
||||||
|
const descriptionsEnabled = GetConfigurationValue<boolean>('furni.descriptions.enabled', true);
|
||||||
|
const itemLocationEnabled = GetConfigurationValue<boolean>('furni.location.enabled', true);
|
||||||
|
const itemLocationRequireAccess = GetConfigurationValue<boolean>('furni.location.require.access', true);
|
||||||
const [ pickupMode, setPickupMode ] = useState(0);
|
const [ pickupMode, setPickupMode ] = useState(0);
|
||||||
const [ canMove, setCanMove ] = useState(false);
|
const [ canMove, setCanMove ] = useState(false);
|
||||||
const [ canRotate, setCanRotate ] = useState(false);
|
const [ canRotate, setCanRotate ] = useState(false);
|
||||||
@@ -214,7 +216,6 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
{
|
{
|
||||||
canMove = true;
|
canMove = true;
|
||||||
canRotate = !avatarInfo.isWallItem;
|
canRotate = !avatarInfo.isWallItem;
|
||||||
|
|
||||||
if(avatarInfo.roomControllerLevel >= RoomControllerLevel.MODERATOR) godMode = true;
|
if(avatarInfo.roomControllerLevel >= RoomControllerLevel.MODERATOR) godMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,6 +553,11 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
<hr className="m-0 bg-[#0003] border-0 opacity-[.5] h-px" />
|
<hr className="m-0 bg-[#0003] border-0 opacity-[.5] h-px" />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
{ (avatarInfo.description && descriptionsEnabled) &&
|
||||||
|
<Column gap={ 1 }>
|
||||||
|
<Text fullWidth wrap textBreak variant="white" small>{ avatarInfo.description }</Text>
|
||||||
|
<hr className="m-0 bg-[#0003] border-0 opacity-[.5] h-px" />
|
||||||
|
</Column> }
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
{ showOwnerProfileIcon && <UserProfileIconView userId={ avatarInfo.ownerId } /> }
|
{ showOwnerProfileIcon && <UserProfileIconView userId={ avatarInfo.ownerId } /> }
|
||||||
@@ -602,7 +608,7 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
<Text underline variant="white">{ groupName }</Text>
|
<Text underline variant="white">{ groupName }</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</> }
|
</> }
|
||||||
{ (itemLocation.x > -1) &&
|
{ ((itemLocation.x > -1) && itemLocationEnabled && (!itemLocationRequireAccess || canMove)) &&
|
||||||
<>
|
<>
|
||||||
<hr className="m-0 bg-[#0003] border-0 opacity-[.5] h-px" />
|
<hr className="m-0 bg-[#0003] border-0 opacity-[.5] h-px" />
|
||||||
<div className="flex items-center gap-1 min-w-0">
|
<div className="flex items-center gap-1 min-w-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user