public static RewardCategory GetItemRewardCategory(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); RewardCategory result = RewardCategory.equipmentInstances; if (rewards.Count > 0) { result = rewards[0].Category; } return(result); }
public static bool IsIglooReward(DisneyStoreItemData item) { bool result = false; List <DReward> rewards = item.GetRewards(); for (int i = 0; i < rewards.Count; i++) { result = IsIglooReward(rewards[i].Category); } return(result); }
protected void setPurchaseActionText(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); RewardCategory category = rewards[0].Category; string token = "GlobalUI.Buttons.Use"; if (category == RewardCategory.equipmentInstances) { token = "Marketplace.DisneyShop.WearButton"; } PurchasedActionText.text = Service.Get <Localizer>().GetTokenTranslation(token); }
protected void selectTrayIcons(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); RewardCategory category = rewards[0].Category; int num = DisneyStoreUtils.IsIglooReward(item) ? 3 : Array.IndexOf(TrayIconImageSelectorCategoryIndexes, category); if (num != -1 || num >= TrayIconImageSelector.Sprites.Length) { TrayIconImageSelector.SelectSprite(num); } else { TrayIconImageSelector.SelectSprite(0); } }
public static bool DoesItemContainEquipmentInstance(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); bool result = false; for (int i = 0; i < rewards.Count; i++) { if (rewards[i].Category == RewardCategory.equipmentInstances) { result = true; break; } } return(result); }
public static bool IsItemMultiPurchase(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); bool flag = false; bool flag2 = false; for (int i = 0; i < rewards.Count; i++) { if (rewards[i].Category == RewardCategory.consumables || rewards[i].Category == RewardCategory.decorationInstances) { flag = true; continue; } flag2 = true; break; } return(flag && !flag2); }
public static bool IsItemOwned(DisneyStoreItemData item) { List <DReward> rewards = item.GetRewards(); for (int i = 0; i < rewards.Count; i++) { if (rewards[i].Category == RewardCategory.equipmentInstances) { if (!InventoryUtils.IsCustomEquipmentOwned(rewards[i].EquipmentRequest)) { return(false); } } else if (Enum.IsDefined(typeof(ProgressionUnlockCategory), rewards[i].Category.ToString())) { ProgressionUnlockCategory category = (ProgressionUnlockCategory)Enum.Parse(typeof(ProgressionUnlockCategory), rewards[i].Category.ToString()); if (!Service.Get <ProgressionService>().IsUnlocked(rewards[i].UnlockID, category)) { return(false); } } } return(true); }
protected void logItemViewed(DisneyStoreItemData item) { Service.Get <ICPSwrveService>().Action("game.disney_store_item_view", item.Definition.name, item.GetRewards()[0].Category.ToString()); }