diff --git a/src/components/wired/views/conditions/WiredConditionUserCountInRoomView.tsx b/src/components/wired/views/conditions/WiredConditionUserCountInRoomView.tsx index 824d7ae8..8ef5914b 100644 --- a/src/components/wired/views/conditions/WiredConditionUserCountInRoomView.tsx +++ b/src/components/wired/views/conditions/WiredConditionUserCountInRoomView.tsx @@ -8,7 +8,7 @@ import { WiredConditionBaseView } from './WiredConditionBaseView'; export const WiredConditionUserCountInRoomView: FC<{}> = props => { const [ min, setMin ] = useState(1); - const [ max, setMax ] = useState(1); + const [ max, setMax ] = useState(0); const { trigger = null, setIntParams = null } = useWired(); const save = () => setIntParams([ min, max ]); @@ -23,7 +23,7 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props => else { setMin(1); - setMax(1); + setMax(0); } }, [ trigger ]); @@ -42,8 +42,8 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props => { LocalizeText('wiredfurni.params.usercountmax', [ 'value' ], [ max.toString() ]) } setMax(event) } /> diff --git a/src/hooks/wired/useWired.ts b/src/hooks/wired/useWired.ts index c4628f45..5a6cb65b 100644 --- a/src/hooks/wired/useWired.ts +++ b/src/hooks/wired/useWired.ts @@ -1,4 +1,4 @@ -import { ConditionDefinition, Triggerable, TriggerDefinition, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateTriggerMessageComposer, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredSaveSuccessEvent } from '@nitrots/nitro-renderer'; +import { ConditionDefinition, OpenMessageComposer, Triggerable, TriggerDefinition, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateTriggerMessageComposer, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredSaveSuccessEvent } from '@nitrots/nitro-renderer'; import { useEffect, useState } from 'react'; import { useBetween } from 'use-between'; import { IsOwnerOfFloorFurniture, LocalizeText, SendMessageComposer, WiredFurniType, WiredSelectionVisualizer } from '../../api'; @@ -80,6 +80,13 @@ const useWiredState = () => }); } + useMessageEvent(WiredOpenEvent, event => + { + const parser = event.getParser(); + + SendMessageComposer(new OpenMessageComposer(parser.stuffId)); + }); + useMessageEvent(WiredSaveSuccessEvent, event => { const parser = event.getParser();