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 { WiredConditionBaseView } from './WiredConditionBaseView';
|
||||
import { WiredSourcesSelector } from '../WiredSourcesSelector';
|
||||
|
||||
export const WiredConditionActorIsOnFurniView: 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 > 0) return trigger.intData[0];
|
||||
@@ -29,25 +29,11 @@ export const WiredConditionActorIsOnFurniView: 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
|
||||
: WiredFurniType.STUFF_SELECTION_OPTION_NONE;
|
||||
const requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_BY_ID;
|
||||
|
||||
return (
|
||||
<WiredConditionBaseView
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 { WiredConditionBaseView } from './WiredConditionBaseView';
|
||||
@@ -8,7 +8,7 @@ import { WiredSourcesSelector } from '../WiredSourcesSelector';
|
||||
export const WiredConditionFurniHasFurniOnView: FC<{}> = props =>
|
||||
{
|
||||
const [ requireAll, setRequireAll ] = useState(-1);
|
||||
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[1];
|
||||
@@ -24,23 +24,9 @@ export const WiredConditionFurniHasFurniOnView: 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 (
|
||||
<WiredConditionBaseView
|
||||
|
||||
@@ -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 { WiredConditionBaseView } from './WiredConditionBaseView';
|
||||
@@ -8,7 +8,7 @@ import { WiredSourcesSelector } from '../WiredSourcesSelector';
|
||||
export const WiredConditionFurniHasNotFurniOnView: FC<{}> = props =>
|
||||
{
|
||||
const [ requireAll, setRequireAll ] = useState(-1);
|
||||
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[1];
|
||||
@@ -24,23 +24,9 @@ export const WiredConditionFurniHasNotFurniOnView: 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 (
|
||||
<WiredConditionBaseView
|
||||
|
||||
@@ -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 WiredConditionFurniIsOfTypeView: 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 WiredConditionFurniIsOfTypeView: 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_OR_BY_TYPE
|
||||
: WiredFurniType.STUFF_SELECTION_OPTION_NONE;
|
||||
const requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE;
|
||||
|
||||
return (
|
||||
<WiredConditionBaseView
|
||||
|
||||
@@ -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 { WiredConditionBaseView } from './WiredConditionBaseView';
|
||||
@@ -10,7 +10,7 @@ export const WiredConditionFurniMatchesSnapshotView: FC<{}> = props =>
|
||||
const [ stateFlag, setStateFlag ] = useState(0);
|
||||
const [ directionFlag, setDirectionFlag ] = useState(0);
|
||||
const [ positionFlag, setPositionFlag ] = useState(0);
|
||||
const { trigger = null, furniIds = [], setFurniIds = null, setIntParams = null } = useWired();
|
||||
const { trigger = null, setIntParams = null } = useWired();
|
||||
const [ furniSource, setFurniSource ] = useState<number>(() =>
|
||||
{
|
||||
if(trigger?.intData?.length > 3) return trigger.intData[3];
|
||||
@@ -28,23 +28,9 @@ export const WiredConditionFurniMatchesSnapshotView: 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 (
|
||||
<WiredConditionBaseView
|
||||
|
||||
Reference in New Issue
Block a user