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

View File

@ -26,7 +26,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
const [ approvalPending, setApprovalPending ] = useState(true); const [ approvalPending, setApprovalPending ] = useState(true);
const [ approvalResult, setApprovalResult ] = useState(-1); const [ approvalResult, setApprovalResult ] = useState(-1);
const { currentOffer = null, setCurrentOffer = null, setPurchaseOptions = null, catalogOptions = null, roomPreviewer = null } = useCatalogContext(); const { currentOffer = null, setCurrentOffer = null, setPurchaseOptions = null, catalogOptions = null, roomPreviewer = null } = useCatalogContext();
const { petPalettes = [] } = catalogOptions; const { petPalettes = null } = catalogOptions;
const getColor = useMemo(() => const getColor = useMemo(() =>
{ {
@ -138,6 +138,8 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
if(!productData) return; if(!productData) return;
if(petPalettes)
{
for(const paletteData of petPalettes) for(const paletteData of petPalettes)
{ {
if(paletteData.breed !== productData.type) continue; if(paletteData.breed !== productData.type) continue;
@ -159,6 +161,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
return; return;
} }
}
BatchUpdates(() => BatchUpdates(() =>
{ {

View File

@ -1,7 +1,7 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, RoomSessionFavoriteGroupUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserFigureUpdateEvent, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, RoomSessionFavoriteGroupUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserFigureUpdateEvent, UserRelationshipsComposer } from '@nitrots/nitro-renderer';
import { Dispatch, FC, FocusEvent, KeyboardEvent, SetStateAction, useCallback, useEffect, useState } from 'react'; 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 { Base, Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text, UserProfileIconView } from '../../../../common';
import { BatchUpdates, UseEventDispatcherHook, UseMessageEventHook } from '../../../../hooks'; import { BatchUpdates, UseEventDispatcherHook, UseMessageEventHook } from '../../../../hooks';
import { useRoomContext } from '../../RoomContext'; import { useRoomContext } from '../../RoomContext';
@ -149,7 +149,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
</Column> </Column>
<Column gap={ 1 }> <Column gap={ 1 }>
<Flex 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 } /> <LayoutAvatarImageView figure={ userData.figure } direction={ 4 } />
</Column> </Column>
<Column grow gap={ 0 }> <Column grow gap={ 0 }>