mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-19 05:46:27 +01:00
Merge branch 'patch/wired-special-input' into 'dev'
Fix wired saving when wrong data received See merge request nitro/nitro-react!36
This commit is contained in:
commit
f37ec67d95
@ -1,5 +1,6 @@
|
|||||||
import { WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredRewardResultMessageEvent, WiredSaveSuccessEvent, WiredValidationErrorEvent } from '@nitrots/nitro-renderer';
|
import { WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredRewardResultMessageEvent, WiredSaveSuccessEvent, WiredValidationErrorEvent } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback } from 'react';
|
import { FC, useCallback } from 'react';
|
||||||
|
import { LocalizeText, NotificationAlertType, NotificationUtilities } from '../../api';
|
||||||
import { UseMessageEventHook } from '../../hooks/messages';
|
import { UseMessageEventHook } from '../../hooks/messages';
|
||||||
import { useWiredContext } from './context/WiredContext';
|
import { useWiredContext } from './context/WiredContext';
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ export const WiredMessageHandler: FC<{}> = props =>
|
|||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
|
|
||||||
|
NotificationUtilities.simpleAlert(parser.info, NotificationAlertType.DEFAULT, null, null, LocalizeText('error.title'));
|
||||||
console.log(parser);
|
console.log(parser);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ import { WiredMessageHandler } from './WiredMessageHandler';
|
|||||||
export const WiredView: FC<{}> = props =>
|
export const WiredView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
const [ trigger, setTrigger ] = useState<Triggerable>(null);
|
const [ trigger, setTrigger ] = useState<Triggerable>(null);
|
||||||
const [ intParams, setIntParams ] = useState<number[]>(null);
|
const [ intParams, setIntParams ] = useState<number[]>([]);
|
||||||
const [ stringParam, setStringParam ] = useState<string>(null);
|
const [ stringParam, setStringParam ] = useState<string>('');
|
||||||
const [ furniIds, setFurniIds ] = useState<number[]>([]);
|
const [ furniIds, setFurniIds ] = useState<number[]>([]);
|
||||||
const [ actionDelay, setActionDelay ] = useState<number>(null);
|
const [ actionDelay, setActionDelay ] = useState<number>(null);
|
||||||
|
|
||||||
|
@ -12,13 +12,14 @@ export interface WiredBaseViewProps
|
|||||||
{
|
{
|
||||||
wiredType: string;
|
wiredType: string;
|
||||||
requiresFurni: number;
|
requiresFurni: number;
|
||||||
|
hasSpecialInput: boolean;
|
||||||
save: () => void;
|
save: () => void;
|
||||||
validate?: () => boolean;
|
validate?: () => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WiredBaseView: FC<WiredBaseViewProps> = props =>
|
export const WiredBaseView: FC<WiredBaseViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { wiredType = '', requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, validate = null, children = null } = props;
|
const { wiredType = '', requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, validate = null, children = null, hasSpecialInput = false } = props;
|
||||||
const [ wiredName, setWiredName ] = useState<string>(null);
|
const [ wiredName, setWiredName ] = useState<string>(null);
|
||||||
const [ wiredDescription, setWiredDescription ] = useState<string>(null);
|
const [ wiredDescription, setWiredDescription ] = useState<string>(null);
|
||||||
const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null } = useWiredContext();
|
const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null } = useWiredContext();
|
||||||
@ -57,8 +58,14 @@ export const WiredBaseView: FC<WiredBaseViewProps> = props =>
|
|||||||
setWiredDescription(furniData.description);
|
setWiredDescription(furniData.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hasSpecialInput)
|
||||||
|
{
|
||||||
setIntParams(trigger.intData);
|
setIntParams(trigger.intData);
|
||||||
setStringParam(trigger.stringData);
|
setStringParam(trigger.stringData);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(requiresFurni > WiredFurniType.STUFF_SELECTION_OPTION_NONE)
|
||||||
|
{
|
||||||
setFurniIds(prevValue =>
|
setFurniIds(prevValue =>
|
||||||
{
|
{
|
||||||
if(prevValue && prevValue.length) WiredSelectionVisualizer.clearSelectionShaderFromFurni(prevValue);
|
if(prevValue && prevValue.length) WiredSelectionVisualizer.clearSelectionShaderFromFurni(prevValue);
|
||||||
@ -72,8 +79,9 @@ export const WiredBaseView: FC<WiredBaseViewProps> = props =>
|
|||||||
|
|
||||||
return [];
|
return [];
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, [ trigger, setIntParams, setStringParam, setFurniIds ]);
|
}, [trigger, setIntParams, setStringParam, setFurniIds, hasSpecialInput, requiresFurni]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardView uniqueKey="nitro-wired" className="nitro-wired" theme="primary-slim">
|
<NitroCardView uniqueKey="nitro-wired" className="nitro-wired" theme="primary-slim">
|
||||||
|
@ -11,13 +11,14 @@ import { WiredBaseView } from '../WiredBaseView';
|
|||||||
|
|
||||||
export interface WiredActionBaseViewProps
|
export interface WiredActionBaseViewProps
|
||||||
{
|
{
|
||||||
|
hasSpecialInput: boolean;
|
||||||
requiresFurni: number;
|
requiresFurni: number;
|
||||||
save: () => void;
|
save: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
|
export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, children = null } = props;
|
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;
|
||||||
const [ delay, setDelay ] = useState(-1);
|
const [ delay, setDelay ] = useState(-1);
|
||||||
const { trigger = null, setActionDelay = null } = useWiredContext();
|
const { trigger = null, setActionDelay = null } = useWiredContext();
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
|
|||||||
}, [ delay, save, setActionDelay ]);
|
}, [ delay, save, setActionDelay ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredBaseView wiredType="action" requiresFurni={ requiresFurni } save={ onSave }>
|
<WiredBaseView wiredType="action" requiresFurni={ requiresFurni } save={ onSave } hasSpecialInput={ hasSpecialInput }>
|
||||||
{ children }
|
{ children }
|
||||||
{ !!children && <hr className="m-0 bg-dark" /> }
|
{ !!children && <hr className="m-0 bg-dark" /> }
|
||||||
<Column>
|
<Column>
|
||||||
|
@ -37,7 +37,7 @@ export const WiredActionBotChangeFigureView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -33,7 +33,7 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<label className="fw-bold">{ LocalizeText('wiredfurni.params.bot.name') }</label>
|
<label className="fw-bold">{ LocalizeText('wiredfurni.params.bot.name') }</label>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -34,7 +34,7 @@ export const WiredActionBotGiveHandItemView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -22,7 +22,7 @@ export const WiredActionBotMoveView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -39,7 +39,7 @@ export const WiredActionBotTalkToAvatarView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -39,7 +39,7 @@ export const WiredActionBotTalkView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -22,7 +22,7 @@ export const WiredActionBotTeleportView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionCallAnotherStackView: FC<{}> = props =>
|
export const WiredActionCallAnotherStackView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionChaseView: FC<{}> = props =>
|
export const WiredActionChaseView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export const WiredActionChatView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.message') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.message') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } maxLength={ 100 } />
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } maxLength={ 100 } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionFleeView: FC<{}> = props =>
|
export const WiredActionFleeView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ export const WiredActionGiveRewardView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Flex alignItems="center" gap={ 1 }>
|
<Flex alignItems="center" gap={ 1 }>
|
||||||
<input className="form-check-input" type="checkbox" id="limitEnabled" onChange={ event => setLimitEnabled(event.target.checked)} />
|
<input className="form-check-input" type="checkbox" id="limitEnabled" onChange={ event => setLimitEnabled(event.target.checked)} />
|
||||||
<Text>{ LocalizeText('wiredfurni.params.prizelimit', ['amount'], [limitEnabled ? rewardsLimit.toString() : '']) }</Text>
|
<Text>{ LocalizeText('wiredfurni.params.prizelimit', ['amount'], [limitEnabled ? rewardsLimit.toString() : '']) }</Text>
|
||||||
|
@ -41,7 +41,7 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -37,7 +37,7 @@ export const WiredActionGiveScoreView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -23,7 +23,7 @@ export const WiredActionJoinTeamView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.team') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.team') }</Text>
|
||||||
{ [1, 2, 3, 4].map(team =>
|
{ [1, 2, 3, 4].map(team =>
|
||||||
|
@ -22,7 +22,7 @@ export const WiredActionKickFromRoomView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.message') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.message') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } maxLength={ 100 } />
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } maxLength={ 100 } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionLeaveTeamView: FC<{}> = props =>
|
export const WiredActionLeaveTeamView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ export const WiredActionMoveAndRotateFurniView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.startdir') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.startdir') }</Text>
|
||||||
<Flex gap={ 1 }>
|
<Flex gap={ 1 }>
|
||||||
|
@ -57,7 +57,7 @@ export const WiredActionMoveFurniToView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.emptytiles', [ 'tiles' ], [ spacing.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.emptytiles', [ 'tiles' ], [ spacing.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -70,7 +70,7 @@ export const WiredActionMoveFurniView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.movefurni') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.movefurni') }</Text>
|
||||||
<Flex alignItems="center" gap={ 1 }>
|
<Flex alignItems="center" gap={ 1 }>
|
||||||
|
@ -33,7 +33,7 @@ export const WiredActionMuteUserView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [ time.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [ time.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionResetView: FC<{}> = props =>
|
export const WiredActionResetView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ export const WiredActionSetFurniStateToView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.conditions') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.conditions') }</Text>
|
||||||
<Flex alignItems="center" gap={ 1 }>
|
<Flex alignItems="center" gap={ 1 }>
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionTeleportView: FC<{}> = props =>
|
export const WiredActionTeleportView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import { WiredActionBaseView } from './WiredActionBaseView';
|
|||||||
|
|
||||||
export const WiredActionToggleFurniStateView: FC<{}> = props =>
|
export const WiredActionToggleFurniStateView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
|
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export const WiredConditionActorHasHandItemView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.handitem') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.handitem') }</Text>
|
||||||
<select className="form-select form-select-sm" value={ handItemId } onChange={ event => setHandItemId(parseInt(event.target.value)) }>
|
<select className="form-select form-select-sm" value={ handItemId } onChange={ event => setHandItemId(parseInt(event.target.value)) }>
|
||||||
|
@ -4,5 +4,5 @@ import { WiredConditionBaseView } from './WiredConditionBaseView';
|
|||||||
|
|
||||||
export const WiredConditionActorIsGroupMemberView: FC<{}> = props =>
|
export const WiredConditionActorIsGroupMemberView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import { WiredConditionBaseView } from './WiredConditionBaseView';
|
|||||||
|
|
||||||
export const WiredConditionActorIsOnFurniView: FC<{}> = props =>
|
export const WiredConditionActorIsOnFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ null } />;
|
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export const WiredConditionActorIsTeamMemberView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.team') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.team') }</Text>
|
||||||
{ teamIds.map(value =>
|
{ teamIds.map(value =>
|
||||||
|
@ -22,7 +22,7 @@ export const WiredConditionActorIsWearingBadgeView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.badgecode') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.badgecode') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ badge } onChange={ event => setBadge(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ badge } onChange={ event => setBadge(event.target.value) } />
|
||||||
|
@ -22,7 +22,7 @@ export const WiredConditionActorIsWearingEffectView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.effectid') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.effectid') }</Text>
|
||||||
<input type="number" className="form-control form-control-sm" value={ effect } onChange={ event => setEffect(parseInt(event.target.value)) } />
|
<input type="number" className="form-control form-control-sm" value={ effect } onChange={ event => setEffect(parseInt(event.target.value)) } />
|
||||||
|
@ -4,13 +4,14 @@ import { WiredBaseView } from '../WiredBaseView';
|
|||||||
|
|
||||||
export interface WiredConditionBaseViewProps
|
export interface WiredConditionBaseViewProps
|
||||||
{
|
{
|
||||||
|
hasSpecialInput: boolean;
|
||||||
requiresFurni: number;
|
requiresFurni: number;
|
||||||
save: () => void;
|
save: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WiredConditionBaseView: FC<WiredConditionBaseViewProps> = props =>
|
export const WiredConditionBaseView: FC<WiredConditionBaseViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, children = null } = props;
|
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;
|
||||||
|
|
||||||
const onSave = useCallback(() =>
|
const onSave = useCallback(() =>
|
||||||
{
|
{
|
||||||
@ -18,7 +19,7 @@ export const WiredConditionBaseView: FC<WiredConditionBaseViewProps> = props =>
|
|||||||
}, [ save ]);
|
}, [ save ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredBaseView wiredType="condition" requiresFurni={ requiresFurni } save={ onSave }>
|
<WiredBaseView wiredType="condition" requiresFurni={ requiresFurni } hasSpecialInput={ hasSpecialInput } save={ onSave }>
|
||||||
{ children }
|
{ children }
|
||||||
</WiredBaseView>
|
</WiredBaseView>
|
||||||
);
|
);
|
||||||
|
@ -55,7 +55,7 @@ export const WiredConditionDateRangeView: FC<{}> = props =>
|
|||||||
}, [ trigger, dateToString ]);
|
}, [ trigger, dateToString ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.startdate') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.startdate') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ startDate } onChange={ (e) => setStartDate(e.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ startDate } onChange={ (e) => setStartDate(e.target.value) } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredConditionBaseView } from './WiredConditionBaseView';
|
|||||||
|
|
||||||
export const WiredConditionFurniHasAvatarOnView: FC<{}> = props =>
|
export const WiredConditionFurniHasAvatarOnView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ null } />;
|
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ export const WiredConditionFurniHasFurniOnView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.requireall') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.requireall') }</Text>
|
||||||
{ [0, 1].map(value =>
|
{ [0, 1].map(value =>
|
||||||
|
@ -23,7 +23,7 @@ export const WiredConditionFurniHasNotFurniOnView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.not_requireall') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.not_requireall') }</Text>
|
||||||
{ [0, 1].map(value =>
|
{ [0, 1].map(value =>
|
||||||
|
@ -4,5 +4,5 @@ import { WiredConditionBaseView } from './WiredConditionBaseView';
|
|||||||
|
|
||||||
export const WiredConditionFurniIsOfTypeView: FC<{}> = props =>
|
export const WiredConditionFurniIsOfTypeView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
return <WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ export const WiredConditionFurniMatchesSnapshotView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.conditions') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.conditions') }</Text>
|
||||||
<Flex alignItems="center" gap={ 1 }>
|
<Flex alignItems="center" gap={ 1 }>
|
||||||
|
@ -24,7 +24,7 @@ export const WiredConditionTimeElapsedLessView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.allowbefore', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.allowbefore', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -24,7 +24,7 @@ export const WiredConditionTimeElapsedMoreView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.allowafter', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.allowafter', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -37,7 +37,7 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredConditionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.usercountmin', [ 'value' ], [ min.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.usercountmin', [ 'value' ], [ min.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -30,7 +30,7 @@ export const WiredTriggerAvatarEnterRoomView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.picktriggerer') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.picktriggerer') }</Text>
|
||||||
<Flex alignItems="center" gap={ 1 }>
|
<Flex alignItems="center" gap={ 1 }>
|
||||||
|
@ -33,7 +33,7 @@ export const WiredTriggerAvatarSaysSomethingView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.whatissaid') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.whatissaid') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerAvatarWalksOffFurniView: FC<{}> = props =>
|
export const WiredTriggerAvatarWalksOffFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerAvatarWalksOnFurniView: FC<{}> = props =>
|
export const WiredTriggerAvatarWalksOnFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,14 @@ import { WiredBaseView } from '../WiredBaseView';
|
|||||||
|
|
||||||
export interface WiredTriggerBaseViewProps
|
export interface WiredTriggerBaseViewProps
|
||||||
{
|
{
|
||||||
|
hasSpecialInput: boolean;
|
||||||
requiresFurni: number;
|
requiresFurni: number;
|
||||||
save: () => void;
|
save: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WiredTriggerBaseView: FC<WiredTriggerBaseViewProps> = props =>
|
export const WiredTriggerBaseView: FC<WiredTriggerBaseViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, children = null } = props;
|
const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, hasSpecialInput = false, children = null } = props;
|
||||||
|
|
||||||
const onSave = useCallback(() =>
|
const onSave = useCallback(() =>
|
||||||
{
|
{
|
||||||
@ -18,7 +19,7 @@ export const WiredTriggerBaseView: FC<WiredTriggerBaseViewProps> = props =>
|
|||||||
}, [ save ]);
|
}, [ save ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredBaseView wiredType="trigger" requiresFurni={ requiresFurni } save={ onSave }>
|
<WiredBaseView wiredType="trigger" requiresFurni={ requiresFurni } hasSpecialInput={ hasSpecialInput } save={ onSave }>
|
||||||
{ children }
|
{ children }
|
||||||
</WiredBaseView>
|
</WiredBaseView>
|
||||||
);
|
);
|
||||||
|
@ -22,7 +22,7 @@ export const WiredTriggerBotReachedAvatarView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -22,7 +22,7 @@ export const WiredTriggerBotReachedStuffView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.bot.name') }</Text>
|
||||||
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
<input type="text" className="form-control form-control-sm" maxLength={ 32 } value={ botName } onChange={ event => setBotName(event.target.value) } />
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerCollisionView: FC<{}> = props =>
|
export const WiredTriggerCollisionView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export const WiredTriggeExecuteOnceView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -24,7 +24,7 @@ export const WiredTriggeExecutePeriodicallyLongView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.setlongtime', [ 'time' ], [ FriendlyTime.format(time * 5).toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.setlongtime', [ 'time' ], [ FriendlyTime.format(time * 5).toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -24,7 +24,7 @@ export const WiredTriggeExecutePeriodicallyView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.settime', [ 'seconds' ], [ GetWiredTimeLocale(time) ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerGameEndsView: FC<{}> = props =>
|
export const WiredTriggerGameEndsView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerGameStartsView: FC<{}> = props =>
|
export const WiredTriggerGameStartsView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ export const WiredTriggeScoreAchievedView: FC<{}> = props =>
|
|||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
|
<WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } hasSpecialInput={ true } save={ save }>
|
||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text bold>{ LocalizeText('wiredfurni.params.setscore', [ 'points' ], [ points.toString() ]) }</Text>
|
<Text bold>{ LocalizeText('wiredfurni.params.setscore', [ 'points' ], [ points.toString() ]) }</Text>
|
||||||
<ReactSlider
|
<ReactSlider
|
||||||
|
@ -4,5 +4,5 @@ import { WiredTriggerBaseView } from './WiredTriggerBaseView';
|
|||||||
|
|
||||||
export const WiredTriggerToggleFurniView: FC<{}> = props =>
|
export const WiredTriggerToggleFurniView: FC<{}> = props =>
|
||||||
{
|
{
|
||||||
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ null } />;
|
return <WiredTriggerBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } hasSpecialInput={ false } save={ null } />;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user