private string GetRewardListSpriteName(SupplyCrateTag tag) { CrateSupplyVO crateSupply = tag.CrateSupply; string result = null; switch (crateSupply.Type) { case SupplyType.Currency: result = GameUtils.GetCurrencyIconName(crateSupply.RewardUid); break; case SupplyType.Shard: case SupplyType.ShardTroop: case SupplyType.ShardSpecialAttack: { ShardQuality shardQuailty = tag.ShardQuailty; result = string.Format("icoDataFragQ{0}", (int)shardQuailty); break; } case SupplyType.Troop: case SupplyType.Hero: case SupplyType.SpecialAttack: result = "icoTroopSample"; break; default: Service.Logger.Error("Unsupported supply type in GetRewardListSpriteName " + crateSupply.Type.ToString()); break; } return(result); }
public void ShowNameAndAmountUI(SupplyCrateTag tag) { this.showUpgrade = false; this.shardReward = false; this.SetupCurrentRewardTitle(tag); this.ShowReward(); }
private void SetupCurrentRewardTitle(SupplyCrateTag tag) { if (tag == null || tag.CrateSupply == null) { this.lblCurrentReward.Text = string.Empty; return; } int crateHQLevel = this.parent.GetCrateHQLevel(); this.lblCurrentReward.Text = GameUtils.GetRewardSupplyName(tag.CrateSupply, crateHQLevel); }
public void ShowUnlockShardPBarUI(SupplyCrateTag tag, int shardsFrom, int shardsTo, int shardsNeededForLevel, bool showLevel) { this.showUpgrade = showLevel; this.shardReward = true; this.SetupCurrentRewardTitle(tag); this.maxRewardItemAmount = shardsNeededForLevel; this.currentRewardItemAmount = shardsFrom; this.newRewardItemAmount = shardsTo; this.SetupShardPBars(tag.CrateSupply); this.SetupPBarInterpTimerIfNeeded(); this.ShowRewardWithPBar(); }
private void InitRewardGrid() { this.gridRewardItems.SetTemplateItem("TemplateListItem"); List <SupplyCrateTag> rewardList = this.parent.GetRewardList(); int count = rewardList.Count; int crateHQLevel = this.parent.GetCrateHQLevel(); for (int i = 0; i < count; i++) { SupplyCrateTag supplyCrateTag = rewardList[i]; CrateSupplyVO crateSupply = supplyCrateTag.CrateSupply; string itemUid = crateSupply.Uid + i.ToString(); UXElement uXElement = this.gridRewardItems.CloneTemplateItem(itemUid); this.gridRewardItems.AddItem(uXElement, i); UXSprite subElement = this.gridRewardItems.GetSubElement <UXSprite>(itemUid, "SpriteTypeListItem"); subElement.SpriteName = this.GetRewardListSpriteName(supplyCrateTag); UXLabel subElement2 = this.gridRewardItems.GetSubElement <UXLabel>(itemUid, "LabelTypeListItem"); subElement2.Text = GameUtils.GetRewardSupplyName(supplyCrateTag.CrateSupply, crateHQLevel); uXElement.InitAnimator(); } this.gridRewardItems.RepositionItems(); }