diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 04930f22..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build - -on: - push: - branches: [dev] - -jobs: - build: - runs-on: dedicated-server - strategy: - matrix: - node-version: [16.x] - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - - name: Install dependencies - run: | - yarn remove @nitrots/nitro-renderer - yarn add git+https://git@git.krews.org/nitro/nitro-renderer#dev - yarn install - - name: Build Nitro - run: | - yarn build - - name: Archive Artifacts - uses: actions/upload-artifact@v2 - with: - path: | - build diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml-disabled similarity index 100% rename from .gitlab-ci.yml rename to .gitlab-ci.yml-disabled diff --git a/src/api/notification/NotificationUtilities.ts b/src/api/notification/NotificationUtilities.ts index a561fe73..45cc6311 100644 --- a/src/api/notification/NotificationUtilities.ts +++ b/src/api/notification/NotificationUtilities.ts @@ -1,6 +1,5 @@ import { HabboWebTools, RoomEnterEffect } from '@nitrots/nitro-renderer'; import { CreateLinkEvent, GetConfiguration, GetNitroInstance, LocalizeText } from '..'; -import { CatalogPageName } from '../../components/catalog/common/CatalogPageName'; import { NotificationAlertEvent, NotificationConfirmEvent } from '../../events'; import { NotificationBubbleEvent } from '../../events/notification-center/NotificationBubbleEvent'; import { DispatchUiEvent } from '../../hooks'; diff --git a/src/common/layout/LayoutRoomPreviewerView.tsx b/src/common/layout/LayoutRoomPreviewerView.tsx index a7722c73..ff2caeb6 100644 --- a/src/common/layout/LayoutRoomPreviewerView.tsx +++ b/src/common/layout/LayoutRoomPreviewerView.tsx @@ -1,5 +1,5 @@ import { ColorConverter, IRoomRenderingCanvas, RoomPreviewer, TextureUtils } from '@nitrots/nitro-renderer'; -import { FC, useCallback, useEffect, useRef, useState } from 'react'; +import { FC, MouseEvent, useCallback, useEffect, useRef, useState } from 'react'; import { GetNitroInstance } from '../../api'; export interface LayoutRoomPreviewerViewProps @@ -14,6 +14,20 @@ export const LayoutRoomPreviewerView: FC = props = const [ renderingCanvas, setRenderingCanvas ] = useState(null); const elementRef = useRef(); + const onClick = (event: MouseEvent) => + { + if(!roomPreviewer) return; + + if(event.shiftKey) + { + roomPreviewer.changeRoomObjectDirection(); + } + else + { + roomPreviewer.changeRoomObjectState(); + } + } + const update = useCallback((time: number) => { if(!roomPreviewer || !renderingCanvas || !elementRef.current) return; @@ -83,7 +97,7 @@ export const LayoutRoomPreviewerView: FC = props = return (
-
+
{ props.children }
); diff --git a/src/components/catalog/CatalogView.scss b/src/components/catalog/CatalogView.scss index e90bfd58..7657fa17 100644 --- a/src/components/catalog/CatalogView.scss +++ b/src/components/catalog/CatalogView.scss @@ -98,7 +98,6 @@ .layout-grid-item { height: 75px !important; - max-height: 75px !important; } } diff --git a/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceItemView.tsx b/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceItemView.tsx index 6dd57954..b59f32e9 100644 --- a/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceItemView.tsx +++ b/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceItemView.tsx @@ -67,7 +67,7 @@ export const CatalogLayoutMarketplaceItemView: FC = pr }, [offerData]); return ( - + { getMarketplaceOfferTitle } diff --git a/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceOwnItemsView.tsx b/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceOwnItemsView.tsx index 1c95a53c..2772c0d9 100644 --- a/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceOwnItemsView.tsx +++ b/src/components/catalog/views/page/layout/marketplace/CatalogLayoutMarketplaceOwnItemsView.tsx @@ -83,7 +83,7 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC = prop }); return ( - + { (creditsWaiting <= 0) && { LocalizeText('catalog.marketplace.redeem.no_sold_items') } diff --git a/src/components/navigator/NavigatorMessageHandler.tsx b/src/components/navigator/NavigatorMessageHandler.tsx index 93c01d29..961c95e4 100644 --- a/src/components/navigator/NavigatorMessageHandler.tsx +++ b/src/components/navigator/NavigatorMessageHandler.tsx @@ -1,7 +1,7 @@ -import { CantConnectMessageParser, GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEnterErrorEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer'; +import { CantConnectMessageParser, GenericErrorEvent, GetGuestRoomResultEvent, LegacyExternalInterface, NavigatorCategoriesComposer, NavigatorCategoriesEvent, NavigatorHomeRoomEvent, NavigatorMetadataEvent, NavigatorOpenRoomCreatorEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomCreatedEvent, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomDoorbellRejectedEvent, RoomEnterErrorEvent, RoomEntryInfoMessageEvent, RoomForwardEvent, RoomInfoComposer, RoomSettingsUpdatedEvent, UserInfoEvent } from '@nitrots/nitro-renderer'; import { FC, useCallback } from 'react'; import { CreateRoomSession, GetSessionDataManager, LocalizeText, NotificationAlertType, NotificationUtilities, SendMessageComposer, VisitDesktop } from '../../api'; -import { UpdateDoorStateEvent } from '../../events'; +import { NavigatorEvent, UpdateDoorStateEvent } from '../../events'; import { DispatchUiEvent, UseMessageEventHook } from '../../hooks'; import { useNavigatorContext } from './NavigatorContext'; import { NavigatorActions } from './reducers/NavigatorReducer'; @@ -221,6 +221,11 @@ export const NavigatorMessageHandler: FC<{}> = props => VisitDesktop(); }, []); + const onRoomCreatorEvent = useCallback((event: RoomEnterErrorEvent) => + { + DispatchUiEvent(new NavigatorEvent(NavigatorEvent.SHOW_ROOM_CREATOR)); + },[]); + UseMessageEventHook(UserInfoEvent, onUserInfoEvent); UseMessageEventHook(RoomForwardEvent, onRoomForwardEvent); UseMessageEventHook(RoomEntryInfoMessageEvent, onRoomEntryInfoMessageEvent); @@ -236,6 +241,7 @@ export const NavigatorMessageHandler: FC<{}> = props => UseMessageEventHook(NavigatorHomeRoomEvent, onNavigatorHomeRoomEvent); UseMessageEventHook(RoomSettingsUpdatedEvent, onRoomSettingsUpdatedEvent); UseMessageEventHook(RoomEnterErrorEvent, onRoomEnterErrorEvent); + UseMessageEventHook(NavigatorOpenRoomCreatorEvent, onRoomCreatorEvent); return null; } diff --git a/src/components/navigator/NavigatorView.scss b/src/components/navigator/NavigatorView.scss index 76adf929..22b513ce 100644 --- a/src/components/navigator/NavigatorView.scss +++ b/src/components/navigator/NavigatorView.scss @@ -52,8 +52,7 @@ width: 400px; .list-container { - min-height: 100px; - max-height: 100px; + height: 100px; .list-item { background-color: $grid-active-bg-color; diff --git a/src/components/navigator/NavigatorView.tsx b/src/components/navigator/NavigatorView.tsx index da22c3ce..98595623 100644 --- a/src/components/navigator/NavigatorView.tsx +++ b/src/components/navigator/NavigatorView.tsx @@ -46,6 +46,10 @@ export const NavigatorView: FC<{}> = props => case NavigatorEvent.TOGGLE_ROOM_LINK: setRoomLinkOpen(value => !value); return; + case NavigatorEvent.SHOW_ROOM_CREATOR: + setIsVisible(true); + setCreatorOpen(true); + return; } }, []); @@ -54,6 +58,7 @@ export const NavigatorView: FC<{}> = props => UseUiEvent(NavigatorEvent.TOGGLE_NAVIGATOR, onNavigatorEvent); UseUiEvent(NavigatorEvent.TOGGLE_ROOM_INFO, onNavigatorEvent); UseUiEvent(NavigatorEvent.TOGGLE_ROOM_LINK, onNavigatorEvent); + UseUiEvent(NavigatorEvent.SHOW_ROOM_CREATOR, onNavigatorEvent); const onUpdateDoorStateEvent = useCallback((event: UpdateDoorStateEvent) => { diff --git a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx index 0c438e0b..6b76f0ac 100644 --- a/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx +++ b/src/components/navigator/views/creator/NavigatorRoomCreatorView.tsx @@ -21,13 +21,13 @@ export const NavigatorRoomCreatorView: FC<{}> = props => const getRoomModelImage = (name: string) => GetConfiguration('images.url') + `/navigator/models/model_${ name }.png`; - const selectModel = (model: IRoomModel) => + const selectModel = (model: IRoomModel, index) => { if(!model) return; if(model.clubLevel > GetClubMemberLevel()) return; - setSelectedModelName(name); + setSelectedModelName(RoomModels[index].name); } const createRoom = () => @@ -97,9 +97,9 @@ export const NavigatorRoomCreatorView: FC<{}> = props => { - RoomModels.map(model => + RoomModels.map((model, index )=> { - return ( selectModel(model) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetClubMemberLevel() < model.clubLevel) }> + return ( selectModel(model, index) } itemActive={ (selectedModelName === model.name) } overflow="unset" gap={ 0 } className="p-1" disabled={ (GetClubMemberLevel() < model.clubLevel) }> diff --git a/src/components/navigator/views/room-info/NavigatorRoomInfoView.tsx b/src/components/navigator/views/room-info/NavigatorRoomInfoView.tsx index 0322fdd5..a8bbfe46 100644 --- a/src/components/navigator/views/room-info/NavigatorRoomInfoView.tsx +++ b/src/components/navigator/views/room-info/NavigatorRoomInfoView.tsx @@ -111,7 +111,7 @@ export const NavigatorRoomInfoView: FC = props => <> - { hasPermission('settings') && processAction('open_room_thumbnail_camera') } /> } + { hasPermission('settings') && processAction('open_room_thumbnail_camera') } /> } @@ -140,12 +140,10 @@ export const NavigatorRoomInfoView: FC = props => }) } } - - - DispatchUiEvent(new NavigatorEvent(NavigatorEvent.TOGGLE_ROOM_LINK)) } /> - { hasPermission('settings') && - processAction('open_room_settings') } /> } - + + { hasPermission('settings') && + processAction('open_room_settings') } /> } + DispatchUiEvent(new NavigatorEvent(NavigatorEvent.TOGGLE_ROOM_LINK)) } /> { roomInfoData.enteredGuestRoom.description } diff --git a/src/components/navigator/views/room-settings/views/NavigatorRoomSettingsRightsTabView.tsx b/src/components/navigator/views/room-settings/views/NavigatorRoomSettingsRightsTabView.tsx index 902ae41d..0014543c 100644 --- a/src/components/navigator/views/room-settings/views/NavigatorRoomSettingsRightsTabView.tsx +++ b/src/components/navigator/views/room-settings/views/NavigatorRoomSettingsRightsTabView.tsx @@ -23,22 +23,24 @@ export const NavigatorRoomSettingsRightsTabView: FC + { LocalizeText('navigator.flatctrls.userswithrights', [ 'displayed', 'total' ], [ roomSettingsData.usersWithRights.size.toString(), roomSettingsData.usersWithRights.size.toString() ]) } - - { Array.from(roomSettingsData.usersWithRights.entries()).map(([id, name], index) => - { - return ( - - - removeUserRights(id) }> { name } - - ); - }) } - + + + { Array.from(roomSettingsData.usersWithRights.entries()).map(([id, name], index) => + { + return ( + + + removeUserRights(id) }> { name } + + ); + }) } + + diff --git a/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx b/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx index 10235956..44b24271 100644 --- a/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx +++ b/src/components/notification-center/views/alert-layouts/GetAlertLayout.tsx @@ -1,6 +1,5 @@ -import { NotificationAlertItem, NotificationAlertType } from '../../../../api'; +import { NotificationAlertItem } from '../../../../api'; import { NotificationDefaultAlertView } from './NotificationDefaultAlertView'; -import { NotificationEventAlertView } from './NotificationEventAlertView'; export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) => { @@ -8,11 +7,5 @@ export const GetAlertLayout = (item: NotificationAlertItem, close: () => void) = const props = { key: item.id, item, close }; - switch(item.alertType) - { - case NotificationAlertType.EVENT: - return - default: - return - } + return } diff --git a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx index 13ab2fb8..3187faa9 100644 --- a/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx +++ b/src/components/notification-center/views/alert-layouts/NotificationDefaultAlertView.tsx @@ -18,6 +18,8 @@ export const NotificationDefaultAlertView: FC close(); }, [ item, close ]); + const isAction = (item.clickUrl && item.clickUrl.startsWith('event:')); + return ( { (item.messages.length > 0) && item.messages.map((message, index) => @@ -27,9 +29,12 @@ export const NotificationDefaultAlertView: FC return ; }) } - - { item.clickUrl && item.clickUrl.length && + { !isAction && + } + { !isAction && item.clickUrl && (item.clickUrl.length > 0) && } + { isAction && item.clickUrl && (item.clickUrl.length > 0) && + } ); diff --git a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx b/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx deleted file mode 100644 index dc016e45..00000000 --- a/src/components/notification-center/views/alert-layouts/NotificationEventAlertView.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { FC, useCallback } from 'react'; -import { LocalizeText, NotificationAlertItem, NotificationUtilities } from '../../../../api'; -import { LayoutNotificationAlertView, LayoutNotificationAlertViewProps } from '../../../../common'; - -export interface NotificationEventAlertViewProps extends LayoutNotificationAlertViewProps -{ - item: NotificationAlertItem; -} - -export const NotificationEventAlertView: FC = props => -{ - const { item = null, title = ((props.item && props.item.title) || ''), close = null, ...rest } = props; - - const visitUrl = useCallback(() => - { - NotificationUtilities.openUrl(item.clickUrl); - - close(); - }, [ item, close ]); - - return ( - - { (item.messages.length > 0) && item.messages.map((message, index) => - { - const htmlText = message.replace(/\r\n|\r|\n/g, '
'); - - return ( -
- ); - }) } -
- -
- - ); -} diff --git a/src/components/purse/views/SeasonalView.tsx b/src/components/purse/views/SeasonalView.tsx index c60824a5..0c869bb7 100644 --- a/src/components/purse/views/SeasonalView.tsx +++ b/src/components/purse/views/SeasonalView.tsx @@ -13,7 +13,7 @@ export const SeasonalView: FC = props => const { type = -1, amount = -1 } = props; return ( - + { LocalizeText(`purse.seasonal.currency.${ type }`) } { LocalizeFormattedNumber(amount) } diff --git a/src/components/room/widgets/infostand/InfoStandWidgetUserView.tsx b/src/components/room/widgets/infostand/InfoStandWidgetUserView.tsx index 309f8a8d..aa3aa20f 100644 --- a/src/components/room/widgets/infostand/InfoStandWidgetUserView.tsx +++ b/src/components/room/widgets/infostand/InfoStandWidgetUserView.tsx @@ -138,14 +138,18 @@ export const InfoStandWidgetUserView: FC = props = { (userData.type !== RoomWidgetUpdateInfostandUserEvent.OWN_USER) && - { motto } } + + { motto } + } { userData.type === RoomWidgetUpdateInfostandUserEvent.OWN_USER && - { !isEditingMotto && - setIsEditingMotto(true) }>{ motto } } - { isEditingMotto && - setMotto(event.target.value) } onBlur={ onMottoBlur } onKeyDown={ onMottoKeyDown } autoFocus={ true } /> } + + { !isEditingMotto && + setIsEditingMotto(true) }>{ motto } } + { isEditingMotto && + setMotto(event.target.value) } onBlur={ onMottoBlur } onKeyDown={ onMottoKeyDown } autoFocus={ true } /> } + }
diff --git a/src/events/navigator/NavigatorEvent.ts b/src/events/navigator/NavigatorEvent.ts index 2323940d..848e6747 100644 --- a/src/events/navigator/NavigatorEvent.ts +++ b/src/events/navigator/NavigatorEvent.ts @@ -8,6 +8,7 @@ export class NavigatorEvent extends NitroEvent public static TOGGLE_ROOM_INFO: string = 'NE_TOGGLE_ROOM_INFO'; public static TOGGLE_ROOM_LINK: string = 'NE_TOGGLE_ROOM_LINK'; public static TOGGLE_ROOM_SETTINGS: string = 'NE_TOGGLE_ROOM_SETTINGS'; + public static SHOW_ROOM_CREATOR: string = 'NE_TOGGLE_CREATOR'; private _roomId: number; private _password: string;