Exemple #1
0
        public void ShowXCrystalReward(ShowRewardEvent e, ScreenNode screen, XCrystalPersonalRewardNode personalReward, [JoinBy(typeof(BattleRewardGroupComponent))] XCrystalRewardNode reward)
        {
            base.Log.DebugFormat("ShowXCrystalReward: reward={0}", personalReward.Entity.Id);
            XCrystalBonusActivationReason activationReason = personalReward.xCrystalBonusPersonalReward.ActivationReason;
            string ribbonLabel            = "x" + personalReward.xCrystalBonusPersonalReward.Multiplier.ToString();
            List <SpecialOfferItem> items = new List <SpecialOfferItem> {
                new SpecialOfferItem(0, reward.xCrystalRewardItemsConfig.SpriteUid, reward.xCrystalRewardItemsConfig.Title, ribbonLabel)
            };
            BattleResultSpecialOfferUiComponent specialOfferUI = screen.battleResultsAwardsScreen.specialOfferUI;

            specialOfferUI.ShowContent(reward.xCrystalRewardTextConfig.Title[activationReason], reward.xCrystalRewardTextConfig.Description[activationReason], items);
            specialOfferUI.SetUseDiscountButton();
            specialOfferUI.Appear();
        }
Exemple #2
0
        public void ShowTutorialRewards(ShowTutorialRewardsEvent e, TutorialStepWithRewardsNode tutorialStepWithRewards, [JoinAll] ScreenNode screen)
        {
            List <SpecialOfferItem> items = new List <SpecialOfferItem>();

            foreach (Reward reward in tutorialStepWithRewards.tutorialRewardData.Rewards)
            {
                GarageItem item = GarageItemsRegistry.GetItem <GarageItem>(reward.ItemId);
                if (item != null)
                {
                    items.Add(new SpecialOfferItem((int)reward.Count, item.Preview, item.Name));
                }
            }
            long crysCount = tutorialStepWithRewards.tutorialRewardData.CrysCount;

            if (crysCount > 0L)
            {
                items.Add(new SpecialOfferItem((int)crysCount, screen.battleResultsAwardsScreen.crysImageSkin.SpriteUid, screen.battleResultsAwardsScreen.crysLocalizedField.Value));
            }
            BattleResultSpecialOfferUiComponent specialOfferUI = screen.battleResultsAwardsScreen.specialOfferUI;

            specialOfferUI.ShowContent(screen.battleResultsAwardsScreen.tutorialCongratulationLocalizedField.Value, tutorialStepWithRewards.tutorialStepData.Message, items);
            specialOfferUI.SetTutorialRewardsButton();
            specialOfferUI.Appear();
        }