Updates
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 157 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 153 B |
@ -1,3 +1,38 @@
|
|||||||
.nitro-wired {
|
.nitro-wired {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 16px;
|
||||||
|
height: 9px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
|
||||||
|
&.icon-mv-1 {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_around.png');
|
||||||
|
}
|
||||||
|
&.icon-mv-2 {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_up_down.png');
|
||||||
|
}
|
||||||
|
&.icon-mv-3 {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_left_right.png');
|
||||||
|
}
|
||||||
|
&.icon-ne {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_north_east.png');
|
||||||
|
}
|
||||||
|
&.icon-se {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_south_east.png');
|
||||||
|
}
|
||||||
|
&.icon-sw {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_south_west.png');
|
||||||
|
}
|
||||||
|
&.icon-nw {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_north_west.png');
|
||||||
|
}
|
||||||
|
&.icon-rot-1 {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_rotate_clockwise.png');
|
||||||
|
}
|
||||||
|
&.icon-rot-2 {
|
||||||
|
background-image: url('../../assets/images/wired/icon_wired_rotate_counter_clockwise.png');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,3 +15,5 @@ export class WiredFurniType
|
|||||||
public static _Str_4991: number = 2;
|
public static _Str_4991: number = 2;
|
||||||
public static _Str_5430: number = 3;
|
public static _Str_5430: number = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const WIRED_STRING_DELIMETER: string = '\t';
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
import { WiredActionBotChangeFigureView } from '../views/actions/bot-change-figure/WiredActionBotChangeFigureView';
|
import { WiredActionBotChangeFigureView } from '../views/actions/bot-change-figure/WiredActionBotChangeFigureView';
|
||||||
import { WiredActionBotFollowAvatarView } from '../views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView';
|
import { WiredActionBotFollowAvatarView } from '../views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView';
|
||||||
|
import { WiredActionBotGiveHandItemView } from '../views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView';
|
||||||
|
import { WiredActionBotMoveView } from '../views/actions/bot-move/WiredActionBotMoveView';
|
||||||
|
import { WiredActionBotTalkToAvatarView } from '../views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView';
|
||||||
|
import { WiredActionBotTalkView } from '../views/actions/bot-talk/WiredActionBotTalkView';
|
||||||
|
import { WiredActionBotTeleportView } from '../views/actions/bot-teleport/WiredActionBotTeleportView';
|
||||||
|
import { WiredActionCallAnotherStackView } from '../views/actions/call-another-stack/WiredActionCallAnotherStackView';
|
||||||
|
import { WiredActionChaseView } from '../views/actions/chase/WiredActionChaseView';
|
||||||
|
import { WiredActionChatView } from '../views/actions/chat/WiredActionChatView';
|
||||||
|
import { WiredActionFleeView } from '../views/actions/flee/WiredActionFleeView';
|
||||||
|
import { WiredActionJoinTeamView } from '../views/actions/join-team/WiredActionJoinTeamView';
|
||||||
|
import { WiredActionKickFromRoomView } from '../views/actions/kick-from-room/WiredActionKickFromRoomView';
|
||||||
|
import { WiredActionLeaveTeamView } from '../views/actions/leave-team/WiredActionLeaveTeamView';
|
||||||
|
import { WiredActionMoveFurniView } from '../views/actions/move-furni/WiredActionMoveFurniView';
|
||||||
|
import { WiredActionResetView } from '../views/actions/reset/WiredActionResetView';
|
||||||
|
import { WiredActionSetFurniStateToView } from '../views/actions/set-furni-state-to/WiredActionSetFurniStateToView';
|
||||||
|
import { WiredActionTeleportView } from '../views/actions/teleport/WiredActionTeleportView';
|
||||||
|
import { WiredActionToggleFurniStateView } from '../views/actions/toggle-furni-state/WiredActionToggleFurniStateView';
|
||||||
import { WiredActionLayout } from './WiredActionLayoutCode';
|
import { WiredActionLayout } from './WiredActionLayoutCode';
|
||||||
|
|
||||||
export function GetWiredActionLayout(code: number): JSX.Element
|
export function GetWiredActionLayout(code: number): JSX.Element
|
||||||
@ -10,5 +27,39 @@ export function GetWiredActionLayout(code: number): JSX.Element
|
|||||||
return <WiredActionBotChangeFigureView />;
|
return <WiredActionBotChangeFigureView />;
|
||||||
case WiredActionLayout.BOT_FOLLOW_AVATAR:
|
case WiredActionLayout.BOT_FOLLOW_AVATAR:
|
||||||
return <WiredActionBotFollowAvatarView />;
|
return <WiredActionBotFollowAvatarView />;
|
||||||
|
case WiredActionLayout.BOT_GIVE_HAND_ITEM:
|
||||||
|
return <WiredActionBotGiveHandItemView />;
|
||||||
|
case WiredActionLayout.BOT_MOVE:
|
||||||
|
return <WiredActionBotMoveView />;
|
||||||
|
case WiredActionLayout.BOT_TALK:
|
||||||
|
return <WiredActionBotTalkView />;
|
||||||
|
case WiredActionLayout.BOT_TALK_DIRECT_TO_AVTR:
|
||||||
|
return <WiredActionBotTalkToAvatarView />;
|
||||||
|
case WiredActionLayout.BOT_TELEPORT:
|
||||||
|
return <WiredActionBotTeleportView />;
|
||||||
|
case WiredActionLayout.CALL_ANOTHER_STACK:
|
||||||
|
return <WiredActionCallAnotherStackView />;
|
||||||
|
case WiredActionLayout.CHASE:
|
||||||
|
return <WiredActionChaseView />;
|
||||||
|
case WiredActionLayout.CHAT:
|
||||||
|
return <WiredActionChatView />;
|
||||||
|
case WiredActionLayout.FLEE:
|
||||||
|
return <WiredActionFleeView />;
|
||||||
|
case WiredActionLayout.JOIN_TEAM:
|
||||||
|
return <WiredActionJoinTeamView />;
|
||||||
|
case WiredActionLayout.KICK_FROM_ROOM:
|
||||||
|
return <WiredActionKickFromRoomView />;
|
||||||
|
case WiredActionLayout.LEAVE_TEAM:
|
||||||
|
return <WiredActionLeaveTeamView />;
|
||||||
|
case WiredActionLayout.MOVE_FURNI:
|
||||||
|
return <WiredActionMoveFurniView />;
|
||||||
|
case WiredActionLayout.RESET:
|
||||||
|
return <WiredActionResetView />;
|
||||||
|
case WiredActionLayout.SET_FURNI_STATE:
|
||||||
|
return <WiredActionSetFurniStateToView />;
|
||||||
|
case WiredActionLayout.TELEPORT:
|
||||||
|
return <WiredActionTeleportView />;
|
||||||
|
case WiredActionLayout.TOGGLE_FURNI_STATE:
|
||||||
|
return <WiredActionToggleFurniStateView />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,10 @@ export const WiredActionBaseView: FC<WiredActionBaseViewProps> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredBaseView wiredType="action" requiresFurni={ requiresFurni } save={ onSave }>
|
<WiredBaseView wiredType="action" requiresFurni={ requiresFurni } save={ onSave }>
|
||||||
{ children }
|
{ !children ? null : <>
|
||||||
<hr className="my-1 mb-2 bg-dark" />
|
{ children }
|
||||||
|
<hr className="my-1 mb-2 bg-dark" />
|
||||||
|
</> }
|
||||||
<div className="d-flex flex-column justify-content-center align-items-center">
|
<div className="d-flex flex-column justify-content-center align-items-center">
|
||||||
{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) }
|
{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) }
|
||||||
<Slider
|
<Slider
|
||||||
|
@ -3,10 +3,9 @@ import { GetSessionDataManager } from '../../../../../api';
|
|||||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView';
|
import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView';
|
||||||
import { useWiredContext } from '../../../context/WiredContext';
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
import { WiredFurniType } from '../../../WiredView.types';
|
import { WiredFurniType, WIRED_STRING_DELIMETER } from '../../../WiredView.types';
|
||||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
const DELIMETER: string = '\t';
|
|
||||||
const DEFAULT_FIGURE: string = 'hd-180-1.ch-210-66.lg-270-82.sh-290-81';
|
const DEFAULT_FIGURE: string = 'hd-180-1.ch-210-66.lg-270-82.sh-290-81';
|
||||||
|
|
||||||
export const WiredActionBotChangeFigureView: FC<{}> = props =>
|
export const WiredActionBotChangeFigureView: FC<{}> = props =>
|
||||||
@ -17,9 +16,7 @@ export const WiredActionBotChangeFigureView: FC<{}> = props =>
|
|||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
const data = trigger.stringData.split(DELIMETER);
|
const data = trigger.stringData.split(WIRED_STRING_DELIMETER);
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
if(data.length > 0) setBotName(data[0]);
|
if(data.length > 0) setBotName(data[0]);
|
||||||
if(data.length > 1) setFigure(data[1].length > 0 ? data[1] : DEFAULT_FIGURE);
|
if(data.length > 1) setFigure(data[1].length > 0 ? data[1] : DEFAULT_FIGURE);
|
||||||
@ -32,7 +29,7 @@ export const WiredActionBotChangeFigureView: FC<{}> = props =>
|
|||||||
|
|
||||||
const save = useCallback(() =>
|
const save = useCallback(() =>
|
||||||
{
|
{
|
||||||
setStringParam((botName + DELIMETER + figure));
|
setStringParam((botName + WIRED_STRING_DELIMETER + figure));
|
||||||
}, [ botName, figure, setStringParam ]);
|
}, [ botName, figure, setStringParam ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { FC, useEffect, useState } from 'react';
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
import { useWiredContext } from '../../../context/WiredContext';
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
import { WiredFurniType } from '../../../WiredView.types';
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
@ -7,7 +8,7 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props =>
|
|||||||
{
|
{
|
||||||
const [ botName, setBotName ] = useState('');
|
const [ botName, setBotName ] = useState('');
|
||||||
const [ followMode, setFollowMode ] = useState(-1);
|
const [ followMode, setFollowMode ] = useState(-1);
|
||||||
const { trigger = null, setStringParam = null } = useWiredContext();
|
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
@ -15,9 +16,30 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props =>
|
|||||||
setFollowMode((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
setFollowMode((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
}, [ trigger ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName);
|
||||||
|
setIntParams([followMode]);
|
||||||
|
}, [ followMode, botName, setStringParam, setIntParams ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ null }>
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
BOT_CHANGE_FIGURE
|
<div className="form-group mb-2">
|
||||||
|
<label>{ 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-check">
|
||||||
|
<input className="form-check-input" type="radio" name="followMode" id="followMode1" checked={ followMode === 1 } onChange={() => 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)} />
|
||||||
|
<label className="form-check-label" htmlFor="followMode2">
|
||||||
|
{ LocalizeText('wiredfurni.params.stop.following') }
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</WiredActionBaseView>
|
</WiredActionBaseView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
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];
|
||||||
|
|
||||||
|
const [ botName, setBotName ] = useState('');
|
||||||
|
const [ handItemId, setHandItemId ] = useState(-1);
|
||||||
|
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setBotName(trigger.stringData);
|
||||||
|
setHandItemId((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName);
|
||||||
|
setIntParams([handItemId]);
|
||||||
|
}, [ handItemId, botName, setStringParam, setIntParams ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
<div className="form-group mb-2">
|
||||||
|
<label>{ 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>{ LocalizeText('wiredfurni.tooltip.handitem') }</div>
|
||||||
|
<select className="form-select" value={ handItemId } onChange={ (e) => setHandItemId(Number(e.target.value)) }>
|
||||||
|
<option value="0">------</option>
|
||||||
|
{allowedHanditemIds && allowedHanditemIds.map(value =>
|
||||||
|
{
|
||||||
|
return <option value={ value }>{ LocalizeText('handitem' + value) }</option>
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionBotMoveView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ botName, setBotName ] = useState('');
|
||||||
|
const { trigger = null, setStringParam = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setBotName(trigger.stringData);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName);
|
||||||
|
}, [ botName, setStringParam ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_4873 } save={ save }>
|
||||||
|
<div className="form-group">
|
||||||
|
<label>{ 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>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType, WIRED_STRING_DELIMETER } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionBotTalkToAvatarView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ botName, setBotName ] = useState('');
|
||||||
|
const [ message, setMessage ] = useState('');
|
||||||
|
const [ talkMode, setTalkMode ] = useState(-1);
|
||||||
|
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
const data = trigger.stringData.split(WIRED_STRING_DELIMETER);
|
||||||
|
|
||||||
|
if(data.length > 0) setBotName(data[0]);
|
||||||
|
if(data.length > 1) setMessage(data[1].length > 0 ? data[1] : '');
|
||||||
|
|
||||||
|
setTalkMode((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName + WIRED_STRING_DELIMETER + message);
|
||||||
|
setIntParams([talkMode]);
|
||||||
|
}, [ botName, message, talkMode, setStringParam, setIntParams ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
<div className="form-group mb-2">
|
||||||
|
<label>{ 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 mb-2">
|
||||||
|
<label>{ 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-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>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType, WIRED_STRING_DELIMETER } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionBotTalkView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ botName, setBotName ] = useState('');
|
||||||
|
const [ message, setMessage ] = useState('');
|
||||||
|
const [ talkMode, setTalkMode ] = useState(-1);
|
||||||
|
const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
const data = trigger.stringData.split(WIRED_STRING_DELIMETER);
|
||||||
|
|
||||||
|
if(data.length > 0) setBotName(data[0]);
|
||||||
|
if(data.length > 1) setMessage(data[1].length > 0 ? data[1] : '');
|
||||||
|
|
||||||
|
setTalkMode((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName + WIRED_STRING_DELIMETER + message);
|
||||||
|
setIntParams([talkMode]);
|
||||||
|
}, [ botName, message, talkMode, setStringParam, setIntParams ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
<div className="form-group mb-2">
|
||||||
|
<label>{ 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 mb-2">
|
||||||
|
<label>{ 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-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>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionBotTeleportView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ botName, setBotName ] = useState('');
|
||||||
|
const { trigger = null, setStringParam = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setBotName(trigger.stringData);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(botName);
|
||||||
|
}, [ botName, setStringParam ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_4873 } save={ save }>
|
||||||
|
<div className="form-group">
|
||||||
|
<label>{ 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>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionCallAnotherStackView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5430 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
10
src/views/wired/views/actions/chase/WiredActionChaseView.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionChaseView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5430 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
30
src/views/wired/views/actions/chat/WiredActionChatView.tsx
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionChatView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ message, setMessage ] = useState('');
|
||||||
|
const { trigger = null, setStringParam = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setMessage(trigger.stringData);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(message);
|
||||||
|
}, [ message, setStringParam ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
<div className="form-group">
|
||||||
|
<label>{ LocalizeText('wiredfurni.params.message') }</label>
|
||||||
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
10
src/views/wired/views/actions/flee/WiredActionFleeView.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionFleeView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5430 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionJoinTeamView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ selectedTeam, setSelectedTeam ] = useState(-1);
|
||||||
|
const { trigger = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setSelectedTeam((trigger.intData.length > 0) ? trigger.intData[0] : 0);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setIntParams([selectedTeam]);
|
||||||
|
}, [ selectedTeam, setIntParams ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
{ [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) }
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}) }
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionKickFromRoomView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ message, setMessage ] = useState('');
|
||||||
|
const { trigger = null, setStringParam = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setMessage(trigger.stringData);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setStringParam(message);
|
||||||
|
}, [ message, setStringParam ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ save }>
|
||||||
|
<div className="form-group">
|
||||||
|
<label>{ LocalizeText('wiredfurni.params.message') }</label>
|
||||||
|
<input type="text" className="form-control form-control-sm" value={ message } onChange={ event => setMessage(event.target.value) } />
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionLeaveTeamView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionMoveFurniView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const options: {value: number, icon: string}[] = [
|
||||||
|
{
|
||||||
|
value: 4,
|
||||||
|
icon: 'ne'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
icon: 'se'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 6,
|
||||||
|
icon: 'sw'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 7,
|
||||||
|
icon: 'nw'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
icon: 'mv-2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
icon: 'mv-3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
icon: 'mv-1'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const [ movement, setMovement ] = useState(-1);
|
||||||
|
const [ rotation, setRotation ] = useState(-1);
|
||||||
|
const { trigger = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
if(trigger.intData.length >= 2)
|
||||||
|
{
|
||||||
|
setMovement(trigger.intData[0]);
|
||||||
|
setRotation(trigger.intData[1]);
|
||||||
|
}
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setIntParams([movement, rotation]);
|
||||||
|
}, [ movement, rotation, setIntParams ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_4873 } save={ save }>
|
||||||
|
<div className="fw-bold">{ LocalizeText('wiredfurni.params.movefurni') }</div>
|
||||||
|
<div className="form-check">
|
||||||
|
<input className="form-check-input" type="radio" name="selectedTeam" id="movement0" checked={ movement === 0 } onChange={() => setMovement(0)} />
|
||||||
|
<label className="form-check-label" htmlFor="movement0">
|
||||||
|
{ LocalizeText('wiredfurni.params.movefurni.0') }
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="row row-cold-4">
|
||||||
|
{ options.map(option =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<div className="col">
|
||||||
|
<div key={ option.value } className="form-check">
|
||||||
|
<input className="form-check-input" type="radio" name="selectedTeam" 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} />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}) }
|
||||||
|
<div className="col"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
10
src/views/wired/views/actions/reset/WiredActionResetView.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionResetView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5431 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
import { FC, useCallback, useEffect, useState } from 'react';
|
||||||
|
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||||
|
import { useWiredContext } from '../../../context/WiredContext';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionSetFurniStateToView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
const [ stateFlag, setStateFlag ] = useState(-1);
|
||||||
|
const [ directionFlag, setDirectionFlag ] = useState(-1);
|
||||||
|
const [ positionFlag, setPositionFlag ] = useState(-1);
|
||||||
|
const { trigger = null, setIntParams = null } = useWiredContext();
|
||||||
|
|
||||||
|
useEffect(() =>
|
||||||
|
{
|
||||||
|
setStateFlag(trigger.getBoolean(0) ? 1 : 0);
|
||||||
|
setDirectionFlag(trigger.getBoolean(1) ? 1 : 0);
|
||||||
|
setPositionFlag(trigger.getBoolean(2) ? 1 : 0);
|
||||||
|
}, [ trigger ]);
|
||||||
|
|
||||||
|
const save = useCallback(() =>
|
||||||
|
{
|
||||||
|
setIntParams([stateFlag, directionFlag, positionFlag]);
|
||||||
|
}, [ directionFlag, positionFlag, setIntParams, stateFlag ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_4873 } save={ save }>
|
||||||
|
<div className="form-check">
|
||||||
|
<input className="form-check-input" type="checkbox" id="stateFlag" onChange={(e) => setStateFlag(e.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)} />
|
||||||
|
<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)} />
|
||||||
|
<label className="form-check-label" htmlFor="positionFlag">
|
||||||
|
{ LocalizeText('wiredfurni.params.condition.position') }
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionTeleportView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5430 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { WiredFurniType } from '../../../WiredView.types';
|
||||||
|
import { WiredActionBaseView } from '../base/WiredActionBaseView';
|
||||||
|
|
||||||
|
export const WiredActionToggleFurniStateView: FC<{}> = props =>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
<WiredActionBaseView requiresFurni={ WiredFurniType._Str_5430 } save={ null }></WiredActionBaseView>
|
||||||
|
);
|
||||||
|
}
|
@ -65,10 +65,11 @@ export const WiredBaseView: FC<WiredBaseViewProps> = props =>
|
|||||||
{ children }
|
{ children }
|
||||||
</div>
|
</div>
|
||||||
{ (requiresFurni !== WiredFurniType._Str_5431) &&
|
{ (requiresFurni !== WiredFurniType._Str_5431) &&
|
||||||
<div className="d-flex">
|
<>
|
||||||
{ LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ '0', '0' ]) }
|
<hr className="my-1 mb-2 bg-dark" />
|
||||||
{ LocalizeText('wiredfurni.pickfurnis.desc') }
|
<div className="fw-bold">{ LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ '0', '0' ]) }</div>
|
||||||
</div> }
|
<div>{ LocalizeText('wiredfurni.pickfurnis.desc') }</div>
|
||||||
|
</> }
|
||||||
<div className="d-flex mt-2">
|
<div className="d-flex mt-2">
|
||||||
<button className="btn btn-success me-2 w-100" onClick={ onSave }>{ LocalizeText('wiredfurni.ready') }</button>
|
<button className="btn btn-success me-2 w-100" onClick={ onSave }>{ LocalizeText('wiredfurni.ready') }</button>
|
||||||
<button className="btn btn-secondary w-100" onClick={ close }>{ LocalizeText('cancel') }</button>
|
<button className="btn btn-secondary w-100" onClick={ close }>{ LocalizeText('cancel') }</button>
|
||||||
|