Merge branch 'dev' into @update/inventory

This commit is contained in:
Bill 2022-03-30 12:48:21 -04:00
commit f8d01140ae
3 changed files with 27 additions and 22 deletions

View File

@ -1,6 +1,6 @@
import { AchievementData, AchievementEvent, AchievementsEvent, AchievementsScoreEvent, ILinkEventTracker, RequestAchievementsMessageComposer } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { AchievementCategory, AddEventLinkTracker, GetAchievementCategoryImageUrl, GetAchievementIsIgnored, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
import { AchievementCategory, AddEventLinkTracker, CloneObject, GetAchievementCategoryImageUrl, GetAchievementIsIgnored, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
import { Base, Column, LayoutImage, LayoutProgressBar, NitroCardContentView, NitroCardHeaderView, NitroCardSubHeaderView, NitroCardView, Text } from '../../common';
import { AchievementsUIUnseenCountEvent } from '../../events';
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../hooks';
@ -36,7 +36,7 @@ export const AchievementsView: FC<{}> = props =>
}
else
{
const category = newValue[categoryIndex];
const category = CloneObject(newValue[categoryIndex]);
const newAchievements = [ ...category.achievements ];
const achievementIndex = newAchievements.findIndex(existing => (existing.achievementId === achievement.achievementId));
let previousAchievement: AchievementData = null;
@ -60,6 +60,8 @@ export const AchievementsView: FC<{}> = props =>
}
category.achievements = newAchievements;
newValue[categoryIndex] = category;
}
return newValue;

View File

@ -26,7 +26,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
const [ approvalPending, setApprovalPending ] = useState(true);
const [ approvalResult, setApprovalResult ] = useState(-1);
const { currentOffer = null, setCurrentOffer = null, setPurchaseOptions = null, catalogOptions = null, roomPreviewer = null } = useCatalogContext();
const { petPalettes = [] } = catalogOptions;
const { petPalettes = null } = catalogOptions;
const getColor = useMemo(() =>
{
@ -138,26 +138,29 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
if(!productData) return;
for(const paletteData of petPalettes)
if(petPalettes)
{
if(paletteData.breed !== productData.type) continue;
const palettes: SellablePetPaletteData[] = [];
for(const palette of paletteData.palettes)
for(const paletteData of petPalettes)
{
if(!palette.sellable) continue;
if(paletteData.breed !== productData.type) continue;
palettes.push(palette);
const palettes: SellablePetPaletteData[] = [];
for(const palette of paletteData.palettes)
{
if(!palette.sellable) continue;
palettes.push(palette);
}
BatchUpdates(() =>
{
setSelectedPaletteIndex((palettes.length ? 0 : -1));
setSellablePalettes(palettes);
});
return;
}
BatchUpdates(() =>
{
setSelectedPaletteIndex((palettes.length ? 0 : -1));
setSellablePalettes(palettes);
});
return;
}
BatchUpdates(() =>

View File

@ -1,7 +1,7 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, RoomSessionFavoriteGroupUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserFigureUpdateEvent, UserRelationshipsComposer } from '@nitrots/nitro-renderer';
import { Dispatch, FC, FocusEvent, KeyboardEvent, SetStateAction, useCallback, useEffect, useState } from 'react';
import { CloneObject, GetConfiguration, GetGroupInformation, GetSessionDataManager, LocalizeText, RoomWidgetChangeMottoMessage, RoomWidgetUpdateInfostandUserEvent, SendMessageComposer } from '../../../../api';
import { CloneObject, GetConfiguration, GetGroupInformation, GetSessionDataManager, GetUserProfile, LocalizeText, RoomWidgetChangeMottoMessage, RoomWidgetUpdateInfostandUserEvent, SendMessageComposer } from '../../../../api';
import { Base, Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text, UserProfileIconView } from '../../../../common';
import { BatchUpdates, UseEventDispatcherHook, UseMessageEventHook } from '../../../../hooks';
import { useRoomContext } from '../../RoomContext';
@ -149,7 +149,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
</Column>
<Column gap={ 1 }>
<Flex gap={ 1 }>
<Column fullWidth className="body-image">
<Column fullWidth className="body-image" onClick={ event => GetUserProfile(userData.webID) }>
<LayoutAvatarImageView figure={ userData.figure } direction={ 4 } />
</Column>
<Column grow gap={ 0 }>