Example #1
0
 private void Awake()
 {
     s_instance = this;
     OverlayUI.Get().AddGameObject(base.gameObject, CanvasAnchor.CENTER, false, CanvasScaleMode.HEIGHT);
     this.m_logo = AssetLoader.Get().LoadGameObject(FileUtils.GameAssetPathToName(this.m_logoPrefab), true, false);
     GameUtils.SetParent(this.m_logo, this.m_logoContainer, true);
     this.m_logo.SetActive(false);
     this.m_webLoginCanvas = null;
     this.Show();
     this.UpdateLayout();
     if (Vars.Key("Aurora.ClientCheck").GetBool(true) && BattleNetClient.needsToRun)
     {
         BattleNetClient.quitHearthstoneAndRun();
     }
     else
     {
         Network.Get().RegisterQueueInfoHandler(new Network.QueueInfoHandler(this.QueueInfoHandler));
         if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE)
         {
             this.m_demoDisclaimer.SetActive(true);
         }
         if (ApplicationMgr.IsInternal() && (ApplicationMgr.AllowResetFromFatalError != null))
         {
             this.m_devClearLoginButton.gameObject.SetActive(true);
             this.m_devClearLoginButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ClearLogin));
         }
     }
 }
 public static bool AreAllTutorialsComplete(TutorialProgress progress)
 {
     if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE)
     {
         return(false);
     }
     return(progress == TutorialProgress.ILLIDAN_COMPLETE);
 }
Example #3
0
 public void RemoveStoreHandlers()
 {
     StoreManager.Get().RemoveSuccessfulPurchaseAckListener(new StoreManager.SuccessfulPurchaseAckCallback(this.OnDraftPurchaseAck));
     if (DemoMgr.Get().ArenaIs1WinMode())
     {
         StoreManager.Get().RemoveSuccessfulPurchaseListener(new StoreManager.SuccessfulPurchaseCallback(this.OnDraftPurchaseAck));
     }
 }
Example #4
0
    private bool HandleEscapeKey()
    {
        if ((this.m_gameMenu != null) && this.m_gameMenu.IsShown())
        {
            this.m_gameMenu.Hide();
            return(true);
        }
        if ((OptionsMenu.Get() != null) && OptionsMenu.Get().IsShown())
        {
            OptionsMenu.Get().Hide(true);
            return(true);
        }
        if ((QuestLog.Get() != null) && QuestLog.Get().IsShown())
        {
            QuestLog.Get().Hide();
            return(true);
        }
        if ((GeneralStore.Get() != null) && GeneralStore.Get().IsShown())
        {
            GeneralStore.Get().Close();
            return(true);
        }
        ChatMgr mgr = ChatMgr.Get();

        if ((mgr == null) || !mgr.HandleKeyboardInput())
        {
            if ((CraftingTray.Get() != null) && CraftingTray.Get().IsShown())
            {
                CraftingTray.Get().Hide();
                return(true);
            }
            SceneMgr.Mode mode = SceneMgr.Get().GetMode();
            switch (mode)
            {
            case SceneMgr.Mode.FATAL_ERROR:
                return(true);

            case SceneMgr.Mode.LOGIN:
                return(true);

            case SceneMgr.Mode.STARTUP:
                return(true);
            }
            if ((mode != SceneMgr.Mode.GAMEPLAY) && !DemoMgr.Get().IsHubEscMenuEnabled())
            {
                return(true);
            }
            if ((PlatformSettings.OS == OSCategory.Android) && (mode == SceneMgr.Mode.HUB))
            {
                return(false);
            }
            this.ToggleGameMenu();
        }
        return(true);
    }
Example #5
0
    private void OnChoicesAndContents()
    {
        Network.DraftChoicesAndContents draftChoicesAndContents = Network.GetDraftChoicesAndContents();
        this.m_currentSlot = draftChoicesAndContents.Slot;
        this.m_validSlot   = draftChoicesAndContents.Slot;
        CollectionDeck deck = new CollectionDeck {
            ID            = draftChoicesAndContents.DeckInfo.Deck,
            Type          = DeckType.DRAFT_DECK,
            HeroCardID    = draftChoicesAndContents.Hero.Name,
            HeroCardFlair = new CardFlair(draftChoicesAndContents.Hero.Premium)
        };

        this.m_draftDeck = deck;
        Log.Arena.Print(string.Format("DraftManager.OnChoicesAndContents - Draft Deck ID: {0}, Hero Card = {1}", this.m_draftDeck.ID, this.m_draftDeck.HeroCardID), new object[0]);
        foreach (Network.CardUserData data in draftChoicesAndContents.DeckInfo.Cards)
        {
            string str = (data.DbId != 0) ? GameUtils.TranslateDbIdToCardId(data.DbId) : string.Empty;
            Log.Arena.Print(string.Format("DraftManager.OnChoicesAndContents - Draft deck contains card {0}", str), new object[0]);
            if (!this.m_draftDeck.AddCard(str, data.Premium))
            {
                Debug.LogWarning(string.Format("DraftManager.OnChoicesAndContents() - Card {0} could not be added to draft deck", str));
            }
        }
        this.m_losses = draftChoicesAndContents.Losses;
        if (draftChoicesAndContents.Wins > this.m_wins)
        {
            this.m_isNewKey = true;
        }
        else
        {
            this.m_isNewKey = false;
        }
        this.m_wins    = draftChoicesAndContents.Wins;
        this.m_maxWins = draftChoicesAndContents.MaxWins;
        this.m_chest   = draftChoicesAndContents.Chest;
        if ((this.m_losses > 0) && DemoMgr.Get().ArenaIs1WinMode())
        {
            Network.RetireDraftDeck(this.GetDraftDeck().ID, this.GetSlot());
        }
        else
        {
            if ((this.m_wins == 5) && (DemoMgr.Get().GetMode() == DemoMode.BLIZZCON_2013))
            {
                DemoMgr.Get().CreateDemoText(GameStrings.Get("GLUE_BLIZZCON2013_ARENA_5_WINS"), false, false);
            }
            else if ((this.m_losses == 3) && !Options.Get().GetBool(Option.HAS_LOST_IN_ARENA, false))
            {
                NotificationManager.Get().CreateInnkeeperQuote(new Vector3(155.3f, NotificationManager.DEPTH, 34.5f), GameStrings.Get("VO_INNKEEPER_ARENA_3RD_LOSS"), "VO_INNKEEPER_ARENA_3RD_LOSS", 0f, null);
                Options.Get().SetBool(Option.HAS_LOST_IN_ARENA, true);
            }
            this.InformDraftDisplayOfChoices(draftChoicesAndContents.Choices);
        }
    }
 public bool ChangeState(State state)
 {
     if (DemoMgr.Get().GetMode() != DemoMode.PAX_EAST_2013)
     {
         if (DemoMgr.Get().GetMode() == DemoMode.BLIZZCON_2013)
         {
             return(true);
         }
         if (this.m_state == state)
         {
             return(false);
         }
         State state2 = this.m_state;
         this.m_state = state;
         if (this.IsInactiveState(state2) && this.IsInactiveState(this.m_state))
         {
             return(true);
         }
         base.gameObject.SetActive(true);
         if (state == State.CLOSED)
         {
             this.m_parent.OnAnimStarted();
             object[]  args      = new object[] { "position", this.m_info.m_ClosedBone.transform.position, "delay", this.m_info.m_ClosedDelaySec, "time", this.m_info.m_ClosedMoveSec, "easeType", this.m_info.m_ClosedMoveEaseType, "oncomplete", "OnClosedAnimFinished", "oncompletetarget", base.gameObject };
             Hashtable hashtable = iTween.Hash(args);
             iTween.MoveTo(base.gameObject, hashtable);
             this.m_parent.GetEventSpell(BoxEventType.DRAWER_CLOSE).Activate();
         }
         else if (state == State.CLOSED_BOX_OPENED)
         {
             this.m_parent.OnAnimStarted();
             object[]  objArray2  = new object[] { "position", this.m_info.m_ClosedBoxOpenedBone.transform.position, "delay", this.m_info.m_ClosedBoxOpenedDelaySec, "time", this.m_info.m_ClosedBoxOpenedMoveSec, "easeType", this.m_info.m_ClosedBoxOpenedMoveEaseType, "oncomplete", "OnClosedBoxOpenedAnimFinished", "oncompletetarget", base.gameObject };
             Hashtable hashtable2 = iTween.Hash(objArray2);
             iTween.MoveTo(base.gameObject, hashtable2);
             this.m_parent.GetEventSpell(BoxEventType.DRAWER_CLOSE).Activate();
         }
         else if (state == State.OPENED)
         {
             this.m_parent.OnAnimStarted();
             object[]  objArray3  = new object[] { "position", this.m_info.m_OpenedBone.transform.position, "delay", this.m_info.m_OpenedDelaySec, "time", this.m_info.m_OpenedMoveSec, "easeType", this.m_info.m_OpenedMoveEaseType, "oncomplete", "OnOpenedAnimFinished", "oncompletetarget", base.gameObject };
             Hashtable hashtable3 = iTween.Hash(objArray3);
             iTween.MoveTo(base.gameObject, hashtable3);
             this.m_parent.GetEventSpell(BoxEventType.DRAWER_OPEN).Activate();
         }
     }
     return(true);
 }
Example #7
0
 private void Show(CurrencyType currencyType)
 {
     if (UniversalInputManager.UsePhoneUI != null)
     {
         this.ShowImmediate(currencyType);
     }
     else
     {
         bool flag = currencyType != CurrencyType.NONE;
         if (!DemoMgr.Get().IsCurrencyEnabled())
         {
             flag = false;
         }
         if (flag)
         {
             if ((this.m_state == State.SHOWN) || (this.m_state == State.ANIMATE_IN))
             {
                 this.ShowCurrencyType(currencyType);
             }
             else
             {
                 this.m_state = State.ANIMATE_IN;
                 base.gameObject.SetActive(true);
                 object[]  args      = new object[] { "amount", 1f, "delay", 0f, "time", 0.25f, "easeType", iTween.EaseType.easeOutCubic, "oncomplete", "ActivateCurrencyFrame", "oncompletetarget", base.gameObject };
                 Hashtable hashtable = iTween.Hash(args);
                 iTween.Stop(base.gameObject);
                 iTween.FadeTo(base.gameObject, hashtable);
                 this.ShowCurrencyType(currencyType);
             }
         }
         else if ((this.m_state == State.HIDDEN) || (this.m_state == State.ANIMATE_OUT))
         {
             this.ShowCurrencyType(currencyType);
         }
         else
         {
             this.m_state = State.ANIMATE_OUT;
             object[]  objArray2  = new object[] { "amount", 0f, "delay", 0f, "time", 0.25f, "easeType", iTween.EaseType.easeOutCubic, "oncomplete", "DeactivateCurrencyFrame", "oncompletetarget", base.gameObject };
             Hashtable hashtable2 = iTween.Hash(objArray2);
             iTween.Stop(base.gameObject);
             iTween.FadeTo(base.gameObject, hashtable2);
             this.ShowCurrencyType(currencyType);
         }
     }
 }
Example #8
0
    protected override List <UIBButton> GetButtons()
    {
        List <UIBButton> list = new List <UIBButton>();

        if (this.IsInGameMenu())
        {
            list.Add(this.m_concedeButton);
            list.Add(null);
        }
        if (!DemoMgr.Get().IsExpoDemo())
        {
            list.Add(this.m_optionsButton);
            list.Add(this.m_quitButton);
            list.Add(null);
        }
        list.Add(this.m_resumeButton);
        return(list);
    }
 private bool CanCheckForInactivity()
 {
     if (DemoMgr.Get().IsExpoDemo())
     {
         return(false);
     }
     if (!Network.IsLoggedIn())
     {
         return(false);
     }
     if (!this.m_shouldCheckForInactivity)
     {
         return(false);
     }
     if (ApplicationMgr.IsInternal() && !Options.Get().GetBool(Option.IDLE_KICKER))
     {
         return(false);
     }
     return(true);
 }
Example #10
0
 protected override void ShowStandardFlow()
 {
     base.ShowStandardFlow();
     if (!GameMgr.Get().IsTutorial() || GameMgr.Get().IsSpectator())
     {
         base.m_hitbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ContinueButtonPress_PrevMode));
     }
     else if (GameUtils.AreAllTutorialsComplete())
     {
         LoadingScreen.Get().SetFadeColor(Color.white);
         base.m_hitbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ContinueButtonPress_FirstTimeHub));
     }
     else if ((DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE) && (GameUtils.GetNextTutorial() == 0))
     {
         base.StartCoroutine(DemoMgr.Get().CompleteAppleStoreDemo());
     }
     else
     {
         base.m_hitbox.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ContinueButtonPress_TutorialProgress));
     }
 }
    public bool CanPlayScenario(int scenarioID)
    {
        if ((DemoMgr.Get().GetMode() == DemoMode.BLIZZCON_2015) && (scenarioID != 0x425))
        {
            return(false);
        }
        if (!this.m_missions.ContainsKey(scenarioID))
        {
            return(true);
        }
        AdventureMission mission = this.m_missions[scenarioID];

        if (!mission.HasRequiredProgress())
        {
            return(true);
        }
        AdventureMission.WingProgress progress = this.GetProgress(mission.RequiredProgress.Wing);
        if (progress == null)
        {
            return(false);
        }
        return(progress.MeetsProgressAndFlagsRequirements(mission.RequiredProgress));
    }
Example #12
0
 private void OnApplicationPause(bool pauseStatus)
 {
     if (UnityEngine.Time.frameCount != 0)
     {
         if (pauseStatus)
         {
             this.m_lastPauseTime = UnityEngine.Time.realtimeSinceStartup;
             if (this.Paused != null)
             {
                 this.Paused();
             }
             UberText.StoreCachedData();
             Network.ApplicationPaused();
         }
         else
         {
             this.m_hasResetSinceLastResume = false;
             float num = UnityEngine.Time.realtimeSinceStartup - this.m_lastPauseTime;
             UnityEngine.Debug.Log("Time spent paused: " + num);
             if ((DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE) && (num > 180f))
             {
                 this.ResetImmediately(false, false);
             }
             this.m_lastResumeTime = UnityEngine.Time.realtimeSinceStartup;
             if (this.Unpaused != null)
             {
                 this.Unpaused();
             }
             Network.ApplicationUnpaused();
             if (SceneMgr.Get().IsModeRequested(SceneMgr.Mode.FATAL_ERROR))
             {
                 this.ResetImmediately(false, false);
             }
         }
     }
 }
Example #13
0
 private void InitializeGame()
 {
     GameDbf.Load();
     DemoMgr.Get().Initialize();
     LocalOptions.Get().Initialize();
     if (DemoMgr.Get().GetMode() == DemoMode.APPLE_STORE)
     {
         DemoMgr.Get().ApplyAppleStoreDemoDefaults();
     }
     if (Network.TUTORIALS_WITHOUT_ACCOUNT != null)
     {
         Network.SetShouldBeConnectedToAurora(Options.Get().GetBool(Option.CONNECT_TO_AURORA));
     }
     Network.Initialize();
     Localization.Initialize();
     GameStrings.LoadCategory(GameStringCategory.GLOBAL);
     if (!PlayErrors.Init())
     {
         UnityEngine.Debug.LogError(string.Format("{0} failed to load!", "PlayErrors32"));
     }
     GameMgr.Get().Initialize();
     ChangedCardMgr.Get().Initialize();
     TavernBrawlManager.Init();
 }