mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
feat(infostand): gate Edit Furni button behind moderator permission
Mirrors the isModerator check already used by the toolbar furni-editor icon, so users without the moderator rank no longer see the button.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { CrackableDataType, CreateLinkEvent, FurnitureFloorUpdateEvent, GetRoomEngine, GetSoundManager, GroupInformationComposer, GroupInformationEvent, NowPlayingEvent, RoomControllerLevel, RoomObjectCategory, RoomObjectOperationType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, SongInfoReceivedEvent, StringDataType, UpdateFurniturePositionComposer } from '@nitrots/nitro-renderer';
|
import { CrackableDataType, CreateLinkEvent, FurnitureFloorUpdateEvent, GetRoomEngine, GetSessionDataManager, GetSoundManager, GroupInformationComposer, GroupInformationEvent, NowPlayingEvent, RoomControllerLevel, RoomObjectCategory, RoomObjectOperationType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, SongInfoReceivedEvent, StringDataType, UpdateFurniturePositionComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { FaCrosshairs, FaRulerVertical, FaTimes } from 'react-icons/fa';
|
import { FaCrosshairs, FaRulerVertical, FaTimes } from 'react-icons/fa';
|
||||||
import { GrFormNextLink, GrRotateLeft, GrRotateRight } from 'react-icons/gr';
|
import { GrFormNextLink, GrRotateLeft, GrRotateRight } from 'react-icons/gr';
|
||||||
@@ -585,6 +585,7 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
onClick={ () => setDropdownOpen(!dropdownOpen) }>
|
onClick={ () => setDropdownOpen(!dropdownOpen) }>
|
||||||
{ dropdownOpen ? `${LocalizeText('widget.furni.present.close')} Buildtools` : `${LocalizeText('navigator.roomsettings.doormode.open')} Buildtools` }
|
{ dropdownOpen ? `${LocalizeText('widget.furni.present.close')} Buildtools` : `${LocalizeText('navigator.roomsettings.doormode.open')} Buildtools` }
|
||||||
</button>
|
</button>
|
||||||
|
{ GetSessionDataManager().isModerator &&
|
||||||
<button
|
<button
|
||||||
className="w-full text-white text-xs bg-[#1e7295] hover:bg-[#1a617f] border border-[#ffffff33] rounded px-2 py-1 cursor-pointer transition-colors"
|
className="w-full text-white text-xs bg-[#1e7295] hover:bg-[#1a617f] border border-[#ffffff33] rounded px-2 py-1 cursor-pointer transition-colors"
|
||||||
onClick={ () =>
|
onClick={ () =>
|
||||||
@@ -597,7 +598,7 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
|
|||||||
if(typeId) window.dispatchEvent(new CustomEvent('furni-editor:open', { detail: { spriteId: typeId } }));
|
if(typeId) window.dispatchEvent(new CustomEvent('furni-editor:open', { detail: { spriteId: typeId } }));
|
||||||
} }>
|
} }>
|
||||||
Edit Furni
|
Edit Furni
|
||||||
</button>
|
</button> }
|
||||||
{ dropdownOpen &&
|
{ dropdownOpen &&
|
||||||
<div className="flex gap-[4px] w-full">
|
<div className="flex gap-[4px] w-full">
|
||||||
{ /* Left panel: position + rotation */ }
|
{ /* Left panel: position + rotation */ }
|
||||||
|
|||||||
Reference in New Issue
Block a user