private bool onMyRewardEarned(RewardServiceEvents.MyRewardEarned evt)
        {
            RewardSource source = evt.Source;

            if (source == RewardSource.QUEST_COMPLETED)
            {
                bool  flag  = true;
                Quest quest = Service.Get <QuestService>().GetQuest(evt.SourceId);
                if (quest == null)
                {
                    Log.LogError(this, "QuestService returned null quest for name : " + evt.SourceId);
                }
                else if (quest.Definition.IsRewardPopupSupressed)
                {
                    flag = false;
                }
                if (flag)
                {
                    ShowRewardPopup showRewardPopup = new ShowRewardPopup.Builder(DRewardPopup.RewardPopupType.questComplete, evt.Reward).setRewardSource(evt.SourceId).setRewardPopupPrefabOverride(quest.Definition.RewardPopupPrefabOverride).Build();
                    showRewardPopup.Execute();
                }
                addReward(evt.Reward, evt.Source.ToString(), evt.SourceId, showReward: false);
            }
            else
            {
                addReward(evt.Reward, evt.Source.ToString(), evt.SourceId, evt.ShowReward);
            }
            return(false);
        }
Exemple #2
0
    public override void OnEnter()
    {
        ShowRewardPopup showRewardPopup = new ShowRewardPopup.Builder(PopupType, Reward.ToReward()).setHeaderText(PopupSplashText).setShowXpAndCoinsUI(ShowXpAndCoinsUI).Build();

        showRewardPopup.Execute();
        Service.Get <EventDispatcher>().AddListener <RewardEvents.RewardPopupComplete>(onRewardPopupComplete);
    }
Exemple #3
0
    private void ShowLevelUp(int level)
    {
        Reward          rewardForProgressionLevel = RewardUtils.GetRewardForProgressionLevel(level);
        ShowRewardPopup showRewardPopup           = new ShowRewardPopup.Builder(DRewardPopup.RewardPopupType.levelUp, rewardForProgressionLevel).setMascotName(currentMascotName).Build();

        if (!isLevelUpScreenSuppressed)
        {
            showRewardPopup.Execute();
        }
        else
        {
            Service.Get <ProgressionService>().PendingLevelUpPopup = showRewardPopup;
        }
    }