mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
feat(wired): update source-aware furni and signal UI
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { WiredFurniType, WiredSelectionVisualizer } from '../../../../api';
|
||||
import { WiredFurniType } from '../../../../api';
|
||||
import { useWired } from '../../../../hooks';
|
||||
import { WiredActionBaseView } from './WiredActionBaseView';
|
||||
import { WiredSourcesSelector } from '../WiredSourcesSelector';
|
||||
|
||||
export const WiredActionTeleportView: FC<{}> = props =>
|
||||
{
|
||||
const { trigger = null, furniIds = [], setFurniIds = null, setIntParams = null } = useWired();
|
||||
const { trigger = null, setIntParams = null } = useWired();
|
||||
|
||||
const [ furniSource, setFurniSource ] = useState<number>(() =>
|
||||
{
|
||||
@@ -31,25 +31,11 @@ export const WiredActionTeleportView: FC<{}> = props =>
|
||||
else setUserSource(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, userSource ]);
|
||||
|
||||
const requiresFurni = (furniSource === 100)
|
||||
? WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT
|
||||
: WiredFurniType.STUFF_SELECTION_OPTION_NONE;
|
||||
const requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT;
|
||||
|
||||
return (
|
||||
<WiredActionBaseView
|
||||
|
||||
Reference in New Issue
Block a user