Add hotel view button

This commit is contained in:
Bill 2021-07-21 22:31:01 -04:00
parent 770ea994f8
commit 4ecb6ba5b6

View File

@ -1,11 +1,12 @@
import { Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from 'nitro-renderer'; import { DesktopViewComposer, Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from 'nitro-renderer';
import { FC, useCallback, useState } from 'react'; import { FC, useCallback, useState } from 'react';
import { GetRoomSession, GetRoomSessionManager } from '../../api';
import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent, RoomWidgetCameraEvent } from '../../events'; import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent, RoomWidgetCameraEvent } from '../../events';
import { AchievementsUIEvent } from '../../events/achievements'; import { AchievementsUIEvent } from '../../events/achievements';
import { UnseenItemTrackerUpdateEvent } from '../../events/inventory/UnseenItemTrackerUpdateEvent'; import { UnseenItemTrackerUpdateEvent } from '../../events/inventory/UnseenItemTrackerUpdateEvent';
import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent'; import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent';
import { dispatchUiEvent, useRoomEngineEvent, useUiEvent } from '../../hooks'; import { dispatchUiEvent, useRoomEngineEvent, useUiEvent } from '../../hooks';
import { CreateMessageHook } from '../../hooks/messages/message-event'; import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
import { TransitionAnimation } from '../../layout/transitions/TransitionAnimation'; import { TransitionAnimation } from '../../layout/transitions/TransitionAnimation';
import { TransitionAnimationTypes } from '../../layout/transitions/TransitionAnimation.types'; import { TransitionAnimationTypes } from '../../layout/transitions/TransitionAnimation.types';
import { AvatarImageView } from '../shared/avatar-image/AvatarImageView'; import { AvatarImageView } from '../shared/avatar-image/AvatarImageView';
@ -124,6 +125,14 @@ export const ToolbarView: FC<ToolbarViewProps> = props =>
} }
}, []); }, []);
const visitDesktop = useCallback(() =>
{
if(!GetRoomSession()) return;
SendMessageHook(new DesktopViewComposer());
GetRoomSessionManager().removeSession(-1);
}, []);
return ( return (
<div className="nitro-toolbar-container"> <div className="nitro-toolbar-container">
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isMeExpanded } timeout={ 300 }> <TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isMeExpanded } timeout={ 300 }>
@ -134,17 +143,17 @@ export const ToolbarView: FC<ToolbarViewProps> = props =>
<div className="navigation-items navigation-avatar pe-1 me-2"> <div className="navigation-items navigation-avatar pe-1 me-2">
<div className="navigation-item"> <div className="navigation-item">
<div className={ 'toolbar-avatar ' + (isMeExpanded ? 'active ' : '') } onClick={ event => setMeExpanded(!isMeExpanded) }> <div className={ 'toolbar-avatar ' + (isMeExpanded ? 'active ' : '') } onClick={ event => setMeExpanded(!isMeExpanded) }>
{ userFigure && <AvatarImageView figure={ userFigure } direction={ 2 } /> } <AvatarImageView figure={ userFigure } direction={ 2 } />
</div> </div>
</div> </div>
{ (unseenAchievementsCount > 0) && ( { (unseenAchievementsCount > 0) && (
<div className="position-absolute bg-danger px-1 py-0 rounded shadow count">{ unseenAchievementsCount }</div>) } <div className="position-absolute bg-danger px-1 py-0 rounded shadow count">{ unseenAchievementsCount }</div>) }
</div> </div>
<div className="navigation-items"> <div className="navigation-items">
{/* { isInRoom && ( { isInRoom && (
<div className="navigation-item"> <div className="navigation-item" onClick={ visitDesktop }>
<i className="icon icon-hotelview icon-nitro-light filter-none"></i> <i className="icon icon-hotelview icon-nitro-light"></i>
</div>) } */} </div>) }
{ !isInRoom && ( { !isInRoom && (
<div className="navigation-item"> <div className="navigation-item">
<i className="icon icon-house"></i> <i className="icon icon-house"></i>