Example #1
0
 private void Close()
 {
     Navigation.PopUnique(new Navigation.NavigateBackHandler(WelcomeQuests.OnNavigateBack));
     s_instance = null;
     this.m_clickCatcher.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.CloseWelcomeQuests));
     this.FadeEffectsOut();
     object[] args = new object[] { "scale", Vector3.zero, "time", 0.5f, "oncompletetarget", base.gameObject, "oncomplete", "DestroyWelcomeQuests" };
     iTween.ScaleTo(base.gameObject, iTween.Hash(args));
     SoundManager.Get().LoadAndPlay("new_quest_click_and_shrink");
     this.m_bannerFX.Play("BannerClose");
     GameToastMgr.Get().UpdateQuestProgressToasts();
     GameToastMgr.Get().AddSeasonTimeRemainingToast();
     if (this.m_showRequestData != null)
     {
         if (!this.m_showRequestData.m_keepRichPresence)
         {
             PresenceMgr.Get().SetPrevStatus();
         }
         if (this.m_showRequestData.m_onCloseCallback != null)
         {
             this.m_showRequestData.m_onCloseCallback();
         }
     }
     InnKeepersSpecial.Get().Show(false);
 }
Example #2
0
 void CleanUp()
 {
     try
     {
         VictoryScreen.Get().ContinueEvents();
     } catch
     {
     }
     try
     {
         VictoryScreen.Get().m_hitbox.TriggerRelease();
     } catch
     {
     }
     try
     {
         EndGameScreen.Get().ContinueEvents();
     } catch
     {
     }
     try
     {
         EndGameScreen.Get().m_hitbox.TriggerRelease();
     } catch
     {
     }
     try
     {
         WelcomeQuests.Get().m_clickCatcher.TriggerRelease();
     } catch
     {
     }
 }
Example #3
0
 private static void OnWelcomeQuestsLoaded(string name, GameObject go, object callbackData)
 {
     if ((SceneMgr.Get() != null) && SceneMgr.Get().IsInGame())
     {
         if (s_instance != null)
         {
             s_instance.Close();
         }
     }
     else if (go == null)
     {
         Debug.LogError(string.Format("WelcomeQuests.OnWelcomeQuestsLoaded() - FAILED to load \"{0}\"", name));
     }
     else
     {
         s_instance = go.GetComponent <WelcomeQuests>();
         if (s_instance == null)
         {
             Debug.LogError(string.Format("WelcomeQuests.OnWelcomeQuestsLoaded() - ERROR object \"{0}\" has no WelcomeQuests component", name));
         }
         else
         {
             ShowRequestData showRequestData = callbackData as ShowRequestData;
             s_instance.InitAndShow(showRequestData);
         }
     }
 }
Example #4
0
 public static void ReleaseQuests()
 {
     if (WelcomeQuests.Get() != null)
     {
         WelcomeQuests.Get().m_clickCatcher.TriggerRelease();
     }
 }
 private void Click(UIEvent e)
 {
     Log.InnKeepersSpecial.Print("IKS on release! " + this.m_link, new object[0]);
     if (this.m_gameAction != null)
     {
         WelcomeQuests.OnNavigateBack();
         this.Show(false);
         string str = this.m_gameAction.ToLowerInvariant();
         if (str.StartsWith("store"))
         {
             char[]   separator = new char[] { ' ' };
             string[] strArray  = str.Split(separator);
             if (strArray.Length > 1)
             {
                 BoosterDbId   iNVALID = BoosterDbId.INVALID;
                 AdventureDbId id2     = AdventureDbId.INVALID;
                 string        str2    = strArray[1];
                 try
                 {
                     iNVALID = (BoosterDbId)((int)Enum.Parse(typeof(BoosterDbId), str2.ToUpper()));
                 }
                 catch (ArgumentException)
                 {
                 }
                 try
                 {
                     id2 = (AdventureDbId)((int)Enum.Parse(typeof(AdventureDbId), str2.ToUpper()));
                 }
                 catch (ArgumentException)
                 {
                 }
                 if (iNVALID != BoosterDbId.INVALID)
                 {
                     Options.Get().SetInt(Option.LAST_SELECTED_STORE_BOOSTER_ID, (int)iNVALID);
                     this.ShowStore(GeneralStoreMode.CARDS);
                 }
                 else if (id2 != AdventureDbId.INVALID)
                 {
                     Options.Get().SetInt(Option.LAST_SELECTED_STORE_ADVENTURE_ID, (int)id2);
                     this.ShowStore(GeneralStoreMode.ADVENTURE);
                 }
                 else
                 {
                     this.ShowStore(GeneralStoreMode.NONE);
                 }
             }
             else
             {
                 this.ShowStore(GeneralStoreMode.NONE);
             }
         }
     }
     else if (this.m_link != null)
     {
         Application.OpenURL(this.m_link);
     }
 }
Example #6
0
 private void OnDestroy()
 {
     if (s_instance != null)
     {
         Navigation.PopUnique(new Navigation.NavigateBackHandler(WelcomeQuests.OnNavigateBack));
         s_instance = null;
         this.FadeEffectsOut();
         InnKeepersSpecial.Get().Show(false);
     }
 }
Example #7
0
 // Welcome / login screen
 private void login_mode()
 {
     // If there are any welcome quests on the screen
     if (WelcomeQuests.Get() != null)
     {
         Log.say("Entering to main menu");
         // Emulate a next click
         WelcomeQuests.Get().m_clickCatcher.TriggerRelease();
     }
 }
Example #8
0
        /// <summary>
        /// Close a quests dialog if there is one.
        /// </summary>
        /// <returns>return false if there is no quests dialog.</returns>
        public bool DoCloseQuestsDialog()
        {
            WelcomeQuests wq = WelcomeQuests.Get();

            if (wq != null)
            {
                wq.m_clickCatcher.TriggerRelease();
                return(true);
            }

            return(false);
        }
Example #9
0
        private void ManageModes(SceneMgr.Mode Mode)
        {
            switch (Mode)
            {
            case SceneMgr.Mode.LOGIN:
                if (WelcomeQuests.Get() != null)
                {
                    // Releases Quests
                    Graphics.AddInfoMsg("Released Quests");
                    WelcomeQuests.Get().m_clickCatcher.TriggerRelease();
                }
                break;

            case SceneMgr.Mode.HUB:
                //Graphics.AddInfoMsg("Seting Adventure Mode");
                //SceneMgr.Get().SetNextMode(SceneMgr.Mode.ADVENTURE);
                break;

            case SceneMgr.Mode.TOURNAMENT:
                if (!starting)
                {
                    Game.Delay(2000);
                    Graphics.AddInfoMsg("Starting Game");
                    Game.FindGame(PegasusShared.GameType.GT_UNRANKED, (int)MissionId.MULTIPLAYER_1v1, DeckPickerTrayDisplay.Get().GetSelectedDeckID());
                    starting = true;
                }
                break;

            case SceneMgr.Mode.ADVENTURE:
                if (!starting)
                {
                    Game.Delay(2000);
                    Graphics.AddInfoMsg("Starting Game");
                    Game.FindGame(PegasusShared.GameType.GT_VS_AI, (int)MissionId.PRACTICE_EXPERT_PRIEST, DeckPickerTrayDisplay.Get().GetSelectedDeckID());
                    starting = true;
                }
                break;

            case SceneMgr.Mode.GAMEPLAY:
                if (!GameStarted)
                {
                    Graphics.AddInfoMsg("Starting GameHandler");
                    GameStarted = true;
                    NintendoBot.GameHandler.Init();
                }

                break;

            default:
                Graphics.AddErrorMsg("Cant Find Mode:" + Mode);
                break;
            }
        }
Example #10
0
    private bool CanShowCredits()
    {
        SceneMgr.Mode mode = SceneMgr.Get().GetMode();
        switch (mode)
        {
        case SceneMgr.Mode.GAMEPLAY:
        case SceneMgr.Mode.PACKOPENING:
            break;

        default:
            switch (mode)
            {
            case SceneMgr.Mode.CREDITS:
            case SceneMgr.Mode.ADVENTURE:
                break;

            case SceneMgr.Mode.RESET:
                goto Label_003D;

            default:
                goto Label_003D;
            }
            break;
        }
        return(false);

Label_003D:
        if ((GeneralStore.Get() != null) && GeneralStore.Get().IsShown())
        {
            return(false);
        }
        if (Network.Get().IsFindingGame())
        {
            return(false);
        }
        if (!GameUtils.AreAllTutorialsComplete())
        {
            return(false);
        }
        if (WelcomeQuests.Get() != null)
        {
            return(false);
        }
        if ((ArenaStore.Get() != null) && ArenaStore.Get().IsShown())
        {
            return(false);
        }
        if ((DraftDisplay.Get() != null) && (DraftDisplay.Get().GetDraftMode() == DraftDisplay.DraftMode.IN_REWARDS))
        {
            return(false);
        }
        return(true);
    }
 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();
     }
 }
Example #12
0
 private void ClearUIQuest()
 {
     try
     {
         WelcomeQuests wq = WelcomeQuests.Get();
         if (wq != null)
         {
             wq.m_clickCatcher.TriggerRelease();
         }
     }
     catch (Exception e)
     {
         Notify(e.ToString());
     }
 }
Example #13
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();
     }
 }
Example #14
0
        /// <summary>
        /// Get current Pegasus Scene State.
        /// </summary>
        /// <returns>The RockPegasusSceneState.</returns>
        public RockPegasusSceneState GetPegasusSceneState()
        {
            if (WelcomeQuests.Get() != null)
            {
                return(RockPegasusSceneState.QuestsDialog);
            }

            if (DialogManager.Get() != null)
            {
                if (DialogManager.Get().ShowingDialog())
                {
                    return(RockPegasusSceneState.GeneralDialog);
                }
            }

            if (Network.Get().IsFindingGame())
            {
                return(RockPegasusSceneState.BlockingScene);
            }

            if (GameMgr.Get().IsTransitionPopupShown())
            {
                return(RockPegasusSceneState.BlockingScene);
            }

            var sceneMode = SceneMgr.Get().GetMode();

            var pegasusState = RockPegasusHelper.GetPegasusSceneState(sceneMode);

            if (pegasusState == RockPegasusSceneState.GamePlay)
            {
                if (GameState.Get() == null)
                {
                    return(RockPegasusSceneState.BlockingScene);
                }
            }

            return(pegasusState);
        }