Esempio n. 1
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);
    }
Esempio n. 2
0
 protected override void OnRelease()
 {
     if (!this.IsTransactionPendingOnThisCard())
     {
         if (UniversalInputManager.Get().IsTouchMode() || ((CraftingTray.Get() != null) && CraftingTray.Get().IsShown()))
         {
             this.CheckCardSeen();
             this.m_actor.SetActorState(ActorStateType.CARD_IDLE);
             this.EnterCraftingMode();
         }
         else
         {
             Spell spell = this.m_actor.GetSpell(SpellType.DEATHREVERSE);
             if (!this.CanPickUpCard())
             {
                 SoundManager.Get().LoadAndPlay("collection_manager_card_move_invalid_or_click");
                 if (spell != null)
                 {
                     spell.ActivateState(SpellStateType.BIRTH);
                 }
                 EntityDef entityDef = this.m_actor.GetEntityDef();
                 bool      isHero    = (entityDef != null) && entityDef.IsHero();
                 CollectionManagerDisplay.Get().ShowInnkeeeprLClickHelp(isHero);
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARDS)
             {
                 EntityDef cardEntityDef = this.m_actor.GetEntityDef();
                 if (cardEntityDef != null)
                 {
                     if (spell != null)
                     {
                         spell.ActivateState(SpellStateType.BIRTH);
                     }
                     CollectionDeckTray.Get().AddCard(cardEntityDef, this.m_actor.GetCardFlair(), null, false, this.m_actor);
                 }
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.CARD_BACKS)
             {
                 CollectionDeckTray.Get().SetCardBack(this.m_actor);
             }
             else if (this.m_visualType == CollectionManagerDisplay.ViewMode.HERO_SKINS)
             {
                 CollectionDeckTray.Get().SetHeroSkin(this.m_actor);
             }
         }
     }
 }
 private void OnDestroy()
 {
     s_instance = null;
 }
 private void Awake()
 {
     s_instance = this;
 }