| | 1 | | using System.Collections.Generic; |
| | 2 | | using System.Linq; |
| | 3 | | using UnityEngine; |
| | 4 | |
|
| | 5 | | namespace DCL |
| | 6 | | { |
| | 7 | | public class EquippedEmoteData |
| | 8 | | { |
| | 9 | | public string id; |
| | 10 | | public Sprite cachedThumbnail; |
| | 11 | | } |
| | 12 | |
|
| | 13 | | public class DataStore_EmotesCustomization |
| | 14 | | { |
| 69 | 15 | | public readonly BaseVariable<bool> isWheelInitialized = new BaseVariable<bool>(false); |
| 69 | 16 | | public readonly BaseCollection<EquippedEmoteData> unsavedEquippedEmotes = new BaseCollection<EquippedEmoteData>( |
| 69 | 17 | | public readonly BaseCollection<EquippedEmoteData> equippedEmotes = new BaseCollection<EquippedEmoteData>(new Lis |
| 69 | 18 | | public readonly BaseVariable<bool> isEmotesCustomizationSelected = new BaseVariable<bool>(false); |
| 69 | 19 | | public readonly BaseCollection<string> currentLoadedEmotes = new BaseCollection<string>(); |
| | 20 | |
|
| | 21 | | public void UnequipMissingEmotes(IEnumerable<WearableItem> emotes) |
| | 22 | | { |
| 43 | 23 | | var setOfIds = new HashSet<string>(); |
| 1720 | 24 | | foreach (var emote in emotes) |
| 817 | 25 | | setOfIds.Add(emote.id); |
| | 26 | |
|
| 946 | 27 | | for (int i = 0; i < equippedEmotes.Count(); i++) |
| | 28 | | { |
| 430 | 29 | | if (equippedEmotes[i] != null && !setOfIds.Contains(equippedEmotes[i].id)) |
| 0 | 30 | | equippedEmotes[i] = null; |
| | 31 | | } |
| 43 | 32 | | } |
| | 33 | | } |
| | 34 | | } |