From 4b202678c073abf862254ecf899ce56413f88f79 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 26 Jun 2021 23:46:40 -0300 Subject: [PATCH 01/22] im annoyed --- src/views/Styles.scss | 1 + src/views/main/MainView.tsx | 2 + src/views/wired/WiredMessageHandler.tsx | 6 ++ src/views/wired/WiredView.scss | 3 + src/views/wired/WiredView.tsx | 81 +++++++++++++++++++ src/views/wired/WiredView.types.ts | 9 +++ src/views/wired/utils/IWiredLayout.ts | 4 + src/views/wired/utils/WiredActionLayout.ts | 29 +++++++ .../actions/base/WiredActionBaseView.tsx | 26 ++++++ .../WiredActionToggleFurniStateView.tsx | 12 +++ .../base/WiredConditionBaseView.tsx | 14 ++++ .../furni-selector/WiredFurniSelectorView.tsx | 17 ++++ .../WiredFurniSelectorView.types.ts | 5 ++ .../triggers/base/WiredTriggerBaseView.tsx | 14 ++++ 14 files changed, 223 insertions(+) create mode 100644 src/views/wired/WiredMessageHandler.tsx create mode 100644 src/views/wired/WiredView.scss create mode 100644 src/views/wired/WiredView.tsx create mode 100644 src/views/wired/WiredView.types.ts create mode 100644 src/views/wired/utils/IWiredLayout.ts create mode 100644 src/views/wired/utils/WiredActionLayout.ts create mode 100644 src/views/wired/views/actions/base/WiredActionBaseView.tsx create mode 100644 src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx create mode 100644 src/views/wired/views/conditions/base/WiredConditionBaseView.tsx create mode 100644 src/views/wired/views/furni-selector/WiredFurniSelectorView.tsx create mode 100644 src/views/wired/views/furni-selector/WiredFurniSelectorView.types.ts create mode 100644 src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx diff --git a/src/views/Styles.scss b/src/views/Styles.scss index c6117f4c..c4964b7e 100644 --- a/src/views/Styles.scss +++ b/src/views/Styles.scss @@ -14,3 +14,4 @@ @import './room/RoomView'; @import './room-host/RoomHostView'; @import './toolbar/ToolbarView'; +@import './wired/WiredView'; diff --git a/src/views/main/MainView.tsx b/src/views/main/MainView.tsx index 3d06d83d..540ff32f 100644 --- a/src/views/main/MainView.tsx +++ b/src/views/main/MainView.tsx @@ -11,6 +11,7 @@ import { NotificationCenterView } from '../notification-center/NotificationCente import { RightSideView } from '../right-side/RightSideView'; import { RoomHostView } from '../room-host/RoomHostView'; import { ToolbarView } from '../toolbar/ToolbarView'; +import { WiredView } from '../wired/WiredView'; import { MainViewProps } from './MainView.types'; export const MainView: FC = props => @@ -46,6 +47,7 @@ export const MainView: FC = props => { landingViewVisible && } + diff --git a/src/views/wired/WiredMessageHandler.tsx b/src/views/wired/WiredMessageHandler.tsx new file mode 100644 index 00000000..30990fc4 --- /dev/null +++ b/src/views/wired/WiredMessageHandler.tsx @@ -0,0 +1,6 @@ +import { FC } from 'react'; + +export const WiredMessageHandler: FC<{}> = props => +{ + return null; +}; diff --git a/src/views/wired/WiredView.scss b/src/views/wired/WiredView.scss new file mode 100644 index 00000000..b5980200 --- /dev/null +++ b/src/views/wired/WiredView.scss @@ -0,0 +1,3 @@ +.nitro-wired { + width: 300px; +} diff --git a/src/views/wired/WiredView.tsx b/src/views/wired/WiredView.tsx new file mode 100644 index 00000000..67b2cbad --- /dev/null +++ b/src/views/wired/WiredView.tsx @@ -0,0 +1,81 @@ +import { ConditionDefinition, Nitro, TriggerDefinition, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent } from 'nitro-renderer'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { CreateMessageHook } from '../../hooks/messages'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout'; +import { LocalizeText } from '../../utils/LocalizeText'; +import { WiredActionBaseView } from './views/actions/base/WiredActionBaseView'; +import { WiredConditionBaseView } from './views/conditions/base/WiredConditionBaseView'; +import { WiredTriggerBaseView } from './views/triggers/base/WiredTriggerBaseView'; +import { WiredFurniSelectorViewProps } from './WiredView.types'; + +export const WiredView: FC = props => +{ + const [ wiredDefinition, setWiredDefinition ] = useState(null); + const [ name, setName ] = useState(null); + const [ description, setDescription ] = useState(null); + + useEffect(() => + { + if(!wiredDefinition) return; + + const itemData = Nitro.instance.sessionDataManager.getFloorItemData(wiredDefinition.spriteId); + + if(!itemData) return; + + setName(itemData.name); + setDescription(itemData.description); + }, [ wiredDefinition ]); + + const getWiredType = useCallback(() => + { + if(wiredDefinition instanceof TriggerDefinition) + return 'trigger'; + else if(wiredDefinition instanceof ConditionDefinition) + return 'condition'; + else + return 'action'; + + }, [ wiredDefinition ]); + + const getTypeBase = useCallback(() => + { + if(wiredDefinition instanceof TriggerDefinition) + return ; + else if(wiredDefinition instanceof ConditionDefinition) + return ; + else + return ; + + }, [ wiredDefinition ]); + + const onWiredFurniEvent = useCallback((event: WiredFurniTriggerEvent | WiredFurniConditionEvent | WiredFurniActionEvent) => + { + setWiredDefinition(event.getParser().definition); + }, [ setWiredDefinition ]); + + CreateMessageHook(WiredFurniTriggerEvent, onWiredFurniEvent); + CreateMessageHook(WiredFurniConditionEvent, onWiredFurniEvent); + CreateMessageHook(WiredFurniActionEvent, onWiredFurniEvent); + + if(!wiredDefinition) return null; + + return ( + + {} } /> + +
+ +
{ name }
+
+
{ description }
+
+ { getTypeBase() } +
+
+ + +
+
+
+ ); +}; diff --git a/src/views/wired/WiredView.types.ts b/src/views/wired/WiredView.types.ts new file mode 100644 index 00000000..44aaf900 --- /dev/null +++ b/src/views/wired/WiredView.types.ts @@ -0,0 +1,9 @@ +import { ConditionDefinition, TriggerDefinition, WiredActionDefinition } from 'nitro-renderer'; + +export class WiredFurniSelectorViewProps +{} + +export class WiredLayoutViewProps +{ + wiredDefinition: TriggerDefinition | WiredActionDefinition | ConditionDefinition; +} diff --git a/src/views/wired/utils/IWiredLayout.ts b/src/views/wired/utils/IWiredLayout.ts new file mode 100644 index 00000000..96d965d5 --- /dev/null +++ b/src/views/wired/utils/IWiredLayout.ts @@ -0,0 +1,4 @@ +export interface IWiredLayout +{ + code: number; +} diff --git a/src/views/wired/utils/WiredActionLayout.ts b/src/views/wired/utils/WiredActionLayout.ts new file mode 100644 index 00000000..78ec45d2 --- /dev/null +++ b/src/views/wired/utils/WiredActionLayout.ts @@ -0,0 +1,29 @@ +export class WiredActionLayout +{ + public static TOGGLE_FURNI_STATE: number = 0; + public static RESET: number = 1; + public static SET_FURNI_STATE: number = 3; + public static MOVE_FURNI: number = 4; + public static GIVE_SCORE: number = 6; + public static CHAT: number = 7; + public static TELEPORT: number = 8; + public static JOIN_TEAM: number = 9; + public static LEAVE_TEAM: number = 10; + public static CHASE: number = 11; + public static FLEE: number = 12; + public static MOVE_TO_DIRECTION: number = 13; + public static GIVE_SCORE_TO_PREDEFINED_TEAM: number = 14; + public static TOGGLE_TO_RANDOM_STATE: number = 15; + public static MOVE_FURNI_TO: number = 16; + public static GIVE_REWARD: number = 17; + public static CALL_ANOTHER_STACK: number = 18; + public static KICK_FROM_ROOM: number = 19; + public static MUTE_USER: number = 20; + public static BOT_TELEPORT: number = 21; + public static BOT_MOVE: number = 22; + public static BOT_TALK: number = 23; + public static BOT_GIVE_HAND_ITEM: number = 24; + public static BOT_FOLLOW_AVATAR: number = 25; + public static BOT_CHANGE_FIGURE: number = 26; + public static BOT_TALK_DIRECT_TO_AVTR: number = 27; +} diff --git a/src/views/wired/views/actions/base/WiredActionBaseView.tsx b/src/views/wired/views/actions/base/WiredActionBaseView.tsx new file mode 100644 index 00000000..42422a86 --- /dev/null +++ b/src/views/wired/views/actions/base/WiredActionBaseView.tsx @@ -0,0 +1,26 @@ +import { ConditionDefinition, TriggerDefinition, WiredActionDefinition } from 'nitro-renderer'; +import { FC, useCallback } from 'react'; +import { WiredActionLayout } from '../../../utils/WiredActionLayout'; +import { WiredActionToggleFurniStateView } from '../toggle-furni-state/WiredActionToggleFurniStateView'; + +export const WiredActionBaseView: FC<{ wiredDefinition: TriggerDefinition | WiredActionDefinition | ConditionDefinition }> = props => +{ + const { wiredDefinition = null } = props; + + const getActionlayout = useCallback((code: number) => + { + switch(code) + { + case WiredActionLayout.TOGGLE_FURNI_STATE: + return ; + default: + return null; + } + }, [ wiredDefinition ]); + + return ( + <> + { wiredDefinition && getActionlayout(wiredDefinition.code) } + + ); +} diff --git a/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx b/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx new file mode 100644 index 00000000..a1e47312 --- /dev/null +++ b/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx @@ -0,0 +1,12 @@ +import { FC } from 'react'; +import { WiredLayoutViewProps } from '../../../WiredView.types'; +import { WiredFurniSelectorView } from '../../furni-selector/WiredFurniSelectorView'; + +export const WiredActionToggleFurniStateView: FC = props => +{ + return ( + <> + + + ); +}; diff --git a/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx b/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx new file mode 100644 index 00000000..05ed3e90 --- /dev/null +++ b/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx @@ -0,0 +1,14 @@ +import { FC, useCallback, useState } from 'react'; +import { IWiredLayout } from '../../../utils/IWiredLayout'; + +export const WiredConditionBaseView: FC<{}> = props => +{ + const [ conditionLayouts, setConditionLayouts ] = useState([]); + + const RegisterActionLayout = useCallback((layout: IWiredLayout) => + { + setConditionLayouts(layouts => [...layouts, layout]); + }, [ setConditionLayouts ]); + + return null; +}; diff --git a/src/views/wired/views/furni-selector/WiredFurniSelectorView.tsx b/src/views/wired/views/furni-selector/WiredFurniSelectorView.tsx new file mode 100644 index 00000000..a9b3a38e --- /dev/null +++ b/src/views/wired/views/furni-selector/WiredFurniSelectorView.tsx @@ -0,0 +1,17 @@ +import { FC } from 'react'; +import { LocalizeText } from '../../../../utils/LocalizeText'; +import { WiredFurniSelectorViewProps } from './WiredFurniSelectorView.types'; + +export const WiredFurniSelectorView: FC = props => +{ + const { selectedItemsCount = null, maximumItemsCount = null } = props; + + return ( + <> +
+
{ LocalizeText('wiredfurni.pickfurnis.caption', ['count', 'limit'], [selectedItemsCount.toString(), maximumItemsCount.toString()]) }
+
{ LocalizeText('wiredfurni.pickfurnis.desc') }
+
+ + ); +} diff --git a/src/views/wired/views/furni-selector/WiredFurniSelectorView.types.ts b/src/views/wired/views/furni-selector/WiredFurniSelectorView.types.ts new file mode 100644 index 00000000..88144289 --- /dev/null +++ b/src/views/wired/views/furni-selector/WiredFurniSelectorView.types.ts @@ -0,0 +1,5 @@ +export class WiredFurniSelectorViewProps +{ + selectedItemsCount: number; + maximumItemsCount: number; +} diff --git a/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx b/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx new file mode 100644 index 00000000..05071f98 --- /dev/null +++ b/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx @@ -0,0 +1,14 @@ +import { FC, useCallback, useState } from 'react'; +import { IWiredLayout } from '../../../utils/IWiredLayout'; + +export const WiredTriggerBaseView: FC<{}> = props => +{ + const [ triggerLayouts, setTriggerLayouts ] = useState([]); + + const RegisterActionLayout = useCallback((layout: IWiredLayout) => + { + setTriggerLayouts(layouts => [...layouts, layout]); + }, [ setTriggerLayouts ]); + + return null; +}; From 8977cccbd34e044f22557704d2caf10b584c3c9d Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 28 Jun 2021 12:32:06 -0400 Subject: [PATCH 02/22] Add base wired & saving --- .vscode/settings.json | 3 +- package-lock.json | 14 +++ package.json | 2 + src/events/index.ts | 1 + src/events/wired/WiredEvent.ts | 6 ++ src/events/wired/index.ts | 1 + src/index.scss | 1 + src/views/wired/WiredMessageHandler.tsx | 58 ++++++++++- src/views/wired/WiredView.tsx | 97 ++++++------------- src/views/wired/WiredView.types.ts | 8 ++ .../wired/common/GetWiredActionLayout.tsx | 14 +++ src/views/wired/common/GetWiredLayout.tsx | 9 ++ src/views/wired/common/GetWiredTimeLocale.ts | 8 ++ .../wired/common/WiredActionLayoutCode.ts | 29 ++++++ src/views/wired/context/WiredContext.tsx | 22 +++++ src/views/wired/context/WiredContext.types.ts | 21 ++++ src/views/wired/utils/IWiredLayout.ts | 4 - src/views/wired/utils/WiredActionLayout.ts | 29 ------ .../actions/base/WiredActionBaseView.tsx | 57 +++++++---- .../actions/base/WiredActionBaseView.types.ts | 5 + .../WiredActionBotChangeFigureView.tsx | 50 ++++++++++ .../WiredActionBotFollowAvatarView.tsx | 23 +++++ .../WiredActionToggleFurniStateView.tsx | 12 --- src/views/wired/views/base/WiredBaseView.tsx | 79 +++++++++++++++ .../wired/views/base/WiredBaseView.types.ts | 6 ++ .../base/WiredConditionBaseView.tsx | 14 --- .../triggers/base/WiredTriggerBaseView.tsx | 14 --- 27 files changed, 425 insertions(+), 162 deletions(-) create mode 100644 src/events/wired/WiredEvent.ts create mode 100644 src/events/wired/index.ts create mode 100644 src/views/wired/common/GetWiredActionLayout.tsx create mode 100644 src/views/wired/common/GetWiredLayout.tsx create mode 100644 src/views/wired/common/GetWiredTimeLocale.ts create mode 100644 src/views/wired/common/WiredActionLayoutCode.ts create mode 100644 src/views/wired/context/WiredContext.tsx create mode 100644 src/views/wired/context/WiredContext.types.ts delete mode 100644 src/views/wired/utils/IWiredLayout.ts delete mode 100644 src/views/wired/utils/WiredActionLayout.ts create mode 100644 src/views/wired/views/actions/base/WiredActionBaseView.types.ts create mode 100644 src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx create mode 100644 src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx delete mode 100644 src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx create mode 100644 src/views/wired/views/base/WiredBaseView.tsx create mode 100644 src/views/wired/views/base/WiredBaseView.types.ts delete mode 100644 src/views/wired/views/conditions/base/WiredConditionBaseView.tsx delete mode 100644 src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json index 7b328b85..b0a56f10 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,6 @@ "git.ignoreLimitWarning": true, "files.eol": "\n", "files.insertFinalNewline": true, - "files.trimFinalNewlines": true + "files.trimFinalNewlines": true, + "editor.wordWrap": "on" } diff --git a/package-lock.json b/package-lock.json index 66944ba0..3dc7f9fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2376,6 +2376,15 @@ "redux": "^4.0.0" } }, + "@types/react-slider": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@types/react-slider/-/react-slider-1.3.0.tgz", + "integrity": "sha512-Hr+P8wiqYAjeFTlf+NWPVGWW79npC8V7KkZdbPlMqo+iblcopPzE/z0m8503j2YmfxoKJKaPnrJe0a6spXacYQ==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, "@types/react-transition-group": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.1.tgz", @@ -15061,6 +15070,11 @@ "workbox-webpack-plugin": "5.1.4" } }, + "react-slider": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/react-slider/-/react-slider-1.3.1.tgz", + "integrity": "sha512-bD8hHJJUgAHI8g1F6PY6432l+Dmcs2fqzUwDhd+0HWDdvfjwNoXRNC2cL9OWyGTjYlJM92A8nF/w1X4pyHfytQ==" + }, "react-transition-group": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz", diff --git a/package.json b/package.json index 82a862a6..260ece10 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "react-google-recaptcha": "^2.1.0", "react-redux": "^7.2.3", "react-scripts": "4.0.3", + "react-slider": "^1.3.1", "react-transition-group": "^4.4.1", "redux": "^4.0.5", "typescript": "^4.2.4", @@ -58,6 +59,7 @@ ] }, "devDependencies": { + "@types/react-slider": "^1.3.0", "@types/react-transition-group": "^4.4.1" } } diff --git a/src/events/index.ts b/src/events/index.ts index 9ec510a0..684c0bfa 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -5,3 +5,4 @@ export * from './inventory'; export * from './navigator'; export * from './notification-center'; export * from './room-widgets'; +export * from './wired'; diff --git a/src/events/wired/WiredEvent.ts b/src/events/wired/WiredEvent.ts new file mode 100644 index 00000000..d5959215 --- /dev/null +++ b/src/events/wired/WiredEvent.ts @@ -0,0 +1,6 @@ +import { NitroEvent } from 'nitro-renderer'; + +export class WiredEvent extends NitroEvent +{ + public static SAVE_WIRED: string = 'WE_SAVE_WIRED'; +} diff --git a/src/events/wired/index.ts b/src/events/wired/index.ts new file mode 100644 index 00000000..9f43fa22 --- /dev/null +++ b/src/events/wired/index.ts @@ -0,0 +1 @@ +export * from './WiredEvent'; diff --git a/src/index.scss b/src/index.scss index d1c389d9..08696a5c 100644 --- a/src/index.scss +++ b/src/index.scss @@ -1,5 +1,6 @@ @import url('https://fonts.googleapis.com/css2?family=Ubuntu+Condensed:wght@300;400;500&display=swap'); @import '../node_modules/animate.css/animate.css'; +@import '../node_modules/rc-slider/assets/index.css'; @import './assets/styles'; html, diff --git a/src/views/wired/WiredMessageHandler.tsx b/src/views/wired/WiredMessageHandler.tsx index 30990fc4..cae3aed7 100644 --- a/src/views/wired/WiredMessageHandler.tsx +++ b/src/views/wired/WiredMessageHandler.tsx @@ -1,6 +1,62 @@ -import { FC } from 'react'; +import { WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredRewardResultMessageEvent, WiredSaveSuccessEvent, WiredValidationErrorEvent } from 'nitro-renderer'; +import { FC, useCallback } from 'react'; +import { CreateMessageHook } from '../../hooks/messages'; +import { useWiredContext } from './context/WiredContext'; export const WiredMessageHandler: FC<{}> = props => { + const { setTrigger = null } = useWiredContext(); + + const onWiredFurniActionEvent = useCallback((event: WiredFurniActionEvent) => + { + const parser = event.getParser(); + + setTrigger(parser.definition); + }, [ setTrigger ]); + + const onWiredFurniConditionEvent = useCallback((event: WiredFurniConditionEvent) => + { + const parser = event.getParser(); + + setTrigger(parser.definition); + }, [ setTrigger ]); + + const onWiredFurniTriggerEvent = useCallback((event: WiredFurniTriggerEvent) => + { + const parser = event.getParser(); + + setTrigger(parser.definition); + }, [ setTrigger ]); + + const onWiredOpenEvent = useCallback((event: WiredOpenEvent) => + { + const parser = event.getParser(); + }, []); + + const onWiredRewardResultMessageEvent = useCallback((event: WiredRewardResultMessageEvent) => + { + const parser = event.getParser(); + }, []); + + const onWiredSaveSuccessEvent = useCallback((event: WiredSaveSuccessEvent) => + { + const parser = event.getParser(); + + setTrigger(null); + }, [ setTrigger ]); + + const onWiredValidationErrorEvent = useCallback((event: WiredValidationErrorEvent) => + { + const parser = event.getParser(); + }, []); + + CreateMessageHook(WiredFurniActionEvent, onWiredFurniActionEvent); + CreateMessageHook(WiredFurniConditionEvent, onWiredFurniConditionEvent); + CreateMessageHook(WiredFurniTriggerEvent, onWiredFurniTriggerEvent); + CreateMessageHook(WiredOpenEvent, onWiredOpenEvent); + CreateMessageHook(WiredRewardResultMessageEvent, onWiredRewardResultMessageEvent); + CreateMessageHook(WiredSaveSuccessEvent, onWiredSaveSuccessEvent); + CreateMessageHook(WiredValidationErrorEvent, onWiredValidationErrorEvent); + return null; }; diff --git a/src/views/wired/WiredView.tsx b/src/views/wired/WiredView.tsx index 67b2cbad..7d6faba1 100644 --- a/src/views/wired/WiredView.tsx +++ b/src/views/wired/WiredView.tsx @@ -1,81 +1,42 @@ -import { ConditionDefinition, Nitro, TriggerDefinition, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent } from 'nitro-renderer'; -import { FC, useCallback, useEffect, useState } from 'react'; -import { CreateMessageHook } from '../../hooks/messages'; -import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout'; -import { LocalizeText } from '../../utils/LocalizeText'; -import { WiredActionBaseView } from './views/actions/base/WiredActionBaseView'; -import { WiredConditionBaseView } from './views/conditions/base/WiredConditionBaseView'; -import { WiredTriggerBaseView } from './views/triggers/base/WiredTriggerBaseView'; +import { Triggerable, UpdateActionMessageComposer, WiredActionDefinition } from 'nitro-renderer'; +import { FC, useCallback, useMemo, useState } from 'react'; +import { GetConnection } from '../../api'; +import { WiredEvent } from '../../events'; +import { useUiEvent } from '../../hooks/events'; +import { GetWiredLayout } from './common/GetWiredLayout'; +import { WiredContextProvider } from './context/WiredContext'; +import { WiredMessageHandler } from './WiredMessageHandler'; import { WiredFurniSelectorViewProps } from './WiredView.types'; export const WiredView: FC = props => { - const [ wiredDefinition, setWiredDefinition ] = useState(null); - const [ name, setName ] = useState(null); - const [ description, setDescription ] = useState(null); + const [ trigger, setTrigger ] = useState(null); + const [ intParams, setIntParams ] = useState(null); + const [ stringParam, setStringParam ] = useState(null); + const [ furniIds, setFurniIds ] = useState(null); + const [ actionDelay, setActionDelay ] = useState(null); - useEffect(() => + const wiredLayout = useMemo(() => { - if(!wiredDefinition) return; + return GetWiredLayout(trigger); + }, [ trigger ]); - const itemData = Nitro.instance.sessionDataManager.getFloorItemData(wiredDefinition.spriteId); - - if(!itemData) return; - - setName(itemData.name); - setDescription(itemData.description); - }, [ wiredDefinition ]); - - const getWiredType = useCallback(() => + const onWiredEvent = useCallback((event: WiredEvent) => { - if(wiredDefinition instanceof TriggerDefinition) - return 'trigger'; - else if(wiredDefinition instanceof ConditionDefinition) - return 'condition'; - else - return 'action'; + // check if owner & warn with confirm + + if(trigger instanceof WiredActionDefinition) + { + GetConnection().send(new UpdateActionMessageComposer(trigger.id, intParams, stringParam, furniIds, actionDelay, trigger.stuffTypeSelectionCode)); + } + }, [ trigger, intParams, stringParam, furniIds, actionDelay ]); - }, [ wiredDefinition ]); - - const getTypeBase = useCallback(() => - { - if(wiredDefinition instanceof TriggerDefinition) - return ; - else if(wiredDefinition instanceof ConditionDefinition) - return ; - else - return ; - - }, [ wiredDefinition ]); - - const onWiredFurniEvent = useCallback((event: WiredFurniTriggerEvent | WiredFurniConditionEvent | WiredFurniActionEvent) => - { - setWiredDefinition(event.getParser().definition); - }, [ setWiredDefinition ]); - - CreateMessageHook(WiredFurniTriggerEvent, onWiredFurniEvent); - CreateMessageHook(WiredFurniConditionEvent, onWiredFurniEvent); - CreateMessageHook(WiredFurniActionEvent, onWiredFurniEvent); - - if(!wiredDefinition) return null; + useUiEvent(WiredEvent.SAVE_WIRED, onWiredEvent); return ( - - {} } /> - -
- -
{ name }
-
-
{ description }
-
- { getTypeBase() } -
-
- - -
-
-
+ + + { wiredLayout } + ); }; diff --git a/src/views/wired/WiredView.types.ts b/src/views/wired/WiredView.types.ts index 44aaf900..ca325cc3 100644 --- a/src/views/wired/WiredView.types.ts +++ b/src/views/wired/WiredView.types.ts @@ -7,3 +7,11 @@ export class WiredLayoutViewProps { wiredDefinition: TriggerDefinition | WiredActionDefinition | ConditionDefinition; } + +export class WiredFurniType +{ + public static _Str_5431: number = 0; + public static _Str_4873: number = 1; + public static _Str_4991: number = 2; + public static _Str_5430: number = 3; +} diff --git a/src/views/wired/common/GetWiredActionLayout.tsx b/src/views/wired/common/GetWiredActionLayout.tsx new file mode 100644 index 00000000..b9ce455f --- /dev/null +++ b/src/views/wired/common/GetWiredActionLayout.tsx @@ -0,0 +1,14 @@ +import { WiredActionBotChangeFigureView } from '../views/actions/bot-change-figure/WiredActionBotChangeFigureView'; +import { WiredActionBotFollowAvatarView } from '../views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView'; +import { WiredActionLayout } from './WiredActionLayoutCode'; + +export function GetWiredActionLayout(code: number): JSX.Element +{ + switch(code) + { + case WiredActionLayout.BOT_CHANGE_FIGURE: + return ; + case WiredActionLayout.BOT_FOLLOW_AVATAR: + return ; + } +} diff --git a/src/views/wired/common/GetWiredLayout.tsx b/src/views/wired/common/GetWiredLayout.tsx new file mode 100644 index 00000000..5f3ed3cf --- /dev/null +++ b/src/views/wired/common/GetWiredLayout.tsx @@ -0,0 +1,9 @@ +import { Triggerable, WiredActionDefinition } from 'nitro-renderer'; +import { GetWiredActionLayout } from './GetWiredActionLayout'; + +export function GetWiredLayout(trigger: Triggerable): JSX.Element +{ + if(trigger instanceof WiredActionDefinition) return GetWiredActionLayout(trigger.code); + + return null; +} diff --git a/src/views/wired/common/GetWiredTimeLocale.ts b/src/views/wired/common/GetWiredTimeLocale.ts new file mode 100644 index 00000000..02aa3b4e --- /dev/null +++ b/src/views/wired/common/GetWiredTimeLocale.ts @@ -0,0 +1,8 @@ +export function GetWiredTimeLocale(value: number): string +{ + const time = Math.floor((value / 2)); + + if(!(value % 2)) return time.toString(); + + return (time + 0.5).toString(); +} diff --git a/src/views/wired/common/WiredActionLayoutCode.ts b/src/views/wired/common/WiredActionLayoutCode.ts new file mode 100644 index 00000000..d501c152 --- /dev/null +++ b/src/views/wired/common/WiredActionLayoutCode.ts @@ -0,0 +1,29 @@ +export class WiredActionLayout +{ + public static TOGGLE_FURNI_STATE: number = 0; + public static RESET: number = 1; + public static SET_FURNI_STATE: number = 3; + public static MOVE_FURNI: number = 4; + public static GIVE_SCORE: number = 6; + public static CHAT: number = 7; + public static TELEPORT: number = 8; + public static JOIN_TEAM: number = 9; + public static LEAVE_TEAM: number = 10; + public static CHASE: number = 11; + public static FLEE: number = 12; + public static MOVE_TO_DIRECTION: number = 13; + public static GIVE_SCORE_TO_PREDEFINED_TEAM: number = 14; + public static TOGGLE_TO_RANDOM_STATE: number = 15; + public static MOVE_FURNI_TO: number = 16; + public static GIVE_REWARD: number = 17; + public static CALL_ANOTHER_STACK: number = 18; + public static KICK_FROM_ROOM: number = 19; + public static MUTE_USER: number = 20; + public static BOT_TELEPORT: number = 21; + public static BOT_MOVE: number = 22; + public static BOT_TALK: number = 23; + public static BOT_GIVE_HAND_ITEM: number = 24; + public static BOT_FOLLOW_AVATAR: number = 25; + public static BOT_CHANGE_FIGURE: number = 26; + public static BOT_TALK_DIRECT_TO_AVTR: number = 27; +} diff --git a/src/views/wired/context/WiredContext.tsx b/src/views/wired/context/WiredContext.tsx new file mode 100644 index 00000000..26c42a7a --- /dev/null +++ b/src/views/wired/context/WiredContext.tsx @@ -0,0 +1,22 @@ +import { createContext, FC, useContext } from 'react'; +import { IWiredContext, WiredContextProps } from './WiredContext.types'; + +const WiredContext = createContext({ + trigger: null, + setTrigger: null, + intParams: null, + setIntParams: null, + stringParam: null, + setStringParam: null, + furniIds: null, + setFurniIds: null, + actionDelay: null, + setActionDelay: null +}); + +export const WiredContextProvider: FC = props => +{ + return { props.children } +} + +export const useWiredContext = () => useContext(WiredContext); diff --git a/src/views/wired/context/WiredContext.types.ts b/src/views/wired/context/WiredContext.types.ts new file mode 100644 index 00000000..18e9c5ae --- /dev/null +++ b/src/views/wired/context/WiredContext.types.ts @@ -0,0 +1,21 @@ +import { Triggerable } from 'nitro-renderer'; +import { Dispatch, ProviderProps, SetStateAction } from 'react'; + +export interface IWiredContext +{ + trigger: Triggerable; + setTrigger: Dispatch>; + intParams: number[], + setIntParams: Dispatch>; + stringParam: string; + setStringParam: Dispatch>; + furniIds: number[]; + setFurniIds: Dispatch>; + actionDelay: number; + setActionDelay: Dispatch>; +} + +export interface WiredContextProps extends ProviderProps +{ + +} diff --git a/src/views/wired/utils/IWiredLayout.ts b/src/views/wired/utils/IWiredLayout.ts deleted file mode 100644 index 96d965d5..00000000 --- a/src/views/wired/utils/IWiredLayout.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IWiredLayout -{ - code: number; -} diff --git a/src/views/wired/utils/WiredActionLayout.ts b/src/views/wired/utils/WiredActionLayout.ts deleted file mode 100644 index 78ec45d2..00000000 --- a/src/views/wired/utils/WiredActionLayout.ts +++ /dev/null @@ -1,29 +0,0 @@ -export class WiredActionLayout -{ - public static TOGGLE_FURNI_STATE: number = 0; - public static RESET: number = 1; - public static SET_FURNI_STATE: number = 3; - public static MOVE_FURNI: number = 4; - public static GIVE_SCORE: number = 6; - public static CHAT: number = 7; - public static TELEPORT: number = 8; - public static JOIN_TEAM: number = 9; - public static LEAVE_TEAM: number = 10; - public static CHASE: number = 11; - public static FLEE: number = 12; - public static MOVE_TO_DIRECTION: number = 13; - public static GIVE_SCORE_TO_PREDEFINED_TEAM: number = 14; - public static TOGGLE_TO_RANDOM_STATE: number = 15; - public static MOVE_FURNI_TO: number = 16; - public static GIVE_REWARD: number = 17; - public static CALL_ANOTHER_STACK: number = 18; - public static KICK_FROM_ROOM: number = 19; - public static MUTE_USER: number = 20; - public static BOT_TELEPORT: number = 21; - public static BOT_MOVE: number = 22; - public static BOT_TALK: number = 23; - public static BOT_GIVE_HAND_ITEM: number = 24; - public static BOT_FOLLOW_AVATAR: number = 25; - public static BOT_CHANGE_FIGURE: number = 26; - public static BOT_TALK_DIRECT_TO_AVTR: number = 27; -} diff --git a/src/views/wired/views/actions/base/WiredActionBaseView.tsx b/src/views/wired/views/actions/base/WiredActionBaseView.tsx index 42422a86..0c442703 100644 --- a/src/views/wired/views/actions/base/WiredActionBaseView.tsx +++ b/src/views/wired/views/actions/base/WiredActionBaseView.tsx @@ -1,26 +1,45 @@ -import { ConditionDefinition, TriggerDefinition, WiredActionDefinition } from 'nitro-renderer'; -import { FC, useCallback } from 'react'; -import { WiredActionLayout } from '../../../utils/WiredActionLayout'; -import { WiredActionToggleFurniStateView } from '../toggle-furni-state/WiredActionToggleFurniStateView'; +import { WiredActionDefinition } from 'nitro-renderer'; +import Slider from 'rc-slider'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { LocalizeText } from '../../../../../utils/LocalizeText'; +import { GetWiredTimeLocale } from '../../../common/GetWiredTimeLocale'; +import { useWiredContext } from '../../../context/WiredContext'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredBaseView } from '../../base/WiredBaseView'; +import { WiredActionBaseViewProps } from './WiredActionBaseView.types'; -export const WiredActionBaseView: FC<{ wiredDefinition: TriggerDefinition | WiredActionDefinition | ConditionDefinition }> = props => +export const WiredActionBaseView: FC = props => { - const { wiredDefinition = null } = props; + const { requiresFurni = WiredFurniType._Str_5431, save = null, children = null } = props; + const [ delay, setDelay ] = useState(-1); + const { trigger = null, setActionDelay = null } = useWiredContext(); - const getActionlayout = useCallback((code: number) => + useEffect(() => { - switch(code) - { - case WiredActionLayout.TOGGLE_FURNI_STATE: - return ; - default: - return null; - } - }, [ wiredDefinition ]); - + setDelay((trigger as WiredActionDefinition).delayInPulses); + }, [ trigger ]); + + const onSave = useCallback(() => + { + if(save) save(); + + setActionDelay(delay); + }, [ delay, save, setActionDelay ]); + return ( - <> - { wiredDefinition && getActionlayout(wiredDefinition.code) } - + + { children } +
+
+ { LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) } + setDelay(event) } + /> +
+
); } diff --git a/src/views/wired/views/actions/base/WiredActionBaseView.types.ts b/src/views/wired/views/actions/base/WiredActionBaseView.types.ts new file mode 100644 index 00000000..ef514b76 --- /dev/null +++ b/src/views/wired/views/actions/base/WiredActionBaseView.types.ts @@ -0,0 +1,5 @@ +export interface WiredActionBaseViewProps +{ + requiresFurni: number; + save: () => void; +} diff --git a/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx b/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx new file mode 100644 index 00000000..22997faa --- /dev/null +++ b/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx @@ -0,0 +1,50 @@ +import { FC, useCallback, useEffect, useState } from 'react'; +import { GetSessionDataManager } from '../../../../../api'; +import { LocalizeText } from '../../../../../utils/LocalizeText'; +import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView'; +import { useWiredContext } from '../../../context/WiredContext'; +import { WiredFurniType } from '../../../WiredView.types'; +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'; + +export const WiredActionBotChangeFigureView: FC<{}> = props => +{ + const [ botName, setBotName ] = useState(''); + const [ figure, setFigure ] = useState(''); + const { trigger = null, setStringParam = null } = useWiredContext(); + + useEffect(() => + { + const data = trigger.stringData.split(DELIMETER); + + console.log(data); + + if(data.length > 0) setBotName(data[0]); + if(data.length > 1) setFigure(data[1].length > 0 ? data[1] : DEFAULT_FIGURE); + }, [ trigger ]); + + const copyLooks = useCallback(() => + { + setFigure(GetSessionDataManager().figure); + }, []); + + const save = useCallback(() => + { + setStringParam((botName + DELIMETER + figure)); + }, [ botName, figure, setStringParam ]); + + return ( + +
+ + setBotName(event.target.value) } /> +
+
+ + +
+
+ ); +} diff --git a/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx new file mode 100644 index 00000000..15840fec --- /dev/null +++ b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx @@ -0,0 +1,23 @@ +import { FC, useEffect, useState } from 'react'; +import { useWiredContext } from '../../../context/WiredContext'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionBotFollowAvatarView: FC<{}> = props => +{ + const [ botName, setBotName ] = useState(''); + const [ followMode, setFollowMode ] = useState(-1); + const { trigger = null, setStringParam = null } = useWiredContext(); + + useEffect(() => + { + setBotName(trigger.stringData); + setFollowMode((trigger.intData.length > 0) ? trigger.intData[0] : 0); + }, [ trigger ]); + + return ( + + BOT_CHANGE_FIGURE + + ); +} diff --git a/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx b/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx deleted file mode 100644 index a1e47312..00000000 --- a/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { FC } from 'react'; -import { WiredLayoutViewProps } from '../../../WiredView.types'; -import { WiredFurniSelectorView } from '../../furni-selector/WiredFurniSelectorView'; - -export const WiredActionToggleFurniStateView: FC = props => -{ - return ( - <> - - - ); -}; diff --git a/src/views/wired/views/base/WiredBaseView.tsx b/src/views/wired/views/base/WiredBaseView.tsx new file mode 100644 index 00000000..26fa821a --- /dev/null +++ b/src/views/wired/views/base/WiredBaseView.tsx @@ -0,0 +1,79 @@ +import { FC, useCallback, useEffect, useState } from 'react'; +import { GetSessionDataManager } from '../../../../api'; +import { WiredEvent } from '../../../../events'; +import { dispatchUiEvent } from '../../../../hooks/events'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../layout'; +import { LocalizeText } from '../../../../utils/LocalizeText'; +import { useWiredContext } from '../../context/WiredContext'; +import { WiredFurniType } from '../../WiredView.types'; +import { WiredBaseViewProps } from './WiredBaseView.types'; + +export const WiredBaseView: FC = props => +{ + const { wiredType = '', requiresFurni = WiredFurniType._Str_5431, save = null, children = null } = props; + const [ wiredName, setWiredName ] = useState(null); + const [ wiredDescription, setWiredDescription ] = useState(null); + const { trigger = null, setTrigger = null, setIntParams = null, setStringParam = null, setFurniIds = null } = useWiredContext(); + + useEffect(() => + { + if(!trigger) return; + + const spriteId = (trigger.spriteId || -1); + + const furniData = GetSessionDataManager().getFloorItemData(spriteId); + + if(!furniData) + { + setWiredName(('NAME: ' + spriteId)); + setWiredDescription(('NAME: ' + spriteId)); + } + else + { + setWiredName(furniData.name); + setWiredDescription(furniData.description); + } + + setIntParams(trigger.intData); + setStringParam(trigger.stringData); + setFurniIds(trigger.selectedItems); + }, [ trigger, setIntParams, setStringParam, setFurniIds ]); + + const onSave = useCallback(() => + { + if(save) save(); + + setTimeout(() => dispatchUiEvent(new WiredEvent(WiredEvent.SAVE_WIRED)), 1); + }, [ save ]); + + const close = useCallback(() => + { + setTrigger(null); + }, [ setTrigger ]); + + return ( + + + +
+ +
{ wiredName }
+
+
{ wiredDescription }
+
+
+ { children } +
+ { (requiresFurni !== WiredFurniType._Str_5431) && +
+ { LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ '0', '0' ]) } + { LocalizeText('wiredfurni.pickfurnis.desc') } +
} +
+ + +
+
+
+ ); +} diff --git a/src/views/wired/views/base/WiredBaseView.types.ts b/src/views/wired/views/base/WiredBaseView.types.ts new file mode 100644 index 00000000..b38c08da --- /dev/null +++ b/src/views/wired/views/base/WiredBaseView.types.ts @@ -0,0 +1,6 @@ +export interface WiredBaseViewProps +{ + wiredType: string; + requiresFurni: number; + save: () => void; +} diff --git a/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx b/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx deleted file mode 100644 index 05ed3e90..00000000 --- a/src/views/wired/views/conditions/base/WiredConditionBaseView.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { FC, useCallback, useState } from 'react'; -import { IWiredLayout } from '../../../utils/IWiredLayout'; - -export const WiredConditionBaseView: FC<{}> = props => -{ - const [ conditionLayouts, setConditionLayouts ] = useState([]); - - const RegisterActionLayout = useCallback((layout: IWiredLayout) => - { - setConditionLayouts(layouts => [...layouts, layout]); - }, [ setConditionLayouts ]); - - return null; -}; diff --git a/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx b/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx deleted file mode 100644 index 05071f98..00000000 --- a/src/views/wired/views/triggers/base/WiredTriggerBaseView.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { FC, useCallback, useState } from 'react'; -import { IWiredLayout } from '../../../utils/IWiredLayout'; - -export const WiredTriggerBaseView: FC<{}> = props => -{ - const [ triggerLayouts, setTriggerLayouts ] = useState([]); - - const RegisterActionLayout = useCallback((layout: IWiredLayout) => - { - setTriggerLayouts(layouts => [...layouts, layout]); - }, [ setTriggerLayouts ]); - - return null; -}; From a55a78d6b59600a0374c0087d2f15f887f81b898 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 28 Jun 2021 12:34:24 -0400 Subject: [PATCH 03/22] Update package.json --- package-lock.json | 85 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 81 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3dc7f9fa..4bd0f3e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5277,6 +5277,11 @@ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz", "integrity": "sha512-TvrjBckDy2c6v6RLxPv5QXOnU+SmF9nBII5621Ve5fu6Z/BDrENurBEvlC1f44lKEUVqOpK4w9E5Idc5/EgkLQ==" }, + "dom-align": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/dom-align/-/dom-align-1.12.2.tgz", + "integrity": "sha512-pHuazgqrsTFrGU2WLDdXxCFabkdQDx72ddkraZNih1KsMcN5qsRSTR9O4VJRlwTPCPb5COYg3LOfiMHHcPInHg==" + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -14748,6 +14753,71 @@ } } }, + "rc-align": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/rc-align/-/rc-align-4.0.9.tgz", + "integrity": "sha512-myAM2R4qoB6LqBul0leaqY8gFaiECDJ3MtQDmzDo9xM9NRT/04TvWOYd2YHU9zvGzqk9QXF6S9/MifzSKDZeMw==", + "requires": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "dom-align": "^1.7.0", + "rc-util": "^5.3.0", + "resize-observer-polyfill": "^1.5.1" + } + }, + "rc-motion": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/rc-motion/-/rc-motion-2.4.4.tgz", + "integrity": "sha512-ms7n1+/TZQBS0Ydd2Q5P4+wJTSOrhIrwNxLXCZpR7Fa3/oac7Yi803HDALc2hLAKaCTQtw9LmQeB58zcwOsqlQ==", + "requires": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-util": "^5.2.1" + } + }, + "rc-slider": { + "version": "9.7.2", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-9.7.2.tgz", + "integrity": "sha512-mVaLRpDo6otasBs6yVnG02ykI3K6hIrLTNfT5eyaqduFv95UODI9PDS6fWuVVehVpdS4ENgOSwsTjrPVun+k9g==", + "requires": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.5", + "rc-tooltip": "^5.0.1", + "rc-util": "^5.0.0", + "shallowequal": "^1.1.0" + } + }, + "rc-tooltip": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/rc-tooltip/-/rc-tooltip-5.1.1.tgz", + "integrity": "sha512-alt8eGMJulio6+4/uDm7nvV+rJq9bsfxFDCI0ljPdbuoygUscbsMYb6EQgwib/uqsXQUvzk+S7A59uYHmEgmDA==", + "requires": { + "@babel/runtime": "^7.11.2", + "rc-trigger": "^5.0.0" + } + }, + "rc-trigger": { + "version": "5.2.9", + "resolved": "https://registry.npmjs.org/rc-trigger/-/rc-trigger-5.2.9.tgz", + "integrity": "sha512-0Bxsh2Xe+etejMn73am+jZBcOpsueAZiEKLiGoDfA0fvm/JHLNOiiww3zJ0qgyPOTmbYxhsxFcGOZu+VcbaZhQ==", + "requires": { + "@babel/runtime": "^7.11.2", + "classnames": "^2.2.6", + "rc-align": "^4.0.0", + "rc-motion": "^2.0.0", + "rc-util": "^5.5.0" + } + }, + "rc-util": { + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.13.1.tgz", + "integrity": "sha512-Dws2tjXBBihfjVQFlG5JzZ/5O3Wutctm0W94Wb1+M7GD2roWJPrQdSa4AkWm2pn0Ms32zoVPPkWodFeAYZPLfA==", + "requires": { + "@babel/runtime": "^7.12.5", + "react-is": "^16.12.0", + "shallowequal": "^1.1.0" + } + }, "react": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", @@ -15070,11 +15140,6 @@ "workbox-webpack-plugin": "5.1.4" } }, - "react-slider": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/react-slider/-/react-slider-1.3.1.tgz", - "integrity": "sha512-bD8hHJJUgAHI8g1F6PY6432l+Dmcs2fqzUwDhd+0HWDdvfjwNoXRNC2cL9OWyGTjYlJM92A8nF/w1X4pyHfytQ==" - }, "react-transition-group": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz", @@ -15444,6 +15509,11 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, "resolve": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", @@ -16234,6 +16304,11 @@ "safe-buffer": "^5.0.1" } }, + "shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", diff --git a/package.json b/package.json index 260ece10..f1be2c6c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "immutable": "^4.0.0-rc.12", "nitro-renderer": "file:../nitro-renderer", "node-sass": "^5.0.0", + "rc-slider": "^9.7.2", "react": "^17.0.2", "react-bootstrap": "^2.0.0-alpha.2", "react-dom": "^17.0.2", @@ -22,7 +23,6 @@ "react-google-recaptcha": "^2.1.0", "react-redux": "^7.2.3", "react-scripts": "4.0.3", - "react-slider": "^1.3.1", "react-transition-group": "^4.4.1", "redux": "^4.0.5", "typescript": "^4.2.4", From 2e5478481d2f1afeb28ebc3e27feae12ec1f9c8b Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 28 Jun 2021 18:18:34 -0300 Subject: [PATCH 04/22] Updates --- src/assets/images/wired/icon_wired_around.png | Bin 244 -> 197 bytes .../images/wired/icon_wired_left_right.png | Bin 217 -> 172 bytes .../images/wired/icon_wired_north_east.png | Bin 205 -> 157 bytes .../images/wired/icon_wired_north_west.png | Bin 207 -> 166 bytes .../wired/icon_wired_rotate_clockwise.png | Bin 187 -> 146 bytes .../icon_wired_rotate_counter_clockwise.png | Bin 192 -> 148 bytes .../images/wired/icon_wired_south_east.png | Bin 217 -> 171 bytes .../images/wired/icon_wired_south_west.png | Bin 209 -> 169 bytes .../images/wired/icon_wired_up_down.png | Bin 198 -> 153 bytes src/views/wired/WiredView.scss | 35 +++++++ src/views/wired/WiredView.types.ts | 2 + .../wired/common/GetWiredActionLayout.tsx | 51 +++++++++++ .../actions/base/WiredActionBaseView.tsx | 6 +- .../WiredActionBotChangeFigureView.tsx | 9 +- .../WiredActionBotFollowAvatarView.tsx | 30 +++++- .../WiredActionBotGiveHandItemView.tsx | 43 +++++++++ .../bot-move/WiredActionBotMoveView.tsx | 30 ++++++ .../WiredActionBotTalkToAvatarView.tsx | 54 +++++++++++ .../bot-talk/WiredActionBotTalkView.tsx | 54 +++++++++++ .../WiredActionBotTeleportView.tsx | 30 ++++++ .../WiredActionCallAnotherStackView.tsx | 10 ++ .../actions/chase/WiredActionChaseView.tsx | 10 ++ .../actions/chat/WiredActionChatView.tsx | 30 ++++++ .../actions/flee/WiredActionFleeView.tsx | 10 ++ .../join-team/WiredActionJoinTeamView.tsx | 37 ++++++++ .../WiredActionKickFromRoomView.tsx | 30 ++++++ .../leave-team/WiredActionLeaveTeamView.tsx | 10 ++ .../move-furni/WiredActionMoveFurniView.tsx | 86 ++++++++++++++++++ .../actions/reset/WiredActionResetView.tsx | 10 ++ .../WiredActionSetFurniStateToView.tsx | 48 ++++++++++ .../teleport/WiredActionTeleportView.tsx | 10 ++ .../WiredActionToggleFurniStateView.tsx | 10 ++ src/views/wired/views/base/WiredBaseView.tsx | 9 +- 33 files changed, 638 insertions(+), 16 deletions(-) create mode 100644 src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx create mode 100644 src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx create mode 100644 src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx create mode 100644 src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx create mode 100644 src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx create mode 100644 src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx create mode 100644 src/views/wired/views/actions/chase/WiredActionChaseView.tsx create mode 100644 src/views/wired/views/actions/chat/WiredActionChatView.tsx create mode 100644 src/views/wired/views/actions/flee/WiredActionFleeView.tsx create mode 100644 src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx create mode 100644 src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx create mode 100644 src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx create mode 100644 src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx create mode 100644 src/views/wired/views/actions/reset/WiredActionResetView.tsx create mode 100644 src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx create mode 100644 src/views/wired/views/actions/teleport/WiredActionTeleportView.tsx create mode 100644 src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx diff --git a/src/assets/images/wired/icon_wired_around.png b/src/assets/images/wired/icon_wired_around.png index 363913a900699883b60ff899180ef4a6fc7f0aa9..0b4b5a12545cb73a0f588dae5ad803c8954255af 100644 GIT binary patch delta 161 zcmV;S0ABy}0mT83EPoOJ01FZU(%pXi0001YNklXna00sm|fQn&L zi&e0I0Tl=U@d8o|fVm05AW=0rUZoEPoRK01FcV0GgZ_00001b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^ z1poj5iAh93RCob}kPQ)lAPj|P10oQC2t=@fMlb>qY#>dDf(?v-Z{GAg9Qf`Y$Is)t zZB%q+cq9?_v)p||4ZuP#;cVcj1&52GYlj1DVFnsCC7=~{a7ieA9g=Z(MGWv2um`DI zv%GA)DV;%8;>;v}5_N)!tCL`Cg){*7>6KY|dHV%CWmccF7CZp}I<0BfF#pT|0000< KMNUMnLSTY{DNJ<$ diff --git a/src/assets/images/wired/icon_wired_left_right.png b/src/assets/images/wired/icon_wired_left_right.png index 9e1b450088022251cc17a08e068399932c77d8dc..862d6d8138b8d597bd57b732bd0ca62e9c5db082 100644 GIT binary patch delta 136 zcmV;30C)e{0jvR#EPoOJ01FZU(%pXi00019NklA*k&z-BwhEAhl=1^^j%I!G4J0}}uM002ovPDHLkU;%=_IWTMh delta 181 zcmV;m080O?0oehNEPoRK01FcV0GgZ_00001b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^ z1poj5Zb?KzRCocEkWmeQFbqU10SQPz0#3jQNWcL&Kmt-G0SU*Iz|Ycd-6e0?l3v%V zNI(E)l3*y}*9ILqnj3t^h1_t|YSi~ihJPY2ul3`mjkDTbk1ky=g+-ljVIildi;NQ3 jFpQjaV`YLwrilLmh9(zzrn{xR00000NkvXXu0mjf?f63F diff --git a/src/assets/images/wired/icon_wired_north_east.png b/src/assets/images/wired/icon_wired_north_east.png index 4ae642f4690d8f391b889b40dc41969d7eadea6c..3710854fdafa269ca0973583aca7e810ed450f44 100644 GIT binary patch delta 120 zcmV-;0Ehq00i6MmEO8P501FZU(%pXi0000_Nkl631oUdk^TW|3czFfeW>jTXlgJ7V0Z%51?aB%hb`1#rsDz%=mG%@ aL;wKgvqVkMOtUKh0000Px#1ZP1_K>z@;j|==^ z1poj5Vo5|nRCocEkWmf5FbG6X!X!+}Bve8jZO$g466RnxSok2MZRkt*DBRGW}-KeA?I6CI!)zK_S&c$lUMKrDb{JIKTZSTwzZg`xukZeRd4 j{T~qT!{#@90L5ScpX5Xvdqq1u00000NkvXXu0mjfgFG=r delta 171 zcmV;c095~`0nY)DEPoRK01FcV0GgZ_00001b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^ z1poj5WJyFpRCocEj|~lgAQ(h1f)R*d1e!=AjbIXuVgqd;9virC{PVWAvBBL9*ghU= z5alBzIT;jqT=bg+dlHUxCkQJ`9Mo{Tpva|U^*y2fd!F>IxhjtfFWtMcdPAq< zvK*(jHkLa%vTuJVF5IzdtH4zG4AG3c4ifL4NxnIiv#Chnqql7Z&~OG%S3j3^P6Px#1ZP1_K>z@;j|==^ z1poj5RY^oaRCoc6j!_N3APhv?DVT&wnY21urT_^@Kms^8`bi2$xa57^yQU%`03Ihf z6(K8el9>DrU3Ok!8N}k;vA@XfSJk$yY diff --git a/src/assets/images/wired/icon_wired_south_east.png b/src/assets/images/wired/icon_wired_south_east.png index f575dd61c2f6151e2b32a663100224a0e84f84b7..4217c4b830ff0c3101323d4440eb9fe1be8380a1 100644 GIT binary patch delta 134 zcmV;10D1q}0jmL!EPoOJ01FZU(%pXi00018Nkllcg;OXk;vd$@?2>|E}KVSd= diff --git a/src/assets/images/wired/icon_wired_south_west.png b/src/assets/images/wired/icon_wired_south_west.png index 10ebcac3a9c6697d6e8e76e44c9d0550ea6383ea..07ab1f95ee593fa841b6f635b79578d8062d96d8 100644 GIT binary patch delta 132 zcmV-~0DJ$@0jU9yEPWCH01FZU(%pXi00016Nklwq|A&Cu7Kz0ow#cJ~pM~210000Px#1ZP1_K>z@;j|==^ z1poj5W=TXrRCocEkjo8#FbqR80wcgC9f1uPschB_=q8vLstN`Ady+3vY$X|0hs}iENv1101FZU(%pXi0000>NklXna00trfHUkP6 zNC5xwxFVid1112m0T4HkV~_(HUjc|0P~swD4FbvUr^Fx_CK`ae`kq_^9H36eZ~*}8 WoHPx#1ZP1_K>z@;j|==^ z1poj5TS-JgRCocUk3kIpAq)g7k0S{m3wnG?x!~22Zcq2B{=kX@g5SDr>OdCgm{#j=m6ez_FlYlq+ QYXATM07*qoM6N<$f|krS<^TWy diff --git a/src/views/wired/WiredView.scss b/src/views/wired/WiredView.scss index b5980200..bab60efb 100644 --- a/src/views/wired/WiredView.scss +++ b/src/views/wired/WiredView.scss @@ -1,3 +1,38 @@ .nitro-wired { 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'); + } + } } diff --git a/src/views/wired/WiredView.types.ts b/src/views/wired/WiredView.types.ts index ca325cc3..42a15ce3 100644 --- a/src/views/wired/WiredView.types.ts +++ b/src/views/wired/WiredView.types.ts @@ -15,3 +15,5 @@ export class WiredFurniType public static _Str_4991: number = 2; public static _Str_5430: number = 3; } + +export const WIRED_STRING_DELIMETER: string = '\t'; diff --git a/src/views/wired/common/GetWiredActionLayout.tsx b/src/views/wired/common/GetWiredActionLayout.tsx index b9ce455f..3d7793e3 100644 --- a/src/views/wired/common/GetWiredActionLayout.tsx +++ b/src/views/wired/common/GetWiredActionLayout.tsx @@ -1,5 +1,22 @@ import { WiredActionBotChangeFigureView } from '../views/actions/bot-change-figure/WiredActionBotChangeFigureView'; 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'; export function GetWiredActionLayout(code: number): JSX.Element @@ -10,5 +27,39 @@ export function GetWiredActionLayout(code: number): JSX.Element return ; case WiredActionLayout.BOT_FOLLOW_AVATAR: return ; + case WiredActionLayout.BOT_GIVE_HAND_ITEM: + return ; + case WiredActionLayout.BOT_MOVE: + return ; + case WiredActionLayout.BOT_TALK: + return ; + case WiredActionLayout.BOT_TALK_DIRECT_TO_AVTR: + return ; + case WiredActionLayout.BOT_TELEPORT: + return ; + case WiredActionLayout.CALL_ANOTHER_STACK: + return ; + case WiredActionLayout.CHASE: + return ; + case WiredActionLayout.CHAT: + return ; + case WiredActionLayout.FLEE: + return ; + case WiredActionLayout.JOIN_TEAM: + return ; + case WiredActionLayout.KICK_FROM_ROOM: + return ; + case WiredActionLayout.LEAVE_TEAM: + return ; + case WiredActionLayout.MOVE_FURNI: + return ; + case WiredActionLayout.RESET: + return ; + case WiredActionLayout.SET_FURNI_STATE: + return ; + case WiredActionLayout.TELEPORT: + return ; + case WiredActionLayout.TOGGLE_FURNI_STATE: + return ; } } diff --git a/src/views/wired/views/actions/base/WiredActionBaseView.tsx b/src/views/wired/views/actions/base/WiredActionBaseView.tsx index 0c442703..9411ea19 100644 --- a/src/views/wired/views/actions/base/WiredActionBaseView.tsx +++ b/src/views/wired/views/actions/base/WiredActionBaseView.tsx @@ -28,8 +28,10 @@ export const WiredActionBaseView: FC = props => return ( - { children } -
+ { !children ? null : <> + { children } +
+ }
{ LocalizeText('wiredfurni.params.delay', [ 'seconds' ], [ GetWiredTimeLocale(delay) ]) } = props => @@ -17,9 +16,7 @@ export const WiredActionBotChangeFigureView: FC<{}> = props => useEffect(() => { - const data = trigger.stringData.split(DELIMETER); - - console.log(data); + const data = trigger.stringData.split(WIRED_STRING_DELIMETER); if(data.length > 0) setBotName(data[0]); 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(() => { - setStringParam((botName + DELIMETER + figure)); + setStringParam((botName + WIRED_STRING_DELIMETER + figure)); }, [ botName, figure, setStringParam ]); return ( diff --git a/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx index 15840fec..d3386c04 100644 --- a/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx +++ b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx @@ -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 { WiredFurniType } from '../../../WiredView.types'; import { WiredActionBaseView } from '../base/WiredActionBaseView'; @@ -7,7 +8,7 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props => { const [ botName, setBotName ] = useState(''); const [ followMode, setFollowMode ] = useState(-1); - const { trigger = null, setStringParam = null } = useWiredContext(); + const { trigger = null, setStringParam = null, setIntParams = null } = useWiredContext(); useEffect(() => { @@ -15,9 +16,30 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props => setFollowMode((trigger.intData.length > 0) ? trigger.intData[0] : 0); }, [ trigger ]); + const save = useCallback(() => + { + setStringParam(botName); + setIntParams([followMode]); + }, [ followMode, botName, setStringParam, setIntParams ]); + return ( - - BOT_CHANGE_FIGURE + +
+ + setBotName(event.target.value) } /> +
+
+ setFollowMode(1)} /> + +
+
+ setFollowMode(0)} /> + +
); } diff --git a/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx b/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx new file mode 100644 index 00000000..cea80078 --- /dev/null +++ b/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx @@ -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 ( + +
+ + setBotName(event.target.value) } /> +
+
{ LocalizeText('wiredfurni.tooltip.handitem') }
+ +
+ ); +} diff --git a/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx b/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx new file mode 100644 index 00000000..6d7c583b --- /dev/null +++ b/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx @@ -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 ( + +
+ + setBotName(event.target.value) } /> +
+
+ ); +} diff --git a/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx b/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx new file mode 100644 index 00000000..d1c1bb1d --- /dev/null +++ b/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx @@ -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 ( + +
+ + setBotName(event.target.value) } /> +
+
+ + setMessage(event.target.value) } /> +
+
+ setTalkMode(0)} /> + +
+
+ setTalkMode(1)} /> + +
+
+ ); +} diff --git a/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx b/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx new file mode 100644 index 00000000..a7d18be1 --- /dev/null +++ b/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx @@ -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 ( + +
+ + setBotName(event.target.value) } /> +
+
+ + setMessage(event.target.value) } /> +
+
+ setTalkMode(0)} /> + +
+
+ setTalkMode(1)} /> + +
+
+ ); +} diff --git a/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx b/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx new file mode 100644 index 00000000..48e74006 --- /dev/null +++ b/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx @@ -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 ( + +
+ + setBotName(event.target.value) } /> +
+
+ ); +} diff --git a/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx b/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx new file mode 100644 index 00000000..fc8cfb64 --- /dev/null +++ b/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionCallAnotherStackView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/chase/WiredActionChaseView.tsx b/src/views/wired/views/actions/chase/WiredActionChaseView.tsx new file mode 100644 index 00000000..137e2b74 --- /dev/null +++ b/src/views/wired/views/actions/chase/WiredActionChaseView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionChaseView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/chat/WiredActionChatView.tsx b/src/views/wired/views/actions/chat/WiredActionChatView.tsx new file mode 100644 index 00000000..17ab0dd7 --- /dev/null +++ b/src/views/wired/views/actions/chat/WiredActionChatView.tsx @@ -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 ( + +
+ + setMessage(event.target.value) } /> +
+
+ ); +} diff --git a/src/views/wired/views/actions/flee/WiredActionFleeView.tsx b/src/views/wired/views/actions/flee/WiredActionFleeView.tsx new file mode 100644 index 00000000..17fa4bad --- /dev/null +++ b/src/views/wired/views/actions/flee/WiredActionFleeView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionFleeView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx b/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx new file mode 100644 index 00000000..077be945 --- /dev/null +++ b/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx @@ -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 ( + + { [1, 2, 3, 4].map(team => + { + return ( +
+ setSelectedTeam(team)} /> + +
+ ) + }) } +
+ ); +} diff --git a/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx b/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx new file mode 100644 index 00000000..3e221293 --- /dev/null +++ b/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx @@ -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 ( + +
+ + setMessage(event.target.value) } /> +
+
+ ); +} diff --git a/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx b/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx new file mode 100644 index 00000000..44d97432 --- /dev/null +++ b/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionLeaveTeamView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx b/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx new file mode 100644 index 00000000..b387284b --- /dev/null +++ b/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx @@ -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 ( + +
{ LocalizeText('wiredfurni.params.movefurni') }
+
+ setMovement(0)} /> + +
+
+ { options.map(option => + { + return ( +
+
+ setMovement(option.value)} /> + +
+
+ ) + }) } +
+
+ +
+ ); +} diff --git a/src/views/wired/views/actions/reset/WiredActionResetView.tsx b/src/views/wired/views/actions/reset/WiredActionResetView.tsx new file mode 100644 index 00000000..b99cce9c --- /dev/null +++ b/src/views/wired/views/actions/reset/WiredActionResetView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionResetView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx b/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx new file mode 100644 index 00000000..2511481a --- /dev/null +++ b/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx @@ -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 ( + +
+ setStateFlag(e.target.checked ? 1 : 0)} /> + +
+
+ setDirectionFlag(e.target.checked ? 1 : 0)} /> + +
+
+ setPositionFlag(e.target.checked ? 1 : 0)} /> + +
+
+ ); +} diff --git a/src/views/wired/views/actions/teleport/WiredActionTeleportView.tsx b/src/views/wired/views/actions/teleport/WiredActionTeleportView.tsx new file mode 100644 index 00000000..e666d84a --- /dev/null +++ b/src/views/wired/views/actions/teleport/WiredActionTeleportView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionTeleportView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx b/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx new file mode 100644 index 00000000..be3ca966 --- /dev/null +++ b/src/views/wired/views/actions/toggle-furni-state/WiredActionToggleFurniStateView.tsx @@ -0,0 +1,10 @@ +import { FC } from 'react'; +import { WiredFurniType } from '../../../WiredView.types'; +import { WiredActionBaseView } from '../base/WiredActionBaseView'; + +export const WiredActionToggleFurniStateView: FC<{}> = props => +{ + return ( + + ); +} diff --git a/src/views/wired/views/base/WiredBaseView.tsx b/src/views/wired/views/base/WiredBaseView.tsx index 26fa821a..322a8aca 100644 --- a/src/views/wired/views/base/WiredBaseView.tsx +++ b/src/views/wired/views/base/WiredBaseView.tsx @@ -65,10 +65,11 @@ export const WiredBaseView: FC = props => { children }
{ (requiresFurni !== WiredFurniType._Str_5431) && -
- { LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ '0', '0' ]) } - { LocalizeText('wiredfurni.pickfurnis.desc') } -
} + <> +
+
{ LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ '0', '0' ]) }
+
{ LocalizeText('wiredfurni.pickfurnis.desc') }
+ }
From 056deea4cbee4e8e80ba7c593dd3c0e981ec4245 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 28 Jun 2021 19:10:42 -0300 Subject: [PATCH 05/22] Fix WiredFurniType names --- src/views/wired/WiredView.types.ts | 8 ++++---- .../wired/views/actions/base/WiredActionBaseView.tsx | 2 +- .../bot-change-figure/WiredActionBotChangeFigureView.tsx | 2 +- .../bot-follow-avatar/WiredActionBotFollowAvatarView.tsx | 2 +- .../bot-give-hand-item/WiredActionBotGiveHandItemView.tsx | 2 +- .../views/actions/bot-move/WiredActionBotMoveView.tsx | 2 +- .../bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx | 2 +- .../views/actions/bot-talk/WiredActionBotTalkView.tsx | 2 +- .../actions/bot-teleport/WiredActionBotTeleportView.tsx | 2 +- .../WiredActionCallAnotherStackView.tsx | 2 +- .../wired/views/actions/chase/WiredActionChaseView.tsx | 2 +- .../wired/views/actions/chat/WiredActionChatView.tsx | 2 +- .../wired/views/actions/flee/WiredActionFleeView.tsx | 2 +- .../views/actions/join-team/WiredActionJoinTeamView.tsx | 2 +- .../kick-from-room/WiredActionKickFromRoomView.tsx | 2 +- .../views/actions/leave-team/WiredActionLeaveTeamView.tsx | 2 +- .../views/actions/move-furni/WiredActionMoveFurniView.tsx | 2 +- .../wired/views/actions/reset/WiredActionResetView.tsx | 2 +- .../set-furni-state-to/WiredActionSetFurniStateToView.tsx | 2 +- .../views/actions/teleport/WiredActionTeleportView.tsx | 2 +- .../WiredActionToggleFurniStateView.tsx | 2 +- src/views/wired/views/base/WiredBaseView.tsx | 4 ++-- 22 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/views/wired/WiredView.types.ts b/src/views/wired/WiredView.types.ts index 42a15ce3..aa76a13e 100644 --- a/src/views/wired/WiredView.types.ts +++ b/src/views/wired/WiredView.types.ts @@ -10,10 +10,10 @@ export class WiredLayoutViewProps export class WiredFurniType { - public static _Str_5431: number = 0; - public static _Str_4873: number = 1; - public static _Str_4991: number = 2; - public static _Str_5430: number = 3; + public static STUFF_SELECTION_OPTION_NONE: number = 0; + public static STUFF_SELECTION_OPTION_BY_ID: number = 1; + public static STUFF_SELECTION_OPTION_BY_ID_OR_BY_TYPE: number = 2; + public static STUFF_SELECTION_OPTION_BY_ID_BY_TYPE_OR_FROM_CONTEXT: number = 3; } export const WIRED_STRING_DELIMETER: string = '\t'; diff --git a/src/views/wired/views/actions/base/WiredActionBaseView.tsx b/src/views/wired/views/actions/base/WiredActionBaseView.tsx index 9411ea19..5eb407d7 100644 --- a/src/views/wired/views/actions/base/WiredActionBaseView.tsx +++ b/src/views/wired/views/actions/base/WiredActionBaseView.tsx @@ -10,7 +10,7 @@ import { WiredActionBaseViewProps } from './WiredActionBaseView.types'; export const WiredActionBaseView: FC = props => { - const { requiresFurni = WiredFurniType._Str_5431, save = null, children = null } = props; + const { requiresFurni = WiredFurniType.STUFF_SELECTION_OPTION_NONE, save = null, children = null } = props; const [ delay, setDelay ] = useState(-1); const { trigger = null, setActionDelay = null } = useWiredContext(); diff --git a/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx b/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx index 85ddb413..f6ab7ceb 100644 --- a/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx +++ b/src/views/wired/views/actions/bot-change-figure/WiredActionBotChangeFigureView.tsx @@ -33,7 +33,7 @@ export const WiredActionBotChangeFigureView: FC<{}> = props => }, [ botName, figure, setStringParam ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx index d3386c04..19cc8d79 100644 --- a/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx +++ b/src/views/wired/views/actions/bot-follow-avatar/WiredActionBotFollowAvatarView.tsx @@ -23,7 +23,7 @@ export const WiredActionBotFollowAvatarView: FC<{}> = props => }, [ followMode, botName, setStringParam, setIntParams ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx b/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx index cea80078..ff68b0b4 100644 --- a/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx +++ b/src/views/wired/views/actions/bot-give-hand-item/WiredActionBotGiveHandItemView.tsx @@ -25,7 +25,7 @@ export const WiredActionBotGiveHandItemView: FC<{}> = props => }, [ handItemId, botName, setStringParam, setIntParams ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx b/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx index 6d7c583b..0704ba03 100644 --- a/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx +++ b/src/views/wired/views/actions/bot-move/WiredActionBotMoveView.tsx @@ -20,7 +20,7 @@ export const WiredActionBotMoveView: FC<{}> = props => }, [ botName, setStringParam ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx b/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx index d1c1bb1d..ee8abea6 100644 --- a/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx +++ b/src/views/wired/views/actions/bot-talk-to-avatar/WiredActionBotTalkToAvatarView.tsx @@ -28,7 +28,7 @@ export const WiredActionBotTalkToAvatarView: FC<{}> = props => }, [ botName, message, talkMode, setStringParam, setIntParams ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx b/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx index a7d18be1..a73c1179 100644 --- a/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx +++ b/src/views/wired/views/actions/bot-talk/WiredActionBotTalkView.tsx @@ -28,7 +28,7 @@ export const WiredActionBotTalkView: FC<{}> = props => }, [ botName, message, talkMode, setStringParam, setIntParams ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx b/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx index 48e74006..bd916693 100644 --- a/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx +++ b/src/views/wired/views/actions/bot-teleport/WiredActionBotTeleportView.tsx @@ -20,7 +20,7 @@ export const WiredActionBotTeleportView: FC<{}> = props => }, [ botName, setStringParam ]); return ( - +
setBotName(event.target.value) } /> diff --git a/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx b/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx index fc8cfb64..3a2f37c6 100644 --- a/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx +++ b/src/views/wired/views/actions/call-another-stack/WiredActionCallAnotherStackView.tsx @@ -5,6 +5,6 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView'; export const WiredActionCallAnotherStackView: FC<{}> = props => { return ( - + ); } diff --git a/src/views/wired/views/actions/chase/WiredActionChaseView.tsx b/src/views/wired/views/actions/chase/WiredActionChaseView.tsx index 137e2b74..91b8ee30 100644 --- a/src/views/wired/views/actions/chase/WiredActionChaseView.tsx +++ b/src/views/wired/views/actions/chase/WiredActionChaseView.tsx @@ -5,6 +5,6 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView'; export const WiredActionChaseView: FC<{}> = props => { return ( - + ); } diff --git a/src/views/wired/views/actions/chat/WiredActionChatView.tsx b/src/views/wired/views/actions/chat/WiredActionChatView.tsx index 17ab0dd7..4d9e54b2 100644 --- a/src/views/wired/views/actions/chat/WiredActionChatView.tsx +++ b/src/views/wired/views/actions/chat/WiredActionChatView.tsx @@ -20,7 +20,7 @@ export const WiredActionChatView: FC<{}> = props => }, [ message, setStringParam ]); return ( - +
setMessage(event.target.value) } /> diff --git a/src/views/wired/views/actions/flee/WiredActionFleeView.tsx b/src/views/wired/views/actions/flee/WiredActionFleeView.tsx index 17fa4bad..927ffea9 100644 --- a/src/views/wired/views/actions/flee/WiredActionFleeView.tsx +++ b/src/views/wired/views/actions/flee/WiredActionFleeView.tsx @@ -5,6 +5,6 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView'; export const WiredActionFleeView: FC<{}> = props => { return ( - + ); } diff --git a/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx b/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx index 077be945..4dc6844e 100644 --- a/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx +++ b/src/views/wired/views/actions/join-team/WiredActionJoinTeamView.tsx @@ -20,7 +20,7 @@ export const WiredActionJoinTeamView: FC<{}> = props => }, [ selectedTeam, setIntParams ]); return ( - + { [1, 2, 3, 4].map(team => { return ( diff --git a/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx b/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx index 3e221293..65933838 100644 --- a/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx +++ b/src/views/wired/views/actions/kick-from-room/WiredActionKickFromRoomView.tsx @@ -20,7 +20,7 @@ export const WiredActionKickFromRoomView: FC<{}> = props => }, [ message, setStringParam ]); return ( - +
setMessage(event.target.value) } /> diff --git a/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx b/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx index 44d97432..0ea0dee3 100644 --- a/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx +++ b/src/views/wired/views/actions/leave-team/WiredActionLeaveTeamView.tsx @@ -5,6 +5,6 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView'; export const WiredActionLeaveTeamView: FC<{}> = props => { return ( - + ); } diff --git a/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx b/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx index b387284b..7572bd06 100644 --- a/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx +++ b/src/views/wired/views/actions/move-furni/WiredActionMoveFurniView.tsx @@ -56,7 +56,7 @@ export const WiredActionMoveFurniView: FC<{}> = props => }, [ movement, rotation, setIntParams ]); return ( - +
{ LocalizeText('wiredfurni.params.movefurni') }
setMovement(0)} /> diff --git a/src/views/wired/views/actions/reset/WiredActionResetView.tsx b/src/views/wired/views/actions/reset/WiredActionResetView.tsx index b99cce9c..ff977014 100644 --- a/src/views/wired/views/actions/reset/WiredActionResetView.tsx +++ b/src/views/wired/views/actions/reset/WiredActionResetView.tsx @@ -5,6 +5,6 @@ import { WiredActionBaseView } from '../base/WiredActionBaseView'; export const WiredActionResetView: FC<{}> = props => { return ( - + ); } diff --git a/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx b/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx index 2511481a..668d1fa9 100644 --- a/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx +++ b/src/views/wired/views/actions/set-furni-state-to/WiredActionSetFurniStateToView.tsx @@ -24,7 +24,7 @@ export const WiredActionSetFurniStateToView: FC<{}> = props => }, [ directionFlag, positionFlag, setIntParams, stateFlag ]); return ( - +
setStateFlag(e.target.checked ? 1 : 0)} />