feat(wired): update source-aware furni and signal UI

This commit is contained in:
Lorenzune
2026-03-16 15:12:42 +01:00
parent ba0208c654
commit 31d3dfea44
23 changed files with 339 additions and 516 deletions
@@ -1,5 +1,5 @@
import { FC, useEffect, useState } from 'react';
import { LocalizeText, WiredFurniType, WiredSelectionVisualizer } from '../../../../api';
import { LocalizeText, WiredFurniType } from '../../../../api';
import { Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { NitroInput } from '../../../../layout';
@@ -9,7 +9,7 @@ import { WiredSourcesSelector } from '../WiredSourcesSelector';
export const WiredActionBotTeleportView: FC<{}> = props =>
{
const [ botName, setBotName ] = useState('');
const { trigger = null, furniIds = [], setFurniIds = null, setStringParam = null, setIntParams = null } = useWired();
const { trigger = null, setStringParam = null, setIntParams = null } = useWired();
const [ furniSource, setFurniSource ] = useState<number>(() =>
{
@@ -33,23 +33,9 @@ export const WiredActionBotTeleportView: FC<{}> = props =>
else setFurniSource((trigger.selectedItems?.length ?? 0) > 0 ? 100 : 0);
}, [ trigger ]);
const onChangeFurniSource = (next: number) =>
{
if(furniIds.length && setFurniIds)
{
setFurniIds(prev =>
{
if(prev && prev.length) WiredSelectionVisualizer.clearSelectionShaderFromFurni(prev);
return [];
});
}
const onChangeFurniSource = (next: number) => setFurniSource(next);
setFurniSource(next);
};
const requiresFurni = (furniSource === 100)
? WiredFurniType.STUFF_SELECTION_OPTION_BY_ID
: WiredFurniType.STUFF_SELECTION_OPTION_NONE;
const requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_BY_ID;
return (
<WiredActionBaseView