mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-18 18:02:36 +01:00
Update actions
This commit is contained in:
parent
7bce02f637
commit
3cb360361d
@ -77,4 +77,6 @@ export function GetWiredActionLayout(code: number): JSX.Element
|
||||
case WiredActionLayout.TOGGLE_FURNI_STATE:
|
||||
return <WiredActionToggleFurniStateView />;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ import { useWiredContext } from '../../../context/WiredContext';
|
||||
import { WiredFurniType } from '../../../WiredView.types';
|
||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||
|
||||
const allowedHanditemIds: number[] = [2, 5, 7, 8, 9, 10, 27];
|
||||
|
||||
export const WiredActionBotGiveHandItemView: FC<{}> = props =>
|
||||
{
|
||||
const allowedHanditemIds: number[] = [2, 5, 7, 8, 9, 10, 27];
|
||||
|
||||
const [ botName, setBotName ] = useState('');
|
||||
const [ handItemId, setHandItemId ] = useState(-1);
|
||||
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
|
||||
@ -21,7 +21,7 @@ export const WiredActionBotGiveHandItemView: FC<{}> = props =>
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setStringParam(botName);
|
||||
setIntParams([handItemId]);
|
||||
setIntParams([ handItemId ]);
|
||||
}, [ handItemId, botName, setStringParam, setIntParams ]);
|
||||
|
||||
return (
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ export const WiredActionBotTalkToAvatarView: FC<{}> = props =>
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setStringParam(botName + WIRED_STRING_DELIMETER + message);
|
||||
setIntParams([talkMode]);
|
||||
setIntParams([ talkMode ]);
|
||||
}, [ botName, message, talkMode, setStringParam, setIntParams ]);
|
||||
|
||||
return (
|
||||
@ -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>
|
||||
);
|
||||
|
@ -24,7 +24,7 @@ export const WiredActionBotTalkView: FC<{}> = props =>
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setStringParam(botName + WIRED_STRING_DELIMETER + message);
|
||||
setIntParams([talkMode]);
|
||||
setIntParams([ talkMode ]);
|
||||
}, [ botName, message, talkMode, setStringParam, setIntParams ]);
|
||||
|
||||
return (
|
||||
@ -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>
|
||||
);
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -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,47 +20,51 @@ export const WiredActionGiveScoreToPredefinedTeamView: FC<{}> = props =>
|
||||
setTime(trigger.intData[1]);
|
||||
setSelectedTeam(trigger.intData[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
setPoints(1);
|
||||
setTime(1);
|
||||
setSelectedTeam(1);
|
||||
}
|
||||
}, [ trigger ]);
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([points, time, selectedTeam]);
|
||||
setIntParams([ points, time, selectedTeam ]);
|
||||
}, [ points, time, selectedTeam, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -18,34 +18,36 @@ export const WiredActionGiveScoreView: FC<{}> = props =>
|
||||
setPoints(trigger.intData[0]);
|
||||
setTime(trigger.intData[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
setPoints(1);
|
||||
setTime(1);
|
||||
}
|
||||
}, [ trigger ]);
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([points, time]);
|
||||
setIntParams([ points, time ]);
|
||||
}, [ points, time, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -16,23 +16,25 @@ export const WiredActionJoinTeamView: FC<{}> = props =>
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([selectedTeam]);
|
||||
setIntParams([ selectedTeam ]);
|
||||
}, [ selectedTeam, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { useWiredContext } from '../../../context/WiredContext';
|
||||
import { WiredFurniType } from '../../../WiredView.types';
|
||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||
|
||||
const directionOptions: {value: number, icon: string}[] = [
|
||||
const directionOptions: { value: number, icon: string }[] = [
|
||||
{
|
||||
value: 0,
|
||||
icon: 'ne'
|
||||
@ -38,44 +38,52 @@ export const WiredActionMoveAndRotateFurniView: FC<{}> = props =>
|
||||
setMovement(trigger.intData[0]);
|
||||
setRotation(trigger.intData[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
setMovement(-1);
|
||||
setRotation(-1);
|
||||
}
|
||||
}, [ trigger ]);
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([movement, rotation]);
|
||||
setIntParams([ movement, rotation ]);
|
||||
}, [ movement, rotation, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { useWiredContext } from '../../../context/WiredContext';
|
||||
import { WiredFurniType } from '../../../WiredView.types';
|
||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||
|
||||
const directionOptions: {value: number, icon: string}[] = [
|
||||
const directionOptions: { value: number, icon: string }[] = [
|
||||
{
|
||||
value: 0,
|
||||
icon: 'ne'
|
||||
@ -37,41 +37,46 @@ export const WiredActionMoveFurniToView: FC<{}> = props =>
|
||||
setSpacing(trigger.intData[1]);
|
||||
setMovement(trigger.intData[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
setSpacing(-1);
|
||||
setMovement(-1);
|
||||
}
|
||||
}, [ trigger ]);
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([movement, spacing]);
|
||||
setIntParams([ movement, spacing ]);
|
||||
}, [ movement, spacing, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import { useWiredContext } from '../../../context/WiredContext';
|
||||
import { WiredFurniType } from '../../../WiredView.types';
|
||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||
|
||||
const directionOptions: {value: number, icon: string}[] = [
|
||||
const directionOptions: { value: number, icon: string }[] = [
|
||||
{
|
||||
value: 4,
|
||||
icon: 'ne'
|
||||
@ -50,52 +50,60 @@ export const WiredActionMoveFurniView: FC<{}> = props =>
|
||||
setMovement(trigger.intData[0]);
|
||||
setRotation(trigger.intData[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
setMovement(-1);
|
||||
setRotation(-1);
|
||||
}
|
||||
}, [ trigger ]);
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([movement, rotation]);
|
||||
setIntParams([ movement, rotation ]);
|
||||
}, [ movement, rotation, setIntParams ]);
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
@ -19,23 +19,20 @@ export const WiredActionMuteUserView: FC<{}> = props =>
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([time]);
|
||||
setIntParams([ time ]);
|
||||
setStringParam(message);
|
||||
}, [ time, message, setIntParams, setStringParam ]);
|
||||
|
||||
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) } />
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -20,30 +20,32 @@ export const WiredActionSetFurniStateToView: FC<{}> = props =>
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([stateFlag, directionFlag, positionFlag]);
|
||||
}, [ directionFlag, positionFlag, setIntParams, stateFlag ]);
|
||||
setIntParams([ stateFlag, directionFlag, positionFlag ]);
|
||||
}, [ 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>
|
||||
);
|
||||
}
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
@ -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 } />;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user