Update actions

This commit is contained in:
Bill 2021-06-30 00:32:39 -04:00
parent 7bce02f637
commit 3cb360361d
21 changed files with 272 additions and 256 deletions

View File

@ -77,4 +77,6 @@ export function GetWiredActionLayout(code: number): JSX.Element
case WiredActionLayout.TOGGLE_FURNI_STATE:
return <WiredActionToggleFurniStateView />;
}
return null;
}

View File

@ -32,14 +32,14 @@ export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
{ children }
<hr className="my-1 mb-2 bg-dark" />
</> }
<div className="fw-bold">{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) }</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) }</label>
<Slider
defaultValue={ delay }
dots={ true }
value={ delay }
min={ 0 }
max={ 20 }
onChange={ event => setDelay(event) }
/>
onChange={ event => setDelay(event) } />
</div>
</WiredBaseView>
);
}

View File

@ -28,18 +28,20 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props =>
<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) } />
</div>
<div className="form-group">
<div className="form-check">
<input className="form-check-input" type="radio" name="followMode" id="followMode1" checked={ followMode === 1 } onChange={() => setFollowMode(1)} />
<input className="form-check-input" type="radio" name="followMode" id="followMode1" checked={ (followMode === 1) } onChange={ event => setFollowMode(1) } />
<label className="form-check-label" htmlFor="followMode1">
{ LocalizeText('wiredfurni.params.start.following') }
</label>
</div>
<div className="form-check">
<input className="form-check-input" type="radio" name="followMode" id="followMode2" checked={ followMode === 0 } onChange={() => setFollowMode(0)} />
<input className="form-check-input" type="radio" name="followMode" id="followMode2" checked={ (followMode === 0) } onChange={ event => setFollowMode(0) } />
<label className="form-check-label" htmlFor="followMode2">
{ LocalizeText('wiredfurni.params.stop.following') }
</label>
</div>
</div>
</WiredActionBaseView>
);
}

View File

@ -4,10 +4,10 @@ import { useWiredContext } from '../../../context/WiredContext';
import { WiredFurniType } from '../../../WiredView.types';
import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionBotGiveHandItemView: FC<{}> = props =>
{
const allowedHanditemIds: number[] = [2, 5, 7, 8, 9, 10, 27];
export const WiredActionBotGiveHandItemView: FC<{}> = props =>
{
const [ botName, setBotName ] = useState('');
const [ handItemId, setHandItemId ] = useState(-1);
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
@ -30,14 +30,16 @@ export const WiredActionBotGiveHandItemView: FC<{}> = props =>
<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) } />
</div>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.handitem') }</div>
<select className="form-select" value={ handItemId } onChange={ (e) => setHandItemId(Number(e.target.value)) }>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.handitem') }</label>
<select className="form-select form-select-sm" value={ handItemId } onChange={ event => setHandItemId(parseInt(event.target.value)) }>
<option value="0">------</option>
{allowedHanditemIds && allowedHanditemIds.map(value =>
{ allowedHanditemIds.map(value =>
{
return <option value={ value }>{ LocalizeText('handitem' + value) }</option>
return <option key={ value } value={ value }>{ LocalizeText(`handitem${ value }`) }</option>
}) }
</select>
</div>
</WiredActionBaseView>
);
}

View File

@ -37,17 +37,15 @@ export const WiredActionBotTalkToAvatarView: FC<{}> = props =>
<label className="fw-bold">{ LocalizeText('wiredfurni.params.message') }</label>
<input type="text" className="form-control form-control-sm" maxLength={ 64 } value={ message } onChange={ event => setMessage(event.target.value) } />
</div>
<div className="form-group">
<div className="form-check">
<input className="form-check-input" type="radio" name="talkMode" id="talkMode1" checked={ talkMode === 0 } onChange={() => setTalkMode(0)} />
<label className="form-check-label" htmlFor="talkMode1">
{ LocalizeText('wiredfurni.params.talk') }
</label>
<input className="form-check-input" type="radio" name="talkMode" id="talkMode1" checked={ (talkMode === 0) } onChange={ event => setTalkMode(0) } />
<label className="form-check-label" htmlFor="talkMode1">{ LocalizeText('wiredfurni.params.talk') }</label>
</div>
<div className="form-check">
<input className="form-check-input" type="radio" name="talkMode" id="talkMode2" checked={ talkMode === 1 } onChange={() => setTalkMode(1)} />
<label className="form-check-label" htmlFor="talkMode2">
{ LocalizeText('wiredfurni.params.whisper') }
</label>
<input className="form-check-input" type="radio" name="talkMode" id="talkMode2" checked={ (talkMode === 1) } onChange={ event => setTalkMode(1) } />
<label className="form-check-label" htmlFor="talkMode2">{ LocalizeText('wiredfurni.params.whisper') }</label>
</div>
</div>
</WiredActionBaseView>
);

View File

@ -37,17 +37,15 @@ export const WiredActionBotTalkView: FC<{}> = props =>
<label className="fw-bold">{ LocalizeText('wiredfurni.params.message') }</label>
<input type="text" className="form-control form-control-sm" maxLength={ 64 } value={ message } onChange={ event => setMessage(event.target.value) } />
</div>
<div className="form-group">
<div className="form-check">
<input className="form-check-input" type="radio" name="talkMode" id="talkMode1" checked={ talkMode === 0 } onChange={() => setTalkMode(0)} />
<label className="form-check-label" htmlFor="talkMode1">
{ LocalizeText('wiredfurni.params.talk') }
</label>
<input className="form-check-input" type="radio" name="talkMode" id="talkMode1" checked={ (talkMode === 0) } onChange={ event => setTalkMode(0) } />
<label className="form-check-label" htmlFor="talkMode1">{ LocalizeText('wiredfurni.params.talk') }</label>
</div>
<div className="form-check">
<input className="form-check-input" type="radio" name="talkMode" id="talkMode2" checked={ talkMode === 1 } onChange={() => setTalkMode(1)} />
<label className="form-check-label" htmlFor="talkMode2">
{ LocalizeText('wiredfurni.params.shout') }
</label>
<input className="form-check-input" type="radio" name="talkMode" id="talkMode2" checked={ (talkMode === 1) } onChange={ event => setTalkMode(1) } />
<label className="form-check-label" htmlFor="talkMode2">{ LocalizeText('wiredfurni.params.shout') }</label>
</div>
</div>
</WiredActionBaseView>
);

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionCallAnotherStackView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
}

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionChaseView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
}

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionFleeView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
}

View File

@ -9,7 +9,7 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
{
const [ points, setPoints ] = useState(1);
const [ time, setTime ] = useState(1);
const [ selectedTeam, setSelectedTeam ] = useState(-1);
const [ selectedTeam, setSelectedTeam ] = useState(1);
const { trigger = null, setIntParams = null } = useWiredContext();
useEffect(() =>
@ -20,6 +20,12 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
setTime(trigger.intData[1]);
setSelectedTeam(trigger.intData[2]);
}
else
{
setPoints(1);
setTime(1);
setSelectedTeam(1);
}
}, [ trigger ]);
const save = useCallback(() =>
@ -29,38 +35,36 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</label>
<Slider
defaultValue={ points }
dots={ true }
value={ points }
min={ 1 }
max={ 100 }
step={ 1 }
onChange={ event => setPoints(event) }
/>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</div>
onChange={ event => setPoints(event) } />
</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</label>
<Slider
defaultValue={ time }
dots={ true }
value={ time }
min={ 1 }
max={ 10 }
step={ 1 }
onChange={ event => setTime(event) }
/>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.team') }</div>
{ [1, 2, 3, 4].map(team =>
onChange={ event => setTime(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.team') }</label>
{ [1, 2, 3, 4].map(value =>
{
return (
<div key={ team } className="form-check">
<input className="form-check-input" type="radio" name="selectedTeam" id={'selectedTeam' + team} checked={ selectedTeam === team } onChange={() => setSelectedTeam(team)} />
<label className="form-check-label" htmlFor={'selectedTeam' + team}>
{ LocalizeText('wiredfurni.params.team.' + team) }
<div key={ value } className="form-check">
<input className="form-check-input" type="radio" name="selectedTeam" id={ `selectedTeam${ value }` } checked={ (selectedTeam === value) } onChange={ event => setSelectedTeam(value) } />
<label className="form-check-label" htmlFor={'selectedTeam' + value}>
{ LocalizeText('wiredfurni.params.team.' + value) }
</label>
</div>
)
);
}) }
</div>
</WiredActionBaseView>
);
}

View File

@ -18,6 +18,11 @@ export const WiredActionGiveScoreView: FC<{}> = props =>
setPoints(trigger.intData[0]);
setTime(trigger.intData[1]);
}
else
{
setPoints(1);
setTime(1);
}
}, [ trigger ]);
const save = useCallback(() =>
@ -27,25 +32,22 @@ export const WiredActionGiveScoreView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.setpoints', [ 'points' ], [ points.toString() ]) }</label>
<Slider
defaultValue={ points }
dots={ true }
value={ points }
min={ 1 }
max={ 100 }
step={ 1 }
onChange={ event => setPoints(event) }
/>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</div>
onChange={ event => setPoints(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.settimesingame', [ 'times' ], [ time.toString() ]) }</label>
<Slider
defaultValue={ time }
dots={ true }
value={ time }
min={ 1 }
max={ 10 }
step={ 1 }
onChange={ event => setTime(event) }
/>
onChange={ event => setTime(event) } />
</div>
</WiredActionBaseView>
);
}

View File

@ -21,18 +21,20 @@ export const WiredActionJoinTeamView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.team') }</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.team') }</label>
{ [1, 2, 3, 4].map(team =>
{
return (
<div key={ team } className="form-check">
<input className="form-check-input" type="radio" name="selectedTeam" id={'selectedTeam' + team} checked={ selectedTeam === team } onChange={() => setSelectedTeam(team)} />
<label className="form-check-label" htmlFor={'selectedTeam' + team}>
{ LocalizeText('wiredfurni.params.team.' + team) }
<input className="form-check-input" type="radio" name="selectedTeam" id={ `selectedTeam${ team }` } checked={ (selectedTeam === team) } onChange={ event => setSelectedTeam(team) } />
<label className="form-check-label" htmlFor={ `selectedTeam${ team }` }>
{ LocalizeText(`wiredfurni.params.team.${ team }`) }
</label>
</div>
)
}) }
</div>
</WiredActionBaseView>
);
}

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionLeaveTeamView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
}

View File

@ -38,6 +38,11 @@ export const WiredActionMoveAndRotateFurniView: FC<{}> = props =>
setMovement(trigger.intData[0]);
setRotation(trigger.intData[1]);
}
else
{
setMovement(-1);
setRotation(-1);
}
}, [ trigger ]);
const save = useCallback(() =>
@ -47,35 +52,38 @@ export const WiredActionMoveAndRotateFurniView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.startdir') }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.startdir') }</label>
<div className="row row-cold-4">
{ directionOptions.map(option =>
{
return (
<div key={ option.value } className="col">
<div className="form-check">
<input className="form-check-input" type="radio" name="movement" id={'movement' + option.value} checked={ movement === option.value } onChange={() => setMovement(option.value)} />
<label className="form-check-label" htmlFor={'movement' + option.value}>
<i className={'icon icon-' + option.icon} />
<input className="form-check-input" type="radio" name="movement" id={ `movement${ option.value }` } checked={ (movement === option.value) } onChange={ event => setMovement(option.value) } />
<label className="form-check-label" htmlFor={ `movement${ option.value }` }>
<i className={ `icon icon-${ option.icon }` } />
</label>
</div>
</div>
)
}) }
</div>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.turn') }</div>
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.turn') }</label>
{ rotationOptions.map(option =>
{
return (
<div key={ option } className="form-check">
<input className="form-check-input" type="radio" name="rotation" id={'rotation' + option} checked={ rotation === option } onChange={() => setRotation(option)} />
<label className="form-check-label" htmlFor={'rotation' + option}>
{ LocalizeText('wiredfurni.params.turn.' + option) }
<input className="form-check-input" type="radio" name="rotation" id={ `rotation${ option }` } checked={ (rotation === option) } onChange={ event => setRotation(option) } />
<label className="form-check-label" htmlFor={ `rotation${ option }` }>
{ LocalizeText(`wiredfurni.params.turn.${ option }`) }
</label>
</div>
)
}) }
</div>
</WiredActionBaseView>
);
}

View File

@ -37,6 +37,11 @@ export const WiredActionMoveFurniToView: FC<{}> = props =>
setSpacing(trigger.intData[1]);
setMovement(trigger.intData[0]);
}
else
{
setSpacing(-1);
setMovement(-1);
}
}, [ trigger ]);
const save = useCallback(() =>
@ -46,32 +51,32 @@ export const WiredActionMoveFurniToView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.emptytiles', [ 'tiles' ], [ spacing.toString() ]) }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.emptytiles', [ 'tiles' ], [ spacing.toString() ]) }</label>
<Slider
defaultValue={ spacing }
dots={ true }
value={ spacing }
min={ 1 }
max={ 5 }
step={ 1 }
onChange={ event => setSpacing(event) }
/>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.startdir') }</div>
onChange={ event => setSpacing(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.startdir') }</label>
<div className="row row-cold-4">
{ directionOptions.map(option =>
{ directionOptions.map(value =>
{
return (
<div key={ option.value } className="col">
<div key={ value.value } className="col">
<div className="form-check">
<input className="form-check-input" type="radio" name="movement" id={'movement' + option.value} checked={ movement === option.value } onChange={() => setMovement(option.value)} />
<label className="form-check-label" htmlFor={'movement' + option.value}>
<i className={'icon icon-' + option.icon} />
<input className="form-check-input" type="radio" name="movement" id={ `movement${ value.value }` } checked={ (movement === value.value) } onChange={ event => setMovement(value.value) } />
<label className="form-check-label" htmlFor={ `movement${ value.value }` }>
<i className={ `icon icon-${ value.icon }` } />
</label>
</div>
</div>
)
}) }
</div>
</div>
</WiredActionBaseView>
);
}

View File

@ -50,6 +50,11 @@ export const WiredActionMoveFurniView: FC<{}> = props =>
setMovement(trigger.intData[0]);
setRotation(trigger.intData[1]);
}
else
{
setMovement(-1);
setRotation(-1);
}
}, [ trigger ]);
const save = useCallback(() =>
@ -59,43 +64,46 @@ export const WiredActionMoveFurniView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.movefurni') }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.movefurni') }</label>
<div className="form-check">
<input className="form-check-input" type="radio" name="selectedTeam" id="movement0" checked={ movement === 0 } onChange={() => setMovement(0)} />
<input className="form-check-input" type="radio" name="selectedTeam" id="movement0" checked={ (movement === 0) } onChange={ event => setMovement(0) } />
<label className="form-check-label" htmlFor="movement0">
{ LocalizeText('wiredfurni.params.movefurni.0') }
</label>
</div>
<div className="row row-cold-4">
<div className="row row-col-4">
{ directionOptions.map(option =>
{
return (
<div key={ option.value } className="col">
<div className="form-check">
<input className="form-check-input" type="radio" name="movement" id={'movement' + option.value} checked={ movement === option.value } onChange={() => setMovement(option.value)} />
<label className="form-check-label" htmlFor={'movement' + option.value}>
<i className={'icon icon-' + option.icon} />
<input className="form-check-input" type="radio" name="movement" id={ `movement${ option.value }` } checked={ (movement === option.value) } onChange={ event => setMovement(option.value) } />
<label className="form-check-label" htmlFor={ `movement${ option.value }` }>
<i className={ `icon icon-${ option.icon }` } />
</label>
</div>
</div>
)
}) }
<div className="col"></div>
<div className="col" />
</div>
<hr className="my-1 mb-2 bg-dark" />
<div className="fw-bold">{ LocalizeText('wiredfurni.params.rotatefurni') }</div>
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.rotatefurni') }</label>
{ rotationOptions.map(option =>
{
return (
<div key={ option } className="form-check">
<input className="form-check-input" type="radio" name="rotation" id={'rotation' + option} checked={ rotation === option } onChange={() => setRotation(option)} />
<input className="form-check-input" type="radio" name="rotation" id={ `rotation${ option }` } checked={ (rotation === option) } onChange={ event => setRotation(option) } />
<label className="form-check-label" htmlFor={'rotation' + option}>
{ [1, 2].includes(option) && <i className={'icon icon-rot-' + option} /> }
{ LocalizeText('wiredfurni.params.rotatefurni.' + option) }
{ [1, 2].includes(option) && <i className={ `icon icon-rot-${ option }` } /> }
{ LocalizeText(`wiredfurni.params.rotatefurni.${ option }`) }
</label>
</div>
)
}) }
</div>
</WiredActionBaseView>
);
}

View File

@ -25,17 +25,14 @@ export const WiredActionMuteUserView: FC<{}> = props =>
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [time.toString()]) }</div>
<div className="form-group mb-2">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.length.minutes', ['minutes'], [ time.toString() ]) }</label>
<Slider
defaultValue={ time }
dots={ true }
value={ time }
min={ 1 }
max={ 10 }
step={ 1 }
onChange={ event => setTime(event) }
/>
<hr className="my-1 mb-2 bg-dark" />
onChange={ event => setTime(event) } />
</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.message') }</label>
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionResetView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ null } />;
}

View File

@ -21,29 +21,31 @@ export const WiredActionSetFurniStateToView: FC<{}> = props =>
const save = useCallback(() =>
{
setIntParams([ stateFlag, directionFlag, positionFlag ]);
}, [ directionFlag, positionFlag, setIntParams, stateFlag ]);
}, [ directionFlag, positionFlag, stateFlag, setIntParams ]);
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID } save={ save }>
<div className="fw-bold">{ LocalizeText('wiredfurni.params.conditions') }</div>
<div className="form-group">
<label className="fw-bold">{ LocalizeText('wiredfurni.params.conditions') }</label>
<div className="form-check">
<input className="form-check-input" type="checkbox" id="stateFlag" onChange={(e) => setStateFlag(e.target.checked ? 1 : 0)} />
<input className="form-check-input" type="checkbox" id="stateFlag" onChange={ event => setStateFlag(event.target.checked ? 1 : 0) } />
<label className="form-check-label" htmlFor="stateFlag">
{ LocalizeText('wiredfurni.params.condition.state') }
</label>
</div>
<div className="form-check">
<input className="form-check-input" type="checkbox" id="directionFlag" onChange={(e) => setDirectionFlag(e.target.checked ? 1 : 0)} />
<input className="form-check-input" type="checkbox" id="directionFlag" onChange={ event => setDirectionFlag(event.target.checked ? 1 : 0) } />
<label className="form-check-label" htmlFor="directionFlag">
{ LocalizeText('wiredfurni.params.condition.direction') }
</label>
</div>
<div className="form-check">
<input className="form-check-input" type="checkbox" id="positionFlag" onChange={(e) => setPositionFlag(e.target.checked ? 1 : 0)} />
<input className="form-check-input" type="checkbox" id="positionFlag" onChange={ event => setPositionFlag(event.target.checked ? 1 : 0) } />
<label className="form-check-label" htmlFor="positionFlag">
{ LocalizeText('wiredfurni.params.condition.position') }
</label>
</div>
</div>
</WiredActionBaseView>
);
}

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionTeleportView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
}

View File

@ -4,7 +4,5 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView';
export const WiredActionToggleFurniStateView: FC<{}> = props =>
{
return (
<WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null }></WiredActionBaseView>
);
return <WiredActionBaseView requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT } save={ null } />;
}