mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
Wired changes
This commit is contained in:
parent
aba4ddf2db
commit
790450edd5
@ -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 =>
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.usercountmax', [ 'value' ], [ max.toString() ]) }</Text>
|
||||
<ReactSlider
|
||||
className={ 'nitro-slider' }
|
||||
min={ 1 }
|
||||
max={ 50 }
|
||||
min={ 0 }
|
||||
max={ 125 }
|
||||
value={ max }
|
||||
onChange={ event => setMax(event) } />
|
||||
</Column>
|
||||
|
@ -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>(WiredOpenEvent, event =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
SendMessageComposer(new OpenMessageComposer(parser.stuffId));
|
||||
});
|
||||
|
||||
useMessageEvent<WiredSaveSuccessEvent>(WiredSaveSuccessEvent, event =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
Loading…
Reference in New Issue
Block a user