From 32d4dad6e77b928c67c261dd853839e1dc01c103 Mon Sep 17 00:00:00 2001 From: oshawott Date: Thu, 24 Mar 2022 10:59:12 +1100 Subject: [PATCH] Added catalogue links to UI config. Keeps all the catalogue links in one group, while adding a couple more options.. Uncommented clicking on "Buy Saddle" and added catalogue link. --- public/ui-config.json.example | 8 ++++++-- src/api/notification/NotificationUtilities.ts | 2 +- src/components/hc-center/HcCenterView.tsx | 4 ++-- .../widgets/avatar-info/AvatarInfoWidgetOwnPetView.tsx | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/public/ui-config.json.example b/public/ui-config.json.example index 0497155b..8e6795f2 100644 --- a/public/ui-config.json.example +++ b/public/ui-config.json.example @@ -55,14 +55,18 @@ 0, 5 ], + "catalog.links": { + "hc.buy_hc": "habbo_club", + "hc.hc_gifts": "club_gifts", + "pets.buy_food": "pets_food", + "pets.buy_saddle": "horse_saddles" + }, "hc.center": { "benefits.info": true, "payday.info": true, "gift.info": true, "benefits.habbopage": "habboclub", "payday.habbopage": "hcpayday", - "catalog.buy": "habbo_club", - "catalog.gifts": "club_gifts" }, "respect.options": { "enabled": false, diff --git a/src/api/notification/NotificationUtilities.ts b/src/api/notification/NotificationUtilities.ts index 29dc8574..5ca4100e 100644 --- a/src/api/notification/NotificationUtilities.ts +++ b/src/api/notification/NotificationUtilities.ts @@ -100,7 +100,7 @@ export class NotificationUtilities { if(numGifts <= 0) return; - this.showSingleBubble(numGifts.toString(), NotificationBubbleType.CLUBGIFT, null, ('catalog/open/' + GetConfiguration('hc.center')['catalog.gifts'])); + this.showSingleBubble(numGifts.toString(), NotificationBubbleType.CLUBGIFT, null, ('catalog/open/' + GetConfiguration('catalog.links')['hc.hc_gifts'])); } public static handleMOTD(messages: string[]): void diff --git a/src/components/hc-center/HcCenterView.tsx b/src/components/hc-center/HcCenterView.tsx index 5236443c..5697ed79 100644 --- a/src/components/hc-center/HcCenterView.tsx +++ b/src/components/hc-center/HcCenterView.tsx @@ -221,7 +221,7 @@ export const HcCenterView: FC<{}> = props =>
- @@ -273,7 +273,7 @@ export const HcCenterView: FC<{}> = props =>

{LocalizeText('hccenter.gift.title')}

0 ? LocalizeText('hccenter.unclaimedgifts', ['unclaimedgifts'], [unclaimedGifts.toString()]) : LocalizeText('hccenter.gift.info') }}>
- + } {GetConfiguration('hc.center')['benefits.info'] && diff --git a/src/components/room/widgets/avatar-info/AvatarInfoWidgetOwnPetView.tsx b/src/components/room/widgets/avatar-info/AvatarInfoWidgetOwnPetView.tsx index 5eac0096..cfebe133 100644 --- a/src/components/room/widgets/avatar-info/AvatarInfoWidgetOwnPetView.tsx +++ b/src/components/room/widgets/avatar-info/AvatarInfoWidgetOwnPetView.tsx @@ -1,6 +1,6 @@ import { PetType, RoomObjectCategory, RoomObjectType, RoomObjectVariable } from '@nitrots/nitro-renderer'; import { FC, useEffect, useMemo, useState } from 'react'; -import { GetOwnRoomObject, LocalizeText, RoomWidgetMessage, RoomWidgetUpdateInfostandPetEvent, RoomWidgetUserActionMessage } from '../../../../api'; +import { CreateLinkEvent, GetConfiguration, GetOwnRoomObject, LocalizeText, RoomWidgetMessage, RoomWidgetUpdateInfostandPetEvent, RoomWidgetUserActionMessage } from '../../../../api'; import { BatchUpdates } from '../../../../hooks'; import { useRoomContext } from '../../RoomContext'; import { ContextMenuHeaderView } from '../context-menu/ContextMenuHeaderView'; @@ -116,7 +116,7 @@ export const AvatarInfoWidgetOwnPetView: FC = p messageType = RoomWidgetUserActionMessage.COMPOST_PLANT; break; case 'buy_saddle': - //this.openCatalogPage(this._Str_11220); + CreateLinkEvent('catalog/open/' + GetConfiguration('catalog.links')['pets.buy_saddle']); break; }