mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
feat(wired-ui): expand advanced wired editors
This commit is contained in:
@@ -46,6 +46,7 @@ export const WiredConditionCounterTimeMatchesView: FC<{}> = () =>
|
||||
});
|
||||
const [ minutes, setMinutes ] = useState(0);
|
||||
const [ halfSeconds, setHalfSeconds ] = useState(0);
|
||||
const [ quantifier, setQuantifier ] = useState(0);
|
||||
|
||||
const secondsLabel = useMemo(() => formatSeconds(halfSeconds), [ halfSeconds ]);
|
||||
|
||||
@@ -55,7 +56,8 @@ export const WiredConditionCounterTimeMatchesView: FC<{}> = () =>
|
||||
normalizeComparison(comparison),
|
||||
normalizeMinutes(minutes),
|
||||
normalizeHalfSeconds(halfSeconds),
|
||||
furniSource
|
||||
furniSource,
|
||||
quantifier
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -67,6 +69,7 @@ export const WiredConditionCounterTimeMatchesView: FC<{}> = () =>
|
||||
setMinutes((trigger.intData.length > 1) ? normalizeMinutes(trigger.intData[1]) : 0);
|
||||
setHalfSeconds((trigger.intData.length > 2) ? normalizeHalfSeconds(trigger.intData[2]) : 0);
|
||||
setFurniSource((trigger.intData.length > 3) ? trigger.intData[3] : ((trigger.selectedItems?.length ?? 0) > 0 ? 100 : 0));
|
||||
setQuantifier((trigger.intData.length > 4 && trigger.intData[4] === 1) ? 1 : 0);
|
||||
}, [ trigger ]);
|
||||
|
||||
useEffect(() =>
|
||||
@@ -86,7 +89,20 @@ export const WiredConditionCounterTimeMatchesView: FC<{}> = () =>
|
||||
hasSpecialInput={ true }
|
||||
requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT }
|
||||
save={ save }
|
||||
footer={ <WiredSourcesSelector showFurni={ true } furniSource={ furniSource } onChangeFurni={ setFurniSource } /> }>
|
||||
footer={
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex flex-col gap-1">
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.quantifier_selection') }</Text>
|
||||
{ [ 0, 1 ].map(value => (
|
||||
<label key={ value } className="flex items-center gap-1">
|
||||
<input checked={ (quantifier === value) } className="form-check-input" name="counterTimeQuantifier" type="radio" onChange={ () => setQuantifier(value) } />
|
||||
<Text>{ LocalizeText(`wiredfurni.params.quantifier.furni.${ value }`) }</Text>
|
||||
</label>
|
||||
)) }
|
||||
</div>
|
||||
<WiredSourcesSelector showFurni={ true } furniSource={ furniSource } onChangeFurni={ setFurniSource } />
|
||||
</div>
|
||||
}>
|
||||
<div className="flex flex-col gap-2">
|
||||
{ COMPARISON_OPTIONS.map(option =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user