From 5003bf06708318cac184aee2ad5cef0c53a48f0b Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 13 Jun 2021 02:13:55 -0300 Subject: [PATCH] Room Widget: camera --- src/assets/images/camera/base.png | Bin 2166 -> 0 bytes src/assets/images/camera/hud.png | Bin 959 -> 0 bytes src/assets/images/camera/snap.png | Bin 1344 -> 0 bytes .../camera-widget/camera-spritesheet.png | Bin 0 -> 6015 bytes .../camera-widget}/selected.png | Bin .../camera-widget}/selector.png | Bin src/events/index.ts | 1 + .../camera/RoomWidgetCameraEvent.ts | 13 ++++ src/events/room-widgets/camera/index.ts | 1 + src/events/room-widgets/index.ts | 1 + src/views/room/RoomView.tsx | 2 + src/views/room/widgets/RoomWidgets.scss | 1 + .../room/widgets/camera/CameraWidgetView.scss | 24 ++++++++ .../room/widgets/camera/CameraWidgetView.tsx | 57 ++++++++++++++++++ .../widgets/camera/CameraWidgetView.types.ts | 2 + src/views/toolbar/ToolbarView.tsx | 8 +++ src/views/toolbar/ToolbarView.types.ts | 1 + 17 files changed, 111 insertions(+) delete mode 100644 src/assets/images/camera/base.png delete mode 100644 src/assets/images/camera/hud.png delete mode 100644 src/assets/images/camera/snap.png create mode 100644 src/assets/images/room-widgets/camera-widget/camera-spritesheet.png rename src/assets/images/{camera => room-widgets/camera-widget}/selected.png (100%) rename src/assets/images/{camera => room-widgets/camera-widget}/selector.png (100%) create mode 100644 src/events/room-widgets/camera/RoomWidgetCameraEvent.ts create mode 100644 src/events/room-widgets/camera/index.ts create mode 100644 src/events/room-widgets/index.ts create mode 100644 src/views/room/widgets/camera/CameraWidgetView.scss create mode 100644 src/views/room/widgets/camera/CameraWidgetView.tsx create mode 100644 src/views/room/widgets/camera/CameraWidgetView.types.ts diff --git a/src/assets/images/camera/base.png b/src/assets/images/camera/base.png deleted file mode 100644 index d6cf994d063352f748ce25d259c4dd3e54645754..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2166 zcmcguZAcVp9G|t_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hoe(_ia##<<^>p=fS?83{1OQ0_I2!-} diff --git a/src/assets/images/camera/snap.png b/src/assets/images/camera/snap.png deleted file mode 100644 index c3f57a0435278386e41682712f92d42f0abacd06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1344 zcmV-G1;6@Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1l37IK~#8N?c6_h z(?Af%aVIAMy40!DaRXXzK$TQ*0;rOT8_;qCy40!D0XH%J**j*nn%SM%Ka#xC_dQ-z z5KH^ftcCOPxY{kRz5A+dQEQm{Vn%rT+go>}>+0pj9SxdoU2~lHjA+Hv79dZ$#;Hzb zL;UdG9VGhs%N@u~jobPJN609m7EfCQ*~4wN?p7}xhpde#CE&J%t^I;BWW{YfsNi*5 zz}9-9JV+~^Hsd*K!qx!Yn;;d4!GlCB`rb?#uEU+T$fOi>j7bal_-VKM@%?m+1V|1~ z1$D^uy-L_p)DqAk=H1=t>%&75(uZIHo}S!6qWgPy@W141D_~1db3wP>s1{H&=4_B* z3~Vb@EodI*+>l}3^|V6OfaYT^1v1QCTMN__Xn&YgBh+j6HC<1b2-kSHR$Q|~I_0hD z9EU6v107B$)dMDFL3KHk^Urs~bQ6j@gz4-FlhUFpr&IzRPiK#qlyOp>4Lhaj3B{ek z4?0kfn3M)pF{K=+Je{uYFewR@$r+8NG(MsJ9TCQV6&a>91m&OXUfoV7RXC;cgl^M0 zOgW|LhmzNMI#G|)Nx8LYrZmh4<+nRGo!IWZ$E}gE2)8{yq0C6HW;&_VlnUG4wB?Vj zVLGXdwGya)yRTt7DQ>NaZ9ksS)OKHCmThm}@>|h1(8_I~l>?~$fwXlh@?aWH==MMo z(>|ECEnm3}v~nA0TTbp*fli_(noBn&WmlE3@nYMiL;nZ2;bVfRZMz=jTrLV81Ld*y;T8%^jSg=?vd0(+?$K zO1ndqFlo(SKPRUXjX;xA+9PTTQ#qX|J)tPPGd-bdF!77Gis?iwsOr762UO!^BK%!x zI+1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F!;^(5QN%B^)(`>2VncF`v2!1i2U9A zbk0|(8Z;9Qze1gGIDz-yTtNl!K5eBAl=5WviW7(9pY1FJ{?Vw?IGfI(5i=;DgKPof z1}`aSY*;zfWkLV|r_MrOKL8W}AJx&s0$Sin4z!?x!||vEv;&;_!2<`#4`_k}CHreM zKvJsD>w@{4wd|jUMjv;7p)%%Y@&Xe;!c#0{U6o)w`5K~{TJ;h?4bd!7D1Oa95t#0>anvlBB69mAXdY52c||IO|{PKEscCM$oPW9Wnc z1^jcyYe4-|_W#rF*R?RQmfG1f|C0TgWW`bUbh!glvkZu7DqGhg_A*Nsu|HmE-|oP^ z$^`Gv;WXSqha)(A)o#1`R!;uN_rms$FF3<9)SZ*)|MMBVsAJf^0SnKtB1HcS5G>Xo literal 0 HcmV?d00001 diff --git a/src/assets/images/camera/selected.png b/src/assets/images/room-widgets/camera-widget/selected.png similarity index 100% rename from src/assets/images/camera/selected.png rename to src/assets/images/room-widgets/camera-widget/selected.png diff --git a/src/assets/images/camera/selector.png b/src/assets/images/room-widgets/camera-widget/selector.png similarity index 100% rename from src/assets/images/camera/selector.png rename to src/assets/images/room-widgets/camera-widget/selector.png diff --git a/src/events/index.ts b/src/events/index.ts index 81a2cdd4..70ffd6ca 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -3,3 +3,4 @@ export * from './catalog'; export * from './friend-list'; export * from './inventory'; export * from './navigator'; +export * from './room-widgets'; diff --git a/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts b/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts new file mode 100644 index 00000000..0eb6b4f0 --- /dev/null +++ b/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts @@ -0,0 +1,13 @@ +import { NitroEvent } from 'nitro-renderer'; + +export class RoomWidgetCameraEvent extends NitroEvent +{ + public static SHOW_CAMERA: string = 'NE_SHOW_CAMERA'; + public static HIDE_CAMERA: string = 'NE_HIDE_CAMERA'; + public static TOGGLE_CAMERA: string = 'NE_TOGGLE_CAMERA'; + + constructor(type: string) + { + super(type); + } +} diff --git a/src/events/room-widgets/camera/index.ts b/src/events/room-widgets/camera/index.ts new file mode 100644 index 00000000..a04e80d0 --- /dev/null +++ b/src/events/room-widgets/camera/index.ts @@ -0,0 +1 @@ +export * from './RoomWidgetCameraEvent'; diff --git a/src/events/room-widgets/index.ts b/src/events/room-widgets/index.ts new file mode 100644 index 00000000..5eeca25b --- /dev/null +++ b/src/events/room-widgets/index.ts @@ -0,0 +1 @@ +export * from './camera'; diff --git a/src/views/room/RoomView.tsx b/src/views/room/RoomView.tsx index 381caa1b..99019599 100644 --- a/src/views/room/RoomView.tsx +++ b/src/views/room/RoomView.tsx @@ -7,6 +7,7 @@ import { DispatchTouchEvent } from '../../api/nitro/room/DispatchTouchEvent'; import { GetRoomEngine } from '../../api/nitro/room/GetRoomEngine'; import { RoomViewProps } from './RoomView.types'; import { AvatarInfoWidgetView } from './widgets/avatar-info/AvatarInfoWidgetView'; +import { CameraWidgetView } from './widgets/camera/CameraWidgetView'; import { ChatInputView } from './widgets/chat-input/ChatInputView'; import { ChatWidgetView } from './widgets/chat/ChatWidgetView'; import { FurnitureWidgetsView } from './widgets/furniture/FurnitureWidgetsView'; @@ -92,6 +93,7 @@ export function RoomView(props: RoomViewProps): JSX.Element createPortal(props.children, document.getElementById('room-view').appendChild(roomCanvas)) && <> + diff --git a/src/views/room/widgets/RoomWidgets.scss b/src/views/room/widgets/RoomWidgets.scss index 71970ddb..8b1fa8ca 100644 --- a/src/views/room/widgets/RoomWidgets.scss +++ b/src/views/room/widgets/RoomWidgets.scss @@ -1,3 +1,4 @@ +@import './camera/CameraWidgetView'; @import './chat/ChatWidgetView'; @import './chat-input/ChatInputView'; @import './furniture/FurnitureWidgets'; diff --git a/src/views/room/widgets/camera/CameraWidgetView.scss b/src/views/room/widgets/camera/CameraWidgetView.scss new file mode 100644 index 00000000..163f651b --- /dev/null +++ b/src/views/room/widgets/camera/CameraWidgetView.scss @@ -0,0 +1,24 @@ +.nitro-camera { + width: 340px; + height: 462px; + + background-image: url('../../../../assets/images/room-widgets/camera-widget/camera-spritesheet.png'); + + .camera-button { + width: 94px; + height: 94px; + cursor: pointer; + margin-top: 334px; + + background-image: url('../../../../assets/images/room-widgets/camera-widget/camera-spritesheet.png'); + background-position: -340px 0px; + + &:hover { + background-position: -340px -94px; + } + + &:active { + background-position: -340px -188px; + } + } +} diff --git a/src/views/room/widgets/camera/CameraWidgetView.tsx b/src/views/room/widgets/camera/CameraWidgetView.tsx new file mode 100644 index 00000000..9b53b7a7 --- /dev/null +++ b/src/views/room/widgets/camera/CameraWidgetView.tsx @@ -0,0 +1,57 @@ +import { FC, useCallback, useState } from 'react'; +import { RoomWidgetCameraEvent } from '../../../../events/room-widgets/camera/RoomWidgetCameraEvent'; +import { DraggableWindow } from '../../../../hooks/draggable-window/DraggableWindow'; +import { useUiEvent } from '../../../../hooks/events/ui/ui-event'; +import { CameraWidgetViewProps } from './CameraWidgetView.types'; + +export const CameraWidgetView: FC = props => +{ + const [ isVisible, setIsVisible ] = useState(false); + + const onRoomWidgetCameraEvent = useCallback((event: RoomWidgetCameraEvent) => + { + switch(event.type) + { + case RoomWidgetCameraEvent.SHOW_CAMERA: + setIsVisible(true); + return; + case RoomWidgetCameraEvent.HIDE_CAMERA: + setIsVisible(false); + return; + case RoomWidgetCameraEvent.TOGGLE_CAMERA: + setIsVisible(value => !value); + return; + } + }, []); + + useUiEvent(RoomWidgetCameraEvent.SHOW_CAMERA, onRoomWidgetCameraEvent); + useUiEvent(RoomWidgetCameraEvent.HIDE_CAMERA, onRoomWidgetCameraEvent); + useUiEvent(RoomWidgetCameraEvent.TOGGLE_CAMERA, onRoomWidgetCameraEvent); + + const processAction = useCallback((type: string, value: string = null) => + { + switch(type) + { + case 'close': + setIsVisible(false); + return; + } + }, []); + + if(!isVisible) return null; + + return ( + +
+
+
processAction('close') }> + +
+
+
+
+
+
+
+ ); +} diff --git a/src/views/room/widgets/camera/CameraWidgetView.types.ts b/src/views/room/widgets/camera/CameraWidgetView.types.ts new file mode 100644 index 00000000..e97e9b69 --- /dev/null +++ b/src/views/room/widgets/camera/CameraWidgetView.types.ts @@ -0,0 +1,2 @@ +export interface CameraWidgetViewProps +{} diff --git a/src/views/toolbar/ToolbarView.tsx b/src/views/toolbar/ToolbarView.tsx index 6ab6a57e..fa8ccedb 100644 --- a/src/views/toolbar/ToolbarView.tsx +++ b/src/views/toolbar/ToolbarView.tsx @@ -2,6 +2,7 @@ import { UserInfoEvent } from 'nitro-renderer/src/nitro/communication/messages/i import { UserInfoDataParser } from 'nitro-renderer/src/nitro/communication/messages/parser/user/data/UserInfoDataParser'; import { FC, useCallback, useState } from 'react'; import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent } from '../../events'; +import { RoomWidgetCameraEvent } from '../../events/room-widgets/camera/RoomWidgetCameraEvent'; import { dispatchUiEvent } from '../../hooks/events/ui/ui-event'; import { CreateMessageHook } from '../../hooks/messages/message-event'; import { TransitionAnimation } from '../../transitions/TransitionAnimation'; @@ -44,6 +45,9 @@ export const ToolbarView: FC = props => case ToolbarViewItems.FRIEND_LIST_ITEM: dispatchUiEvent(new CatalogEvent(FriendListEvent.TOGGLE_FRIEND_LIST)); return; + case ToolbarViewItems.CAMERA_ITEM: + dispatchUiEvent(new RoomWidgetCameraEvent(RoomWidgetCameraEvent.TOGGLE_CAMERA)); + return; case ToolbarViewItems.CLOTHING_ITEM: dispatchUiEvent(new AvatarEditorEvent(AvatarEditorEvent.TOGGLE_EDITOR)); setMeExpanded(false); @@ -101,6 +105,10 @@ export const ToolbarView: FC = props => { (unseenFriendListCount > 0) && (
{ unseenFriendListCount }
) } + { isInRoom && ( +
handleToolbarItemClick(ToolbarViewItems.CAMERA_ITEM) }> + +
) }
diff --git a/src/views/toolbar/ToolbarView.types.ts b/src/views/toolbar/ToolbarView.types.ts index b0b97068..6c280e6c 100644 --- a/src/views/toolbar/ToolbarView.types.ts +++ b/src/views/toolbar/ToolbarView.types.ts @@ -10,4 +10,5 @@ export class ToolbarViewItems public static CATALOG_ITEM: string = 'TVI_CATALOG_ITEM'; public static FRIEND_LIST_ITEM: string = 'TVI_FRIEND_LIST_ITEM'; public static CLOTHING_ITEM: string = 'TVI_CLOTHING_ITEM'; + public static CAMERA_ITEM: string = 'TVI_CAMERA_ITEM'; }