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

This commit is contained in:
Lorenzune
2026-03-16 15:12:42 +01:00
parent 18cd47a574
commit f437db2fae
23 changed files with 339 additions and 516 deletions
@@ -1,12 +1,12 @@
import { FC, useEffect, useState } from 'react';
import { WiredFurniType, WiredSelectionVisualizer } from '../../../../api';
import { WiredFurniType } from '../../../../api';
import { useWired } from '../../../../hooks';
import { WiredConditionBaseView } from './WiredConditionBaseView';
import { WiredSourcesSelector } from '../WiredSourcesSelector';
export const WiredConditionFurniHasAvatarOnView: FC<{}> = props =>
{
const { trigger = null, furniIds = [], setFurniIds = null, setIntParams = null } = useWired();
const { trigger = null, setIntParams = null } = useWired();
const [ furniSource, setFurniSource ] = useState<number>(() =>
{
if(trigger?.intData?.length >= 1) return trigger.intData[0];
@@ -20,25 +20,11 @@ export const WiredConditionFurniHasAvatarOnView: 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 [];
});
}
setFurniSource(next);
};
const onChangeFurniSource = (next: number) => setFurniSource(next);
const save = () => setIntParams([ furniSource ]);
const requiresFurni = (furniSource === 100)
? WiredFurniType.STUFF_SELECTION_OPTION_BY_ID
: WiredFurniType.STUFF_SELECTION_OPTION_NONE;
const requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_BY_ID;
return (
<WiredConditionBaseView