Catalog updates

This commit is contained in:
Bill 2022-03-30 15:24:57 -04:00
parent 2e44b5e693
commit 6ae4efd3aa
22 changed files with 41 additions and 56 deletions

View File

@ -0,0 +1,11 @@
export class ProductTypeEnum
{
public static WALL: string = 'i';
public static FLOOR: string = 's';
public static EFFECT: string = 'e';
public static HABBO_CLUB: string = 'h';
public static BADGE: string = 'b';
public static GAME_TOKEN: string = 'GAME_TOKEN';
public static PET: string = 'p';
public static ROBOT: string = 'r';
}

1
src/api/catalog/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './ProductTypeEnum';

View File

@ -1,5 +1,6 @@
export * from './achievements'; export * from './achievements';
export * from './campaign'; export * from './campaign';
export * from './catalog';
export * from './common'; export * from './common';
export * from './core'; export * from './core';
export * from './friends'; export * from './friends';

View File

@ -1,7 +1,7 @@
import { IFurnitureData, IGetImageListener, NitroEvent, NitroRenderTexture, PetFigureData, RoomObjectCategory, RoomObjectVariable, RoomSessionPresentEvent, RoomWidgetEnum, TextureUtils, Vector3d } from '@nitrots/nitro-renderer'; import { IFurnitureData, IGetImageListener, NitroEvent, NitroRenderTexture, PetFigureData, RoomObjectCategory, RoomObjectVariable, RoomSessionPresentEvent, RoomWidgetEnum, TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { GetSessionDataManager, IsOwnerOfFurniture } from '../../..'; import { GetSessionDataManager, IsOwnerOfFurniture } from '../../..';
import { GetRoomEngine, LocalizeText } from '../../../..'; import { GetRoomEngine, LocalizeText } from '../../../..';
import { ProductTypeEnum } from '../../../../../components/catalog/common/ProductTypeEnum'; import { ProductTypeEnum } from '../../../../catalog';
import { RoomWidgetUpdateEvent, RoomWidgetUpdatePresentDataEvent } from '../events'; import { RoomWidgetUpdateEvent, RoomWidgetUpdatePresentDataEvent } from '../events';
import { RoomWidgetFurniToWidgetMessage, RoomWidgetPresentOpenMessage } from '../messages'; import { RoomWidgetFurniToWidgetMessage, RoomWidgetPresentOpenMessage } from '../messages';
import { RoomWidgetMessage } from '../messages/RoomWidgetMessage'; import { RoomWidgetMessage } from '../messages/RoomWidgetMessage';

View File

@ -1,6 +1,6 @@
import { IFurnitureData } from '@nitrots/nitro-renderer'; import { IFurnitureData } from '@nitrots/nitro-renderer';
import { GetSessionDataManager } from '.'; import { GetSessionDataManager } from '.';
import { ProductTypeEnum } from '../../../components/catalog/common/ProductTypeEnum'; import { ProductTypeEnum } from '../../catalog';
export function GetFurnitureData(furniClassId: number, productType: string): IFurnitureData export function GetFurnitureData(furniClassId: number, productType: string): IFurnitureData
{ {

View File

@ -1,7 +1,6 @@
import { FC } from 'react'; import { FC } from 'react';
import { LayoutImage, LayoutImageProps } from '.'; import { LayoutImage, LayoutImageProps } from '.';
import { GetRoomEngine } from '../../api'; import { GetRoomEngine, ProductTypeEnum } from '../../api';
import { ProductTypeEnum } from '../../components/catalog/common/ProductTypeEnum';
interface LayoutFurniIconImageViewProps extends LayoutImageProps interface LayoutFurniIconImageViewProps extends LayoutImageProps
{ {

View File

@ -1,7 +1,6 @@
import { IGetImageListener, ImageResult, TextureUtils, Vector3d } from '@nitrots/nitro-renderer'; import { IGetImageListener, ImageResult, TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react'; import { FC, useCallback, useEffect, useState } from 'react';
import { GetRoomEngine } from '../../api'; import { GetRoomEngine, ProductTypeEnum } from '../../api';
import { ProductTypeEnum } from '../../components/catalog/common/ProductTypeEnum';
import { Base } from '../Base'; import { Base } from '../Base';
interface LayoutFurniImageViewProps interface LayoutFurniImageViewProps

View File

@ -1,7 +1,7 @@
import { ApproveNameMessageEvent, CatalogPageMessageEvent, CatalogPagesListEvent, ClubGiftInfoEvent, GiftReceiverNotFoundEvent, GiftWrappingConfigurationEvent, HabboClubOffersMessageEvent, LimitedEditionSoldOutEvent, MarketplaceMakeOfferResult, NodeData, ProductOfferEvent, PurchaseErrorMessageEvent, PurchaseNotAllowedMessageEvent, PurchaseOKMessageEvent, SellablePetPalettesMessageEvent, UserSubscriptionEvent } from '@nitrots/nitro-renderer'; import { ApproveNameMessageEvent, CatalogPageMessageEvent, CatalogPagesListEvent, ClubGiftInfoEvent, GiftReceiverNotFoundEvent, GiftWrappingConfigurationEvent, HabboClubOffersMessageEvent, LimitedEditionSoldOutEvent, MarketplaceMakeOfferResult, NodeData, ProductOfferEvent, PurchaseErrorMessageEvent, PurchaseNotAllowedMessageEvent, PurchaseOKMessageEvent, SellablePetPalettesMessageEvent, UserSubscriptionEvent } from '@nitrots/nitro-renderer';
import { GuildMembershipsMessageEvent } from '@nitrots/nitro-renderer/src/nitro/communication/messages/incoming/user/GuildMembershipsMessageEvent'; import { GuildMembershipsMessageEvent } from '@nitrots/nitro-renderer/src/nitro/communication/messages/incoming/user/GuildMembershipsMessageEvent';
import { FC, useCallback } from 'react'; import { FC, useCallback } from 'react';
import { GetFurnitureData, GetProductDataForLocalization, LocalizeText, NotificationAlertType, NotificationUtilities } from '../../api'; import { GetFurnitureData, GetProductDataForLocalization, LocalizeText, NotificationAlertType, NotificationUtilities, ProductTypeEnum } from '../../api';
import { CatalogGiftReceiverNotFoundEvent, CatalogNameResultEvent, CatalogPurchasedEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent } from '../../events'; import { CatalogGiftReceiverNotFoundEvent, CatalogNameResultEvent, CatalogPurchasedEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent } from '../../events';
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../hooks'; import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../hooks';
import { useCatalogContext } from './CatalogContext'; import { useCatalogContext } from './CatalogContext';
@ -15,7 +15,6 @@ import { IPurchasableOffer } from './common/IPurchasableOffer';
import { Offer } from './common/Offer'; import { Offer } from './common/Offer';
import { PageLocalization } from './common/PageLocalization'; import { PageLocalization } from './common/PageLocalization';
import { Product } from './common/Product'; import { Product } from './common/Product';
import { ProductTypeEnum } from './common/ProductTypeEnum';
import { SubscriptionInfo } from './common/SubscriptionInfo'; import { SubscriptionInfo } from './common/SubscriptionInfo';
export const CatalogMessageHandler: FC<{}> = props => export const CatalogMessageHandler: FC<{}> = props =>

View File

@ -1,7 +1,6 @@
import { CatalogPageMessageOfferData, RoomObjectCategory, RoomObjectPlacementSource } from '@nitrots/nitro-renderer'; import { CatalogPageMessageOfferData, RoomObjectCategory, RoomObjectPlacementSource } from '@nitrots/nitro-renderer';
import { GetRoomEngine } from '../../../api'; import { GetRoomEngine, ProductTypeEnum } from '../../../api';
import { IsCatalogOfferDraggable } from './IsCatalogOfferDraggable'; import { IsCatalogOfferDraggable } from './IsCatalogOfferDraggable';
import { ProductTypeEnum } from './ProductTypeEnum';
export const AttemptCatalogPlacement = (offer: CatalogPageMessageOfferData) => export const AttemptCatalogPlacement = (offer: CatalogPageMessageOfferData) =>
{ {

View File

@ -1,6 +1,5 @@
import { CatalogPageMessageOfferData, RoomControllerLevel } from '@nitrots/nitro-renderer'; import { CatalogPageMessageOfferData, RoomControllerLevel } from '@nitrots/nitro-renderer';
import { GetRoomSession } from '../../../api'; import { GetRoomSession, ProductTypeEnum } from '../../../api';
import { ProductTypeEnum } from './ProductTypeEnum';
export const IsCatalogOfferDraggable = (offer: CatalogPageMessageOfferData) => export const IsCatalogOfferDraggable = (offer: CatalogPageMessageOfferData) =>
{ {

View File

@ -1,9 +1,8 @@
import { GetFurnitureData, GetProductDataForLocalization, LocalizeText } from '../../../api'; import { GetFurnitureData, GetProductDataForLocalization, LocalizeText, ProductTypeEnum } from '../../../api';
import { ICatalogPage } from './ICatalogPage'; import { ICatalogPage } from './ICatalogPage';
import { IProduct } from './IProduct'; import { IProduct } from './IProduct';
import { IPurchasableOffer } from './IPurchasableOffer'; import { IPurchasableOffer } from './IPurchasableOffer';
import { Product } from './Product'; import { Product } from './Product';
import { ProductTypeEnum } from './ProductTypeEnum';
export class Offer implements IPurchasableOffer export class Offer implements IPurchasableOffer
{ {

View File

@ -1,9 +1,8 @@
import { IFurnitureData, IObjectData, IProductData } from '@nitrots/nitro-renderer'; import { IFurnitureData, IObjectData, IProductData } from '@nitrots/nitro-renderer';
import { GetConfiguration, GetRoomEngine, GetSessionDataManager } from '../../../api'; import { GetConfiguration, GetRoomEngine, GetSessionDataManager, ProductTypeEnum } from '../../../api';
import { GetPixelEffectIcon, GetSubscriptionProductIcon } from './CatalogUtilities'; import { GetPixelEffectIcon, GetSubscriptionProductIcon } from './CatalogUtilities';
import { IProduct } from './IProduct'; import { IProduct } from './IProduct';
import { IPurchasableOffer } from './IPurchasableOffer'; import { IPurchasableOffer } from './IPurchasableOffer';
import { ProductTypeEnum } from './ProductTypeEnum';
export class Product implements IProduct export class Product implements IProduct
{ {

View File

@ -1,11 +0,0 @@
export class ProductTypeEnum
{
public static WALL: string = 'i';
public static FLOOR: string = 's';
public static EFFECT: string = 'e';
public static HABBO_CLUB: string = 'h';
public static BADGE: string = 'b';
public static GAME_TOKEN: string = 'GAME_TOKEN';
public static PET: string = 'p';
public static ROBOT: string = 'r';
}

View File

@ -2,12 +2,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { PurchaseFromCatalogAsGiftComposer } from '@nitrots/nitro-renderer'; import { PurchaseFromCatalogAsGiftComposer } from '@nitrots/nitro-renderer';
import classNames from 'classnames'; import classNames from 'classnames';
import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../../api'; import { GetSessionDataManager, LocalizeText, ProductTypeEnum, SendMessageComposer } from '../../../../api';
import { Base, Button, ButtonGroup, Column, Flex, FormGroup, LayoutCurrencyIcon, LayoutFurniImageView, LayoutGiftTagView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common'; import { Base, Button, ButtonGroup, Column, Flex, FormGroup, LayoutCurrencyIcon, LayoutFurniImageView, LayoutGiftTagView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
import { CatalogEvent, CatalogInitGiftEvent, CatalogPurchasedEvent } from '../../../../events'; import { CatalogEvent, CatalogInitGiftEvent, CatalogPurchasedEvent } from '../../../../events';
import { BatchUpdates, UseUiEvent } from '../../../../hooks'; import { BatchUpdates, UseUiEvent } from '../../../../hooks';
import { useCatalogContext } from '../../CatalogContext'; import { useCatalogContext } from '../../CatalogContext';
import { ProductTypeEnum } from '../../common/ProductTypeEnum';
export const CatalogGiftView: FC<{}> = props => export const CatalogGiftView: FC<{}> = props =>
{ {

View File

@ -1,5 +1,6 @@
import { FC, useMemo } from 'react'; import { FC, useMemo } from 'react';
import { LayoutGridItem, LayoutGridItemProps } from '../../../../../common/layout/LayoutGridItem'; import { ProductTypeEnum } from '../../../../../api';
import { LayoutAvatarImageView, LayoutGridItem, LayoutGridItemProps } from '../../../../../common';
import { IPurchasableOffer } from '../../../common/IPurchasableOffer'; import { IPurchasableOffer } from '../../../common/IPurchasableOffer';
import { Offer } from '../../../common/Offer'; import { Offer } from '../../../common/Offer';
@ -26,5 +27,10 @@ export const CatalogGridOfferView: FC<CatalogGridOfferViewProps> = props =>
if(!product) return null; if(!product) return null;
return <LayoutGridItem itemImage={ iconUrl } itemCount={ ((offer.pricingModel === Offer.PRICING_MODEL_MULTI) ? product.productCount : 1) } itemUniqueSoldout={ (product.uniqueLimitedItemSeriesSize && !product.uniqueLimitedItemsLeft) } itemUniqueNumber={ product.uniqueLimitedItemSeriesSize } { ...rest } />; return (
<LayoutGridItem itemImage={ iconUrl } itemCount={ ((offer.pricingModel === Offer.PRICING_MODEL_MULTI) ? product.productCount : 1) } itemUniqueSoldout={ (product.uniqueLimitedItemSeriesSize && !product.uniqueLimitedItemsLeft) } itemUniqueNumber={ product.uniqueLimitedItemSeriesSize } { ...rest }>
{ (offer.product.productType === ProductTypeEnum.ROBOT) &&
<LayoutAvatarImageView figure={ offer.product.extraParam } headOnly={ true } direction={ 3 } /> }
</LayoutGridItem>
);
} }

View File

@ -1,9 +1,5 @@
import { FC } from 'react'; import { FC } from 'react';
import { Base } from '../../../../../common/Base'; import { Base, Column, Flex, Grid, Text } from '../../../../../common';
import { Column } from '../../../../../common/Column';
import { Flex } from '../../../../../common/Flex';
import { Grid } from '../../../../../common/Grid';
import { Text } from '../../../../../common/Text';
import { useCatalogContext } from '../../../CatalogContext'; import { useCatalogContext } from '../../../CatalogContext';
import { CatalogAddOnBadgeWidgetView } from '../widgets/CatalogAddOnBadgeWidgetView'; import { CatalogAddOnBadgeWidgetView } from '../widgets/CatalogAddOnBadgeWidgetView';
import { CatalogItemGridWidgetView } from '../widgets/CatalogItemGridWidgetView'; import { CatalogItemGridWidgetView } from '../widgets/CatalogItemGridWidgetView';

View File

@ -1,11 +1,6 @@
import { FC, useCallback, useMemo } from 'react'; import { FC, useCallback, useMemo } from 'react';
import { LocalizeText } from '../../../../../../api'; import { LocalizeText, ProductTypeEnum } from '../../../../../../api';
import { LayoutFurniIconImageView } from '../../../../../../common'; import { Button, Column, LayoutFurniIconImageView, LayoutGridItem, Text } from '../../../../../../common';
import { Button } from '../../../../../../common/Button';
import { Column } from '../../../../../../common/Column';
import { LayoutGridItem } from '../../../../../../common/layout/LayoutGridItem';
import { Text } from '../../../../../../common/Text';
import { ProductTypeEnum } from '../../../../common/ProductTypeEnum';
import { MarketplaceOfferData } from './common/MarketplaceOfferData'; import { MarketplaceOfferData } from './common/MarketplaceOfferData';
import { MarketPlaceOfferState } from './common/MarketplaceOfferState'; import { MarketPlaceOfferState } from './common/MarketplaceOfferState';

View File

@ -1,12 +1,11 @@
import { GetMarketplaceConfigurationMessageComposer, MakeOfferMessageComposer, MarketplaceConfigurationEvent } from '@nitrots/nitro-renderer'; import { GetMarketplaceConfigurationMessageComposer, MakeOfferMessageComposer, MarketplaceConfigurationEvent } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react'; import { FC, useCallback, useEffect, useState } from 'react';
import { LocalizeText, NotificationUtilities, SendMessageComposer } from '../../../../../../api'; import { LocalizeText, NotificationUtilities, ProductTypeEnum, SendMessageComposer } from '../../../../../../api';
import { Base, Button, Column, Grid, LayoutFurniImageView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../../../common'; import { Base, Button, Column, Grid, LayoutFurniImageView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../../../common';
import { CatalogPostMarketplaceOfferEvent } from '../../../../../../events'; import { CatalogPostMarketplaceOfferEvent } from '../../../../../../events';
import { UseMessageEventHook, UseUiEvent } from '../../../../../../hooks'; import { UseMessageEventHook, UseUiEvent } from '../../../../../../hooks';
import { FurnitureItem } from '../../../../../inventory/common/FurnitureItem'; import { FurnitureItem } from '../../../../../inventory/common/FurnitureItem';
import { useCatalogContext } from '../../../../CatalogContext'; import { useCatalogContext } from '../../../../CatalogContext';
import { ProductTypeEnum } from '../../../../common/ProductTypeEnum';
export const MarketplacePostOfferView : FC<{}> = props => export const MarketplacePostOfferView : FC<{}> = props =>
{ {

View File

@ -1,8 +1,8 @@
import { FC } from 'react'; import { FC } from 'react';
import { AutoGrid, AutoGridProps } from '../../../../../common/AutoGrid'; import { ProductTypeEnum } from '../../../../../api';
import { AutoGrid, AutoGridProps } from '../../../../../common';
import { useCatalogContext } from '../../../CatalogContext'; import { useCatalogContext } from '../../../CatalogContext';
import { IPurchasableOffer } from '../../../common/IPurchasableOffer'; import { IPurchasableOffer } from '../../../common/IPurchasableOffer';
import { ProductTypeEnum } from '../../../common/ProductTypeEnum';
import { CatalogGridOfferView } from '../common/CatalogGridOfferView'; import { CatalogGridOfferView } from '../common/CatalogGridOfferView';
interface CatalogItemGridWidgetViewProps extends AutoGridProps interface CatalogItemGridWidgetViewProps extends AutoGridProps

View File

@ -1,13 +1,10 @@
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { LocalizeText } from '../../../../../api'; import { LocalizeText, ProductTypeEnum } from '../../../../../api';
import { AutoGrid, AutoGridProps } from '../../../../../common/AutoGrid'; import { AutoGrid, AutoGridProps, Button, ButtonGroup } from '../../../../../common';
import { Button } from '../../../../../common/Button';
import { ButtonGroup } from '../../../../../common/ButtonGroup';
import { BatchUpdates } from '../../../../../hooks'; import { BatchUpdates } from '../../../../../hooks';
import { useCatalogContext } from '../../../CatalogContext'; import { useCatalogContext } from '../../../CatalogContext';
import { IPurchasableOffer } from '../../../common/IPurchasableOffer'; import { IPurchasableOffer } from '../../../common/IPurchasableOffer';
import { Offer } from '../../../common/Offer'; import { Offer } from '../../../common/Offer';
import { ProductTypeEnum } from '../../../common/ProductTypeEnum';
import { CatalogGridOfferView } from '../common/CatalogGridOfferView'; import { CatalogGridOfferView } from '../common/CatalogGridOfferView';
interface CatalogSpacesWidgetViewProps extends AutoGridProps interface CatalogSpacesWidgetViewProps extends AutoGridProps

View File

@ -1,11 +1,10 @@
import { Vector3d } from '@nitrots/nitro-renderer'; import { Vector3d } from '@nitrots/nitro-renderer';
import { FC, useEffect } from 'react'; import { FC, useEffect } from 'react';
import { GetAvatarRenderManager, GetSessionDataManager } from '../../../../../api'; import { GetAvatarRenderManager, GetSessionDataManager, ProductTypeEnum } from '../../../../../api';
import { AutoGrid, Column, LayoutGridItem, LayoutRoomPreviewerView } from '../../../../../common'; import { AutoGrid, Column, LayoutGridItem, LayoutRoomPreviewerView } from '../../../../../common';
import { useCatalogContext } from '../../../CatalogContext'; import { useCatalogContext } from '../../../CatalogContext';
import { FurniCategory } from '../../../common/FurniCategory'; import { FurniCategory } from '../../../common/FurniCategory';
import { Offer } from '../../../common/Offer'; import { Offer } from '../../../common/Offer';
import { ProductTypeEnum } from '../../../common/ProductTypeEnum';
export const CatalogViewProductWidgetView: FC<{}> = props => export const CatalogViewProductWidgetView: FC<{}> = props =>
{ {

View File

@ -1,10 +1,9 @@
import { RoomObjectCategory, RoomObjectOperationType } from '@nitrots/nitro-renderer'; import { RoomObjectCategory, RoomObjectOperationType } from '@nitrots/nitro-renderer';
import { FC, useCallback, useMemo, useState } from 'react'; import { FC, useCallback, useMemo, useState } from 'react';
import { CreateLinkEvent, GetRoomEngine, GetSessionDataManager, LocalizeText, RoomWidgetPresentOpenMessage, RoomWidgetUpdatePresentDataEvent, RoomWidgetUpdateRoomObjectEvent } from '../../../../../api'; import { CreateLinkEvent, GetRoomEngine, GetSessionDataManager, LocalizeText, ProductTypeEnum, RoomWidgetPresentOpenMessage, RoomWidgetUpdatePresentDataEvent, RoomWidgetUpdateRoomObjectEvent } from '../../../../../api';
import { Button, Column, Flex, LayoutGiftTagView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../../common'; import { Button, Column, Flex, LayoutGiftTagView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../../common';
import { BatchUpdates } from '../../../../../hooks'; import { BatchUpdates } from '../../../../../hooks';
import { UseEventDispatcherHook } from '../../../../../hooks/events/UseEventDispatcherHook'; import { UseEventDispatcherHook } from '../../../../../hooks/events/UseEventDispatcherHook';
import { ProductTypeEnum } from '../../../../catalog/common/ProductTypeEnum';
import { useRoomContext } from '../../../RoomContext'; import { useRoomContext } from '../../../RoomContext';
const FLOOR: string = 'floor'; const FLOOR: string = 'floor';