mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
Update for BadgePointLimit
This commit is contained in:
parent
3cd6d56b3e
commit
a1e99bf000
7
src/api/nitro/GetLocalization.ts
Normal file
7
src/api/nitro/GetLocalization.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { INitroLocalizationManager } from '@nitrots/nitro-renderer';
|
||||
import { GetNitroInstance } from './GetNitroInstance';
|
||||
|
||||
export function GetLocalization(): INitroLocalizationManager
|
||||
{
|
||||
return GetNitroInstance().localization;
|
||||
}
|
@ -5,6 +5,7 @@ export * from './CreateLinkEvent';
|
||||
export * from './GetCommunication';
|
||||
export * from './GetConfiguration';
|
||||
export * from './GetConnection';
|
||||
export * from './GetLocalization';
|
||||
export * from './GetNitroInstance';
|
||||
export * from './GetTicker';
|
||||
export * from './RemoveLinkEventTracker';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { AdvancedMap, BadgeReceivedEvent, BadgesEvent, BotAddedToInventoryEvent, BotInventoryMessageEvent, BotRemovedFromInventoryEvent, FurnitureListAddOrUpdateEvent, FurnitureListEvent, FurnitureListInvalidateEvent, FurnitureListItemParser, FurnitureListRemovedEvent, FurniturePostItPlacedEvent, PetAddedToInventoryEvent, PetData, PetInventoryEvent, PetRemovedFromInventory, RequestBadgesComposer, TradingAcceptEvent, TradingCloseEvent, TradingCompletedEvent, TradingConfirmationEvent, TradingListItemEvent, TradingNotOpenEvent, TradingOpenEvent, TradingOpenFailedEvent, TradingOtherNotAllowedEvent, TradingYouAreNotAllowedEvent, UnseenItemsEvent } from '@nitrots/nitro-renderer';
|
||||
import { AdvancedMap, BadgePointLimitsEvent, BadgeReceivedEvent, BadgesEvent, BotAddedToInventoryEvent, BotInventoryMessageEvent, BotRemovedFromInventoryEvent, FurnitureListAddOrUpdateEvent, FurnitureListEvent, FurnitureListInvalidateEvent, FurnitureListItemParser, FurnitureListRemovedEvent, FurniturePostItPlacedEvent, PetAddedToInventoryEvent, PetData, PetInventoryEvent, PetRemovedFromInventory, RequestBadgesComposer, TradingAcceptEvent, TradingCloseEvent, TradingCompletedEvent, TradingConfirmationEvent, TradingListItemEvent, TradingNotOpenEvent, TradingOpenEvent, TradingOpenFailedEvent, TradingOtherNotAllowedEvent, TradingYouAreNotAllowedEvent, UnseenItemsEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { GetRoomSession, GetSessionDataManager } from '../../api';
|
||||
import { GetLocalization, GetRoomSession, GetSessionDataManager } from '../../api';
|
||||
import { InventoryBadgesUpdatedEvent } from '../../events';
|
||||
import { InventoryBadgesRequestEvent } from '../../events/inventory/InventoryBadgesRequestEvent';
|
||||
import { dispatchUiEvent, useUiEvent } from '../../hooks';
|
||||
@ -321,6 +321,13 @@ export const InventoryMessageHandler: FC<InventoryMessageHandlerProps> = props =
|
||||
}
|
||||
}, [ unseenTracker ]);
|
||||
|
||||
const onBadgePointLimitsEvent = useCallback((event: BadgePointLimitsEvent) =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
for(const data of parser.data) GetLocalization().setBadgePointLimit(data.badgeId, data.limit);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(FurnitureListAddOrUpdateEvent, onFurnitureListAddOrUpdateEvent);
|
||||
CreateMessageHook(FurnitureListEvent, onFurnitureListEvent);
|
||||
CreateMessageHook(FurnitureListInvalidateEvent, onFurnitureListInvalidateEvent);
|
||||
@ -345,6 +352,7 @@ export const InventoryMessageHandler: FC<InventoryMessageHandlerProps> = props =
|
||||
CreateMessageHook(TradingOtherNotAllowedEvent, onTradingOtherNotAllowedEvent);
|
||||
CreateMessageHook(TradingYouAreNotAllowedEvent, onTradingYouAreNotAllowedEvent);
|
||||
CreateMessageHook(UnseenItemsEvent, onUnseenItemsEvent);
|
||||
CreateMessageHook(BadgePointLimitsEvent, onBadgePointLimitsEvent);
|
||||
|
||||
const onInventoryBadgesRequestEvent = useCallback((event: InventoryBadgesRequestEvent) =>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user