예제 #1
0
 private void InitAndShow(ShowRequestData showRequestData)
 {
     OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT);
     this.m_showRequestData = showRequestData;
     if ((AchieveManager.Get().GetActiveQuests(false).Count < 1) && (!InnKeepersSpecial.Get().LoadedSuccessfully() || InnKeepersSpecial.Get().HasAlreadySeenResponse()))
     {
         this.Close();
     }
     else
     {
         this.m_clickCatcher.gameObject.SetActive(true);
         this.m_clickCatcher.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.CloseWelcomeQuests));
         this.ShowActiveQuests();
         this.FadeEffectsIn();
         base.transform.localScale = new Vector3(0.001f, 0.001f, 0.001f);
         iTween.ScaleTo(base.gameObject, this.m_originalScale, 0.5f);
         int val = Options.Get().GetInt(Option.IKS_VIEWS, 0) + 1;
         Options.Get().SetInt(Option.IKS_VIEWS, val);
         if ((showRequestData.m_fromLogin && InnKeepersSpecial.Get().LoadedSuccessfully()) && (val > 3))
         {
             if (UniversalInputManager.UsePhoneUI != null)
             {
                 Vector3 localPosition = base.transform.localPosition;
                 localPosition.y += 2f;
                 base.transform.localPosition = localPosition;
             }
             InnKeepersSpecial.Get().Show(true);
         }
         Navigation.PushUnique(new Navigation.NavigateBackHandler(WelcomeQuests.OnNavigateBack));
     }
 }
 public static FixedRewardsMgr Get()
 {
     if (s_instance == null)
     {
         s_instance = new FixedRewardsMgr();
         ApplicationMgr.Get().WillReset += new System.Action(s_instance.WillReset);
     }
     if (!s_instance.m_registeredForAdventureProgressUpdates)
     {
         s_instance.m_registeredForAdventureProgressUpdates = AdventureProgressMgr.Get().RegisterProgressUpdatedListener(new AdventureProgressMgr.AdventureProgressUpdatedCallback(s_instance.OnAdventureProgressUpdate));
     }
     if (!s_instance.m_registeredForProfileNotices)
     {
         NetCache.Get().RegisterNewNoticesListener(new NetCache.DelNewNoticesListener(s_instance.OnNewNotices));
         s_instance.m_registeredForProfileNotices = true;
     }
     if (!s_instance.m_registeredForCompletedAchieves)
     {
         AchieveManager.Get().RegisterNewlyCompletedAchievesListener(new AchieveManager.NewlyAcompletedAchievesCallback(s_instance.OnNewlyCompletedAchieves));
         s_instance.m_registeredForCompletedAchieves = true;
     }
     if (!s_instance.m_registeredForAccountLicenseUpdates)
     {
         AccountLicenseMgr.Get().RegisterAccountLicensesChangedListener(new AccountLicenseMgr.AccountLicensesChangedCallback(s_instance.OnAccountLicensesUpdate));
         s_instance.m_registeredForAccountLicenseUpdates = true;
     }
     return(s_instance);
 }
 private void OnCancelButtonReleased(UIEvent e)
 {
     if (this.m_quest != null)
     {
         AchieveManager.Get().CancelQuest(this.m_quest.ID);
         this.m_BurnPlaymaker.SendEvent("Death");
     }
 }
 public void UpdateQuestProgressToasts()
 {
     foreach (Achievement achievement in AchieveManager.Get().GetNewlyProgressedQuests())
     {
         this.AddQuestProgressToast(achievement.Name, achievement.Description, achievement.Progress, achievement.MaxProgress);
         achievement.AckCurrentProgressAndRewardNotices(true);
     }
 }
    public void UpdateCancelButtonVisibility()
    {
        bool flag = false;

        if (this.m_canShowCancelButton && (this.m_quest != null))
        {
            flag = AchieveManager.Get().CanCancelQuest(this.m_quest.ID);
        }
        this.m_cancelButtonRoot.gameObject.SetActive(flag);
    }
 private void OnNetCacheReady()
 {
     NetCache.Get().UnregisterNetCacheHandler(new NetCache.NetCacheCallback(this.OnNetCacheReady));
     if (AchieveManager.Get().HasActiveQuests(true))
     {
         WelcomeQuests.Show(false, null, false);
     }
     else
     {
         GameToastMgr.Get().UpdateQuestProgressToasts();
     }
 }
    private void GrantAchieveRewards(List <CardRewardData> cardRewards)
    {
        AchieveManager manager = AchieveManager.Get();

        if (manager == null)
        {
            Debug.LogWarning(string.Format("FixedRewardsMgr.GrantAchieveRewards(): null == AchieveManager.Get()", new object[0]));
        }
        else
        {
            foreach (Achievement achievement in manager.GetCompletedAchieves())
            {
                bool showRewardVisual = achievement.AcknowledgedProgress < achievement.Progress;
                this.TriggerAchieveAction(showRewardVisual, achievement.ID, cardRewards);
            }
        }
    }
 protected override void Hide(bool animate)
 {
     if (this.m_presencePrevStatus == null)
     {
         this.m_presencePrevStatus = new Enum[] { PresenceStatus.HUB };
     }
     PresenceMgr.Get().SetStatus(this.m_presencePrevStatus);
     if (ShownUIMgr.Get() != null)
     {
         ShownUIMgr.Get().ClearShownUI();
     }
     base.DoHideAnimation(!animate, delegate {
         AchieveManager.Get().RemoveQuestCanceledListener(new AchieveManager.AchieveCanceledCallback(this.OnQuestCanceled));
         this.DeleteQuests();
         FullScreenFXMgr.Get().EndStandardBlurVignette(0.1f, null);
         base.m_shown = false;
     });
 }
예제 #9
0
 private void OnNetCacheReady()
 {
     NetCache.Get().UnregisterNetCacheHandler(new NetCache.NetCacheCallback(this.OnNetCacheReady));
     if (!NetCache.Get().GetNetObject <NetCache.NetCacheFeatures>().Games.Practice)
     {
         if (!SceneMgr.Get().IsModeRequested(SceneMgr.Mode.HUB))
         {
             SceneMgr.Get().SetNextMode(SceneMgr.Mode.HUB);
             Error.AddWarningLoc("GLOBAL_FEATURE_DISABLED_TITLE", "GLOBAL_FEATURE_DISABLED_MESSAGE_PRACTICE", new object[0]);
         }
     }
     else if (AchieveManager.Get().HasActiveQuests(true))
     {
         WelcomeQuests.Show(false, null, false);
     }
     else
     {
         GameToastMgr.Get().UpdateQuestProgressToasts();
     }
 }
예제 #10
0
    private void SetupHeroAchieves()
    {
        List <Achievement> achievesInGroup = AchieveManager.Get().GetAchievesInGroup(Achievement.Group.UNLOCK_HERO);
        List <Achievement> list2           = AchieveManager.Get().GetAchievesInGroup(Achievement.Group.UNLOCK_HERO, true);
        int            count     = achievesInGroup.Count;
        int            num2      = list2.Count;
        CardRewardData data      = base.Data as CardRewardData;
        string         className = GameStrings.GetClassName(DefLoader.Get().GetEntityDef(data.CardID).GetClass());

        object[] args     = new object[] { className };
        string   headline = GameStrings.Format("GLOBAL_REWARD_HERO_HEADLINE", args);

        object[] objArray2 = new object[] { num2, count };
        string   details   = GameStrings.Format("GLOBAL_REWARD_HERO_DETAILS", objArray2);

        object[] objArray3 = new object[] { className };
        string   source    = GameStrings.Format("GLOBAL_REWARD_HERO_SOURCE", objArray3);

        base.SetRewardText(headline, details, source);
    }
    public bool CanPlayMode(AdventureDbId adventureId, AdventureModeDbId modeId)
    {
        bool flag = AchieveManager.Get().HasUnlockedFeature(Achievement.UnlockableFeature.VANILLA_HEROES);

        if (adventureId == AdventureDbId.PRACTICE)
        {
            if (modeId == AdventureModeDbId.EXPERT)
            {
                return(flag);
            }
            return(true);
        }
        if (flag)
        {
            if (modeId == AdventureModeDbId.NORMAL)
            {
                return(true);
            }
            int num  = (int)adventureId;
            int num2 = (int)modeId;
            foreach (DbfRecord record in GameDbf.Scenario.GetRecords())
            {
                int @int = record.GetInt("ADVENTURE_ID");
                if (num == @int)
                {
                    int num4 = record.GetInt("MODE_ID");
                    if (num2 == num4)
                    {
                        int id = record.GetId();
                        if (AdventureProgressMgr.Get().CanPlayScenario(id))
                        {
                            return(true);
                        }
                    }
                }
            }
        }
        return(false);
    }
예제 #12
0
    protected virtual void Awake()
    {
        s_instance = this;
        CollectionManager.Get().RegisterAchievesCompletedListener(new CollectionManager.DelOnAchievesCompleted(this.OnCollectionAchievesCompleted));
        AchieveManager.Get().TriggerLaunchDayEvent();
        AchieveManager.Get().UpdateActiveAchieves(new AchieveManager.ActiveAchievesUpdatedCallback(this.OnAchievesUpdated));
        this.m_hitbox.gameObject.SetActive(false);
        string key = "GLOBAL_CLICK_TO_CONTINUE";

        if (UniversalInputManager.Get().IsTouchMode())
        {
            key = "GLOBAL_CLICK_TO_CONTINUE_TOUCH";
        }
        this.m_continueText.Text = GameStrings.Get(key);
        this.m_continueText.gameObject.SetActive(false);
        PegUI.Get().SetInputCamera(CameraUtils.FindFirstByLayer(GameLayer.IgnoreFullScreenEffects));
        SceneUtils.SetLayer(this.m_hitbox.gameObject, GameLayer.IgnoreFullScreenEffects);
        SceneUtils.SetLayer(this.m_continueText.gameObject, GameLayer.IgnoreFullScreenEffects);
        if (!Network.ShouldBeConnectedToAurora())
        {
            this.UpdateRewards();
        }
    }
예제 #13
0
    private void ShowActiveQuests()
    {
        List <Achievement> activeQuests = AchieveManager.Get().GetActiveQuests(false);

        if (activeQuests.Count < 1)
        {
            this.m_allCompletedCaption.gameObject.SetActive(true);
        }
        else
        {
            this.m_headlineBanner.gameObject.SetActive(true);
            if (this.m_showRequestData.m_fromLogin)
            {
                this.m_headlineBanner.SetText(GameStrings.Get("GLUE_QUEST_NOTIFICATION_HEADER"));
            }
            else
            {
                this.m_headlineBanner.SetText(GameStrings.Get("GLUE_QUEST_NOTIFICATION_HEADER_NEW_ONLY"));
            }
            if (AchieveManager.Get().HasUnlockedFeature(Achievement.UnlockableFeature.DAILY_QUESTS))
            {
                this.m_questCaption.Text = GameStrings.Get("GLUE_QUEST_NOTIFICATION_CAPTION");
            }
            else
            {
                this.m_questCaption.Text = string.Empty;
            }
            this.m_currentQuests = new List <QuestTile>();
            float x    = 0.4808684f;
            float num2 = this.m_placementCollider.transform.position.x - this.m_placementCollider.GetComponent <Collider>().bounds.extents.x;
            float num3 = this.m_placementCollider.bounds.size.x / ((float)activeQuests.Count);
            float num4 = num3 / 2f;
            bool  flag = false;
            for (int i = 0; i < activeQuests.Count; i++)
            {
                Achievement quest = activeQuests[i];
                bool        flag2 = quest.IsNewlyActive();
                float       y     = 180f;
                if (flag2)
                {
                    y = 0f;
                    this.DoInnkeeperLine(quest);
                }
                GameObject go = UnityEngine.Object.Instantiate <GameObject>(this.m_questTilePrefab.gameObject);
                SceneUtils.SetLayer(go, GameLayer.UI);
                go.transform.position         = new Vector3(num2 + num4, this.m_placementCollider.transform.position.y, this.m_placementCollider.transform.position.z);
                go.transform.parent           = base.transform;
                go.transform.localEulerAngles = new Vector3(90f, y, 0f);
                go.transform.localScale       = new Vector3(x, x, x);
                QuestTile component = go.GetComponent <QuestTile>();
                component.SetupTile(quest);
                this.m_currentQuests.Add(component);
                num4 += num3;
                if (flag2)
                {
                    flag = true;
                    this.FlipQuest(component);
                }
            }
            if (flag)
            {
                SoundManager.Get().LoadAndPlay("new_quest_pop_up");
            }
            else
            {
                SoundManager.Get().LoadAndPlay("existing_quest_pop_up");
            }
        }
    }