diff --git a/src/api/nitro/room/widgets/handlers/RoomWidgetAvatarInfoHandler.ts b/src/api/nitro/room/widgets/handlers/RoomWidgetAvatarInfoHandler.ts index db1073d5..9365f015 100644 --- a/src/api/nitro/room/widgets/handlers/RoomWidgetAvatarInfoHandler.ts +++ b/src/api/nitro/room/widgets/handlers/RoomWidgetAvatarInfoHandler.ts @@ -120,24 +120,24 @@ export class RoomWidgetAvatarInfoHandler extends RoomWidgetHandler { if(userData.ownerId === ownerId) { - if(userData.hasSaddle && (specialType === FurniCategory._Str_6096)) replace = true; + if(userData.hasSaddle && (specialType === FurniCategory.PET_SADDLE)) replace = true; const figureParts = userData.figure.split(' '); const figurePart = (figureParts.length ? parseInt(figureParts[0]) : -1); if(figurePart === part) { - if(specialType === FurniCategory._Str_6915) + if(specialType === FurniCategory.MONSTERPLANT_REVIVAL) { if(!userData.canRevive) continue; } - if(specialType === FurniCategory._Str_8726) + if(specialType === FurniCategory.MONSTERPLANT_REBREED) { if((userData.petLevel < 7) || userData.canRevive || userData.canBreed) continue; } - if(specialType === FurniCategory._Str_9449) + if(specialType === FurniCategory.MONSTERPLANT_FERTILIZE) { if((userData.petLevel >= 7) || userData.canRevive) continue; } diff --git a/src/views/catalog/views/page/layout/CatalogLayout.scss b/src/views/catalog/views/page/layout/CatalogLayout.scss index d71c9f8a..69926aec 100644 --- a/src/views/catalog/views/page/layout/CatalogLayout.scss +++ b/src/views/catalog/views/page/layout/CatalogLayout.scss @@ -1,3 +1,4 @@ @import './frontpage4/CatalogLayoutFrontpage4View'; @import './info-loyalty/CatalogLayoutInfoLoyaltyView.scss'; @import './vip-buy/CatalogLayoutVipBuyView'; +@import './marketplace/marketplace-item/MarketplaceItemView'; diff --git a/src/views/catalog/views/page/layout/GetCatalogLayout.tsx b/src/views/catalog/views/page/layout/GetCatalogLayout.tsx index 8fe64187..bbef91a1 100644 --- a/src/views/catalog/views/page/layout/GetCatalogLayout.tsx +++ b/src/views/catalog/views/page/layout/GetCatalogLayout.tsx @@ -6,6 +6,8 @@ import { CatalogLayouGuildCustomFurniView } from './guild-custom-furni/CatalogLa import { CatalogLayouGuildForumView } from './guild-forum/CatalogLayoutGuildForumView'; import { CatalogLayouGuildFrontpageView } from './guild-frontpage/CatalogLayoutGuildFrontpageView'; import { CatalogLayoutInfoLoyaltyView } from './info-loyalty/CatalogLayoutInfoLoyaltyView'; +import { CatalogLayoutMarketplaceOwnItemsView } from './marketplace/own-items/CatalogLayoutMarketplaceOwnItemsView'; +import { CatalogLayoutMarketplacePublicItemsView } from './marketplace/public-items/CatalogLayoutMarketplacePublicItemsView'; import { CatalogLayoutPetView } from './pets/CatalogLayoutPetView'; import { CatalogLayoutPets2View } from './pets2/CatalogLayoutPets2View'; import { CatalogLayoutPets3View } from './pets3/CatalogLayoutPets3View'; @@ -41,9 +43,9 @@ export const GetCatalogLayout = (pageParser: CatalogPageMessageParser, roomPrevi case 'club_gifts': return null; case 'marketplace_own_items': - return null; + return ; case 'marketplace': - return null; + return ; case 'single_bundle': return ; case 'spaces_new': diff --git a/src/views/catalog/views/page/layout/marketplace/common/MarketplaceConfirmType.ts b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceConfirmType.ts new file mode 100644 index 00000000..dbc17f2a --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceConfirmType.ts @@ -0,0 +1,6 @@ +export class MarketplaceConfirmType +{ + public static readonly PURCHASE_CONFIRM_TYPE_NORMAL = 1; + public static readonly PURCHASE_CONFIRM_TYPE_HIGHER = 2; + public static readonly PURCHASE_CONFIRM_TYPE_INVALID = 3; +} diff --git a/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferData.ts b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferData.ts new file mode 100644 index 00000000..669ae001 --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferData.ts @@ -0,0 +1,128 @@ +import { IObjectData } from '@nitrots/nitro-renderer'; + +export class MarketplaceOfferData +{ + public static TYPE_LANDSCAPE: number = 1; + public static TYPE_FLOOR: number = 2; + + private _offerId: number; + private _furniId: number; + private _furniType: number; + private _extraData: string; + private _stuffData: IObjectData; + private _price: number; + private _averagePrice: number; + private _imageCallback: number; + private _status: number; + private _timeLeftMinutes: number = -1; + private _offerCount: number; + private _image: string; + + constructor(offerId: number, furniId: number, furniType: number, extraData: string, stuffData: IObjectData, price: number, status: number, averagePrice: number, offerCount: number = -1) + { + this._offerId = offerId; + this._furniId = furniId; + this._furniType = furniType; + this._extraData = extraData; + this._stuffData = stuffData; + this._price = price; + this._status = status; + this._averagePrice = averagePrice; + this._offerCount = offerCount; + } + + public get offerId(): number + { + return this._offerId; + } + + public set offerId(offerId: number) + { + this._offerId = offerId; + } + + public get furniId(): number + { + return this._furniId; + } + + public get furniType(): number + { + return this._furniType; + } + + public get extraData(): string + { + return this._extraData; + } + + public get stuffData(): IObjectData + { + return this._stuffData; + } + + public get price(): number + { + return this._price; + } + + public set price(price: number) + { + this._price = price; + } + + public get averagePrice(): number + { + return this._averagePrice; + } + + public get image(): string + { + return this._image; + } + + public set image(image: string) + { + this._image = image; + } + + public get imageCallback(): number + { + return this._imageCallback; + } + + public set imageCallback(callback: number) + { + this._imageCallback = callback; + } + + public get status(): number + { + return this._status; + } + + public get timeLeftMinutes(): number + { + return this._timeLeftMinutes; + } + + public set timeLeftMinutes(minutes: number) + { + this._timeLeftMinutes = minutes; + } + + public get offerCount(): number + { + return this._offerCount; + } + + public set offerCount(count: number) + { + this._offerCount = count; + } + + public get isUniqueLimitedItem(): boolean + { + return (this.stuffData && (this.stuffData.uniqueSeries > 0)); + } +} diff --git a/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferState.ts b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferState.ts new file mode 100644 index 00000000..20c0e45b --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/common/MarketplaceOfferState.ts @@ -0,0 +1,7 @@ +export class MarketPlaceOfferState +{ + public static readonly ONGOING = 1; + public static readonly ONGOING_OWN = 1; + public static readonly SOLD = 2; + public static readonly EXPIRED = 3; +} diff --git a/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.scss b/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.scss new file mode 100644 index 00000000..be2f5222 --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.scss @@ -0,0 +1,4 @@ +.marketplace-item { + max-height: 70px; + height: 70px; +} diff --git a/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.tsx b/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.tsx new file mode 100644 index 00000000..41cbcb4f --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/marketplace-item/MarketplaceItemView.tsx @@ -0,0 +1,91 @@ +import { FC, useCallback } from 'react'; +import { GetRoomEngine, LocalizeText } from '../../../../../../../api'; +import { NitroCardGridItemView } from '../../../../../../../layout'; +import { MarketplaceOfferData } from '../common/MarketplaceOfferData'; + +export const OWN_OFFER = 1; +export const OTHER_OFFER = 2; + +export interface MarketplaceItemViewProps +{ + offerData: MarketplaceOfferData; + type?: number; +} + +export const MarketplaceItemView: FC = props => +{ + const { offerData = null, type = OTHER_OFFER } = props; + + const getImageUrlForOffer = useCallback( () => + { + if(!offerData) return ''; + + switch(offerData.furniType) + { + case 1: + return GetRoomEngine().getFurnitureFloorIconUrl(offerData.furniId); + case 2: + return GetRoomEngine().getFurnitureWallIconUrl(offerData.furniId, offerData.extraData); + } + + return ''; + }, [offerData]); + + const getMarketplaceOfferTitle = useCallback(() => + { + if(!offerData) return ''; + + const localizationKey = offerData.furniType === 2 ? 'wallItem.name.' + offerData.furniId: 'roomItem.name.' + offerData.furniId; + + return LocalizeText(localizationKey); + }, [offerData]); + + const getMarketplaceOfferDescription = useCallback( () => + { + if(!offerData) return ''; + + const localizationKey = offerData.furniType === 2 ? 'wallItem.desc.' + offerData.furniId : 'roomItem.desc.' + offerData.furniId; + + return LocalizeText(localizationKey); + }, [offerData]); + + const offerTime = useCallback( () => + { + if(!offerData) return ''; + + const time = Math.max(1, offerData.timeLeftMinutes); + const hours = Math.floor(time / 60); + const minutes = time - (hours * 60); + + let text = minutes + ' ' + LocalizeText('catalog.marketplace.offer.minutes'); + if(hours > 0) + { + text = hours + ' ' + LocalizeText('catalog.marketplace.offer.hours') + ' ' + text; + } + + return LocalizeText('catalog.marketplace.offer.time_left', ['time'], [text] ); + }, [offerData]); + + return ( + + +
+
{getMarketplaceOfferTitle()}
+
{getMarketplaceOfferDescription()}
+ + { type === OWN_OFFER && <> +
{ LocalizeText('catalog.marketplace.offer.price_own_item', ['price'], [offerData.price.toString()])}
+
{ offerTime() }
+ + } + { type === OTHER_OFFER && <> +
{ LocalizeText('catalog.marketplace.offer.price_public_item', ['price', 'average'], [offerData.price.toString(), offerData.averagePrice.toString() ]) }
+
{ LocalizeText('catalog.marketplace.offer_count', ['count'], [offerData.offerCount.toString()]) }
+ + } +
+
+ { type === OWN_OFFER && } +
+
) +} diff --git a/src/views/catalog/views/page/layout/marketplace/own-items/CatalogLayoutMarketplaceOwnItemsView.tsx b/src/views/catalog/views/page/layout/marketplace/own-items/CatalogLayoutMarketplaceOwnItemsView.tsx new file mode 100644 index 00000000..bc397ecb --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/own-items/CatalogLayoutMarketplaceOwnItemsView.tsx @@ -0,0 +1,65 @@ +import { GetMarketplaceOwnOffersMessageComposer, MarketplaceOwnOffersEvent } from '@nitrots/nitro-renderer'; +import { FC, useCallback, useState } from 'react'; +import { LocalizeText } from '../../../../../../../api'; +import { BatchUpdates, CreateMessageHook, SendMessageHook, UseMountEffect } from '../../../../../../../hooks'; +import { NitroCardGridView } from '../../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../../layout/base'; +import { CatalogLayoutProps } from '../../CatalogLayout.types'; +import { MarketplaceOfferData } from '../common/MarketplaceOfferData'; +import { MarketplaceItemView, OWN_OFFER } from '../marketplace-item/MarketplaceItemView'; + +export interface CatalogLayoutMarketplaceOwnItemsViewProps extends CatalogLayoutProps +{ + +} + +export const CatalogLayoutMarketplaceOwnItemsView: FC = props => +{ + const [ creditsWaiting, setCreditsWaiting ] = useState(0); + const [ offers, setOffers ] = useState(new Map()); + + UseMountEffect(() => + { + SendMessageHook(new GetMarketplaceOwnOffersMessageComposer()); + }); + + const onMarketPlaceOwnOffersEvent = useCallback((event: MarketplaceOwnOffersEvent) => + { + const parser = event.getParser(); + + if(!parser) return; + + const latestOffers = new Map(); + parser.offers.forEach(entry => + { + const offerEntry = new MarketplaceOfferData(entry.offerId, entry.furniId, entry.furniType, entry.extraData, entry.stuffData, entry.price, entry.status, entry.averagePrice, entry.offerCount); + offerEntry.timeLeftMinutes = entry.timeLeftMinutes; + latestOffers.set(entry.offerId, offerEntry); + }); + + BatchUpdates(() => + { + setCreditsWaiting(parser.creditsWaiting); + setOffers(latestOffers); + }); + }, []); + + CreateMessageHook(MarketplaceOwnOffersEvent, onMarketPlaceOwnOffersEvent); + + return ( + <> + { (creditsWaiting <= 0) && {LocalizeText('catalog.marketplace.redeem.no_sold_items')}} + + { (creditsWaiting > 0) && {LocalizeText('catalog.marketplace.redeem.get_credits', ['count', 'credits'], ['0', creditsWaiting.toString()])}} + + + +
{LocalizeText('catalog.marketplace.items_found', ['count'], [offers.size.toString()])}
+ + { + Array.from(offers.values()).map( (entry, index) => ) + } + + + ); +} diff --git a/src/views/catalog/views/page/layout/marketplace/public-items/CatalogLayoutMarketplacePublicItemsView.tsx b/src/views/catalog/views/page/layout/marketplace/public-items/CatalogLayoutMarketplacePublicItemsView.tsx new file mode 100644 index 00000000..435be430 --- /dev/null +++ b/src/views/catalog/views/page/layout/marketplace/public-items/CatalogLayoutMarketplacePublicItemsView.tsx @@ -0,0 +1,18 @@ +import { FC } from 'react'; +import { UseMountEffect } from '../../../../../../../hooks'; +import { CatalogLayoutProps } from '../../CatalogLayout.types'; + +export interface CatalogLayoutMarketplacePublicItemsViewProps extends CatalogLayoutProps +{ + +} + +export const CatalogLayoutMarketplacePublicItemsView: FC = props => +{ + UseMountEffect(() => + { + //request stuff + }); + + return null; +} diff --git a/src/views/inventory/common/FurniCategory.ts b/src/views/inventory/common/FurniCategory.ts index c4175ab1..65289472 100644 --- a/src/views/inventory/common/FurniCategory.ts +++ b/src/views/inventory/common/FurniCategory.ts @@ -1,26 +1,26 @@ export class FurniCategory { public static DEFAULT: number = 1; - public static _Str_3639: number = 2; - public static _Str_3683: number = 3; - public static _Str_3432: number = 4; - public static _Str_12351: number = 5; - public static _Str_5186: number = 6; - public static _Str_21911: number = 7; - public static _Str_9125: number = 8; - public static _Str_5922: number = 9; - public static _Str_18231: number = 10; - public static _Str_4255: number = 11; - public static _Str_19933: number = 12; - public static _Str_7696: number = 13; - public static _Str_7297: number = 14; - public static _Str_7954: number = 15; - public static _Str_6096: number = 16; - public static _Str_12454: number = 17; - public static _Str_19144: number = 18; + public static WALL_PAPER: number = 2; + public static FLOOR: number = 3; + public static LANDSCAPE: number = 4; + public static POST_IT: number = 5; + public static POSTER: number = 6; + public static SOUND_SET: number = 7; + public static TRAX_SONG: number = 8; + public static PRESENT: number = 9; + public static ECOTRON_BOX: number = 10; + public static TROPHY: number = 11; + public static CREDIT_FURNI: number = 12; + public static PET_SHAMPOO: number = 13; + public static PET_CUSTOM_PART: number = 14; + public static PET_CUSTOM_PART_SHAMPOO: number = 15; + public static PET_SADDLE: number = 16; + public static GUILD_FURNI: number = 17; + public static GAME_FURNI: number = 18; public static MONSTERPLANT_SEED: number = 19; - public static _Str_6915: number = 20; - public static _Str_8726: number = 21; - public static _Str_9449: number = 22; - public static _Str_12534: number = 23; -} \ No newline at end of file + public static MONSTERPLANT_REVIVAL: number = 20; + public static MONSTERPLANT_REBREED: number = 21; + public static MONSTERPLANT_FERTILIZE: number = 22; + public static FIGURE_PURCHASABLE_SET: number = 23; +} diff --git a/src/views/inventory/common/FurnitureUtilities.ts b/src/views/inventory/common/FurnitureUtilities.ts index 96dc07b3..ef727f4e 100644 --- a/src/views/inventory/common/FurnitureUtilities.ts +++ b/src/views/inventory/common/FurnitureUtilities.ts @@ -18,7 +18,7 @@ export function attemptItemPlacement(groupItem: GroupItem, flag: boolean = false if(!item) return false; - if((item.category === FurniCategory._Str_3683) || (item.category === FurniCategory._Str_3639) || (item.category === FurniCategory._Str_3432)) + if((item.category === FurniCategory.FLOOR) || (item.category === FurniCategory.WALL_PAPER) || (item.category === FurniCategory.LANDSCAPE)) { if(flag) return false; @@ -36,7 +36,7 @@ export function attemptItemPlacement(groupItem: GroupItem, flag: boolean = false if(item.isWallItem) category = RoomObjectCategory.WALL; else category = RoomObjectCategory.FLOOR; - if((item.category === FurniCategory._Str_5186)) // or external image from furnidata + if((item.category === FurniCategory.POSTER)) // or external image from furnidata { isMoving = GetRoomEngine().processRoomObjectPlacement(RoomObjectPlacementSource.INVENTORY, item.id, category, item.type, item.stuffData.getLegacyString()); } @@ -108,7 +108,7 @@ function getAllItemIds(groupItems: GroupItem[]): number[] { let totalCount = groupItem.getTotalCount(); - if(groupItem.category === FurniCategory._Str_12351) totalCount = 1; + if(groupItem.category === FurniCategory.POST_IT) totalCount = 1; let i = 0; @@ -240,7 +240,7 @@ function addGroupableFurnitureItem(set: GroupItem[], item: FurnitureItem, unseen { if((groupItem.type === item.type) && (groupItem.isWallItem === item.isWallItem) && groupItem.isGroupable) { - if(item.category === FurniCategory._Str_5186) + if(item.category === FurniCategory.POSTER) { if(groupItem.stuffData.getLegacyString() === item.stuffData.getLegacyString()) { @@ -250,7 +250,7 @@ function addGroupableFurnitureItem(set: GroupItem[], item: FurnitureItem, unseen } } - else if(item.category === FurniCategory._Str_12454) + else if(item.category === FurniCategory.GUILD_FURNI) { if(item.stuffData.compare(groupItem.stuffData)) { @@ -309,7 +309,7 @@ export function createGroupItem(type: number, category: number, stuffData: IObje { // const iconImage: HTMLImageElement = null; - if(category === FurniCategory._Str_3639) + if(category === FurniCategory.WALL_PAPER) { // const icon = this._windowManager.assets.getAssetByName("inventory_furni_icon_wallpaper"); // if (icon != null) @@ -318,7 +318,7 @@ export function createGroupItem(type: number, category: number, stuffData: IObje // } } - else if(category === FurniCategory._Str_3683) + else if(category === FurniCategory.FLOOR) { // const icon = this._windowManager.assets.getAssetByName("inventory_furni_icon_floor"); // if (icon != null) @@ -327,7 +327,7 @@ export function createGroupItem(type: number, category: number, stuffData: IObje // } } - else if(category === FurniCategory._Str_3432) + else if(category === FurniCategory.LANDSCAPE) { // const icon = this._windowManager.assets.getAssetByName("inventory_furni_icon_landscape"); // if (icon != null) diff --git a/src/views/inventory/common/GroupItem.ts b/src/views/inventory/common/GroupItem.ts index 8eb40644..62c9f853 100644 --- a/src/views/inventory/common/GroupItem.ts +++ b/src/views/inventory/common/GroupItem.ts @@ -199,7 +199,7 @@ export class GroupItem public getTotalCount(): number { - if(this._category === FurniCategory._Str_12351) + if(this._category === FurniCategory.POST_IT) { let count = 0; let index = 0; @@ -221,7 +221,7 @@ export class GroupItem public getUnlockedCount(): number { - if(this.category === FurniCategory._Str_12351) return this.getTotalCount(); + if(this.category === FurniCategory.POST_IT) return this.getTotalCount(); let count = 0; let index = 0; @@ -318,10 +318,10 @@ export class GroupItem switch(this._category) { - case FurniCategory._Str_5186: + case FurniCategory.POSTER: key = (('poster_' + k.stuffData.getLegacyString()) + '_name'); break; - case FurniCategory._Str_9125: + case FurniCategory.TRAX_SONG: this._name = 'SONG_NAME'; return; default: diff --git a/src/views/inventory/common/TradingUtilities.ts b/src/views/inventory/common/TradingUtilities.ts index 9e6e9204..dbf12e4b 100644 --- a/src/views/inventory/common/TradingUtilities.ts +++ b/src/views/inventory/common/TradingUtilities.ts @@ -30,12 +30,12 @@ export function parseTradeItems(items: ItemDataStructure[], _arg_2: AdvancedMap< name = ('itemid' + item.itemId); } - if(item.category === FurniCategory._Str_5186) + if(item.category === FurniCategory.POSTER) { name = (item.itemId + 'poster' + item.stuffData.getLegacyString()); } - else if(item.category === FurniCategory._Str_12454) + else if(item.category === FurniCategory.GUILD_FURNI) { name = ''; } diff --git a/src/views/inventory/views/furniture/InventoryFurnitureView.tsx b/src/views/inventory/views/furniture/InventoryFurnitureView.tsx index bdddaf0f..bd216d0f 100644 --- a/src/views/inventory/views/furniture/InventoryFurnitureView.tsx +++ b/src/views/inventory/views/furniture/InventoryFurnitureView.tsx @@ -76,15 +76,15 @@ export const InventoryFurnitureView: FC = props => roomPreviewer.updateObjectRoom(floorType, wallType, landscapeType); roomPreviewer.updateRoomWallsAndFloorVisibility(true, true); - if((furnitureItem.category === FurniCategory._Str_3639) || (furnitureItem.category === FurniCategory._Str_3683) || (furnitureItem.category === FurniCategory._Str_3432)) + if((furnitureItem.category === FurniCategory.WALL_PAPER) || (furnitureItem.category === FurniCategory.FLOOR) || (furnitureItem.category === FurniCategory.LANDSCAPE)) { - floorType = ((furnitureItem.category === FurniCategory._Str_3683) ? groupItem.stuffData.getLegacyString() : floorType); - wallType = ((furnitureItem.category === FurniCategory._Str_3639) ? groupItem.stuffData.getLegacyString() : wallType); - landscapeType = ((furnitureItem.category === FurniCategory._Str_3432) ? groupItem.stuffData.getLegacyString() : landscapeType); + floorType = ((furnitureItem.category === FurniCategory.FLOOR) ? groupItem.stuffData.getLegacyString() : floorType); + wallType = ((furnitureItem.category === FurniCategory.WALL_PAPER) ? groupItem.stuffData.getLegacyString() : wallType); + landscapeType = ((furnitureItem.category === FurniCategory.LANDSCAPE) ? groupItem.stuffData.getLegacyString() : landscapeType); roomPreviewer.updateObjectRoom(floorType, wallType, landscapeType); - if(furnitureItem.category === FurniCategory._Str_3432) + if(furnitureItem.category === FurniCategory.LANDSCAPE) { const data = GetSessionDataManager().getWallItemDataByName('noob_window_double'); diff --git a/src/views/inventory/views/trade/InventoryTradeView.tsx b/src/views/inventory/views/trade/InventoryTradeView.tsx index 0d7f9797..2c96182c 100644 --- a/src/views/inventory/views/trade/InventoryTradeView.tsx +++ b/src/views/inventory/views/trade/InventoryTradeView.tsx @@ -41,13 +41,13 @@ export const InventoryTradeView: FC = props => let type = spriteId.toString(); - if(category === FurniCategory._Str_5186) + if(category === FurniCategory.POSTER) { type = ((type + 'poster') + stuffData.getLegacyString()); } else { - if(category === FurniCategory._Str_12454) + if(category === FurniCategory.GUILD_FURNI) { type = _Str_16998(spriteId, stuffData); } diff --git a/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx b/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx index 939ce7ad..1f515a21 100644 --- a/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx +++ b/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx @@ -48,7 +48,7 @@ export const AvatarInfoUseProductConfirmView: FC } - case FurniCategory._Str_7297: { + case FurniCategory.PET_CUSTOM_PART: { if(customParts.length < 4) return null; const newCustomParts: PetCustomPart[] = []; @@ -95,7 +95,7 @@ export const AvatarInfoUseProductConfirmView: FC; } - case FurniCategory._Str_7954: { + case FurniCategory.PET_CUSTOM_PART_SHAMPOO: { if(customParts.length < 3) return null; const newCustomParts: PetCustomPart[] = []; @@ -121,7 +121,7 @@ export const AvatarInfoUseProductConfirmView: FC; } - case FurniCategory._Str_6096: { + case FurniCategory.PET_SADDLE: { if(customParts.length < 4) return null; const newCustomParts: PetCustomPart[] = []; @@ -149,9 +149,9 @@ export const AvatarInfoUseProductConfirmView: FC; } - case FurniCategory._Str_8726: - case FurniCategory._Str_6915: - case FurniCategory._Str_9449: { + case FurniCategory.MONSTERPLANT_REBREED: + case FurniCategory.MONSTERPLANT_REVIVAL: + case FurniCategory.MONSTERPLANT_FERTILIZE: { let posture = 'rip'; const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, petData.roomIndex, RoomObjectCategory.UNIT); @@ -190,25 +190,25 @@ export const AvatarInfoUseProductConfirmView: FC = props => { @@ -31,30 +31,30 @@ export const AvatarInfoUseProductView: FC = props if(!furniData) return; - let mode = _Str_2906; + let mode = PRODUCT_PAGE_UKNOWN; switch(furniData.specialType) { - case FurniCategory._Str_7696: - mode = _Str_13718; + case FurniCategory.PET_SHAMPOO: + mode = PRODUCT_PAGE_SHAMPOO; break; - case FurniCategory._Str_7297: - mode = _Str_14146; + case FurniCategory.PET_CUSTOM_PART: + mode = PRODUCT_PAGE_CUSTOM_PART; break; - case FurniCategory._Str_7954: - mode = _Str_15667; + case FurniCategory.PET_CUSTOM_PART_SHAMPOO: + mode = PRODUCT_PAGE_CUSTOM_PART_SHAMPOO; break; - case FurniCategory._Str_6096: - mode = _Str_14658; + case FurniCategory.PET_SADDLE: + mode = PRODUCT_PAGE_SADDLE; break; - case FurniCategory._Str_6915: - mode = _Str_14165; + case FurniCategory.MONSTERPLANT_REVIVAL: + mode = PRODUCT_PAGE_REVIVE; break; - case FurniCategory._Str_8726: - mode = _Str_12577; + case FurniCategory.MONSTERPLANT_REBREED: + mode = PRODUCT_PAGE_REBREED; break; - case FurniCategory._Str_9449: - mode = _Str_14611; + case FurniCategory.MONSTERPLANT_FERTILIZE: + mode = PRODUCT_PAGE_FERTILIZE; break; } @@ -86,23 +86,23 @@ export const AvatarInfoUseProductView: FC = props { item.name } - { (mode === _Str_2906) && + { (mode === PRODUCT_PAGE_UKNOWN) && processAction('use_product') }> { LocalizeText('infostand.button.useproduct') } } - { (mode === _Str_13718) && + { (mode === PRODUCT_PAGE_SHAMPOO) && processAction('use_product_shampoo') }> { LocalizeText('infostand.button.useproduct_shampoo') } } - { (mode === _Str_14146) && + { (mode === PRODUCT_PAGE_CUSTOM_PART) && processAction('use_product_custom_part') }> { LocalizeText('infostand.button.useproduct_custom_part') } } - { (mode === _Str_15667) && + { (mode === PRODUCT_PAGE_CUSTOM_PART_SHAMPOO) && processAction('use_product_custom_part_shampoo') }> { LocalizeText('infostand.button.useproduct_custom_part_shampoo') } } - { (mode === _Str_14658) && + { (mode === PRODUCT_PAGE_SADDLE) && <> { item.replace && processAction('replace_product_saddle') }> @@ -113,15 +113,15 @@ export const AvatarInfoUseProductView: FC = props { LocalizeText('infostand.button.useproduct_saddle') } } } - { (mode === _Str_14165) && + { (mode === PRODUCT_PAGE_REVIVE) && processAction('revive_monsterplant') }> { LocalizeText('infostand.button.revive_monsterplant') } } - { (mode === _Str_12577) && + { (mode === PRODUCT_PAGE_REBREED) && processAction('rebreed_monsterplant') }> { LocalizeText('infostand.button.rebreed_monsterplant') } } - { (mode === _Str_14611) && + { (mode === PRODUCT_PAGE_FERTILIZE) && processAction('fertilize_monsterplant') }> { LocalizeText('infostand.button.fertilize_monsterplant') } } diff --git a/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx index c2df26c1..515054cd 100644 --- a/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx +++ b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx @@ -43,7 +43,7 @@ export const PurchasableClothingConfirmView: FC parseInt(part));