mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Merge branch 'dev' into @update/inventory
This commit is contained in:
commit
f8d01140ae
@ -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;
|
||||||
|
@ -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,26 +138,29 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
|||||||
|
|
||||||
if(!productData) return;
|
if(!productData) return;
|
||||||
|
|
||||||
for(const paletteData of petPalettes)
|
if(petPalettes)
|
||||||
{
|
{
|
||||||
if(paletteData.breed !== productData.type) continue;
|
for(const paletteData of petPalettes)
|
||||||
|
|
||||||
const palettes: SellablePetPaletteData[] = [];
|
|
||||||
|
|
||||||
for(const palette of paletteData.palettes)
|
|
||||||
{
|
{
|
||||||
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(() =>
|
BatchUpdates(() =>
|
||||||
|
@ -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 }>
|
||||||
|
Loading…
Reference in New Issue
Block a user