Exemplo n.º 1
0
 public void NotifyMousedOut()
 {
     if (this.mousedOver)
     {
         this.mousedOver = false;
         if (this.m_gameEntityMousedOver)
         {
             GameState.Get().GetGameEntity().NotifyOfHistoryTokenMousedOut();
             this.m_gameEntityMousedOver = false;
         }
         KeywordHelpPanelManager.Get().HideKeywordHelp();
         if (base.m_mainCardActor != null)
         {
             base.m_mainCardActor.DeactivateAllSpells();
             base.m_mainCardActor.Hide();
         }
         for (int i = 0; i < this.historyChildren.Count; i++)
         {
             if (this.historyChildren[i].m_mainCardActor != null)
             {
                 this.historyChildren[i].m_mainCardActor.DeactivateAllSpells();
                 this.historyChildren[i].m_mainCardActor.Hide();
             }
         }
         if (this.seperator != null)
         {
             this.seperator.Hide();
         }
         HistoryManager.Get().UpdateLayout();
     }
 }
 public void EnterCraftMode(CollectionCardVisual cardToDisplay)
 {
     if (!this.m_cancellingCraftMode && !CollectionDeckTray.Get().IsWaitingToDeleteDeck())
     {
         CollectionManagerDisplay.Get().HideAllTips();
         this.m_arcaneDustBalance       = NetCache.Get().GetNetObject <NetCache.NetCacheArcaneDustBalance>().Balance;
         this.m_offClickCatcher.enabled = true;
         KeywordHelpPanelManager.Get().HideKeywordHelp();
         this.MoveCardToBigSpot(cardToDisplay, true);
         if (this.m_craftingUI == null)
         {
             string name = (UniversalInputManager.UsePhoneUI == null) ? "CraftingUI" : "CraftingUI_Phone";
             this.m_craftingUI = AssetLoader.Get().LoadGameObject(name, true, false).GetComponent <CraftingUI>();
             this.m_craftingUI.SetStartingActive();
             GameUtils.SetParent(this.m_craftingUI, this.m_showCraftingUIBone.gameObject, false);
         }
         if ((this.m_cardInfoPane == null) && (UniversalInputManager.UsePhoneUI == null))
         {
             this.m_cardInfoPane = AssetLoader.Get().LoadGameObject("CardInfoPane", true, false).GetComponent <CardInfoPane>();
         }
         this.m_craftingUI.gameObject.SetActive(true);
         this.m_craftingUI.Enable(this.m_showCraftingUIBone.position, this.m_hideCraftingUIBone.position);
         this.FadeEffectsIn();
         this.UpdateCardInfoPane();
         Navigation.Push(new Navigation.NavigateBackHandler(this.CancelCraftMode));
     }
 }
 public void ChooseThisCard()
 {
     KeywordHelpPanelManager.Get().HideKeywordHelp();
     this.m_chosen = true;
     this.m_actor.GetSpell(SpellType.DEATHREVERSE).ActivateState(SpellStateType.BIRTH);
     CollectionDeckTray.Get().AddCard(this.m_actor.GetEntityDef(), this.m_actor.GetCardFlair(), null, false, this.m_actor);
     DeckHelper.Get().UpdateChoices();
 }
Exemplo n.º 4
0
 protected override void OnOut(PegUIElement.InteractionState oldState)
 {
     KeywordHelpPanelManager.Get().HideKeywordHelp();
     if (!this.ShouldIgnoreAllInput() && this.IsInCollection())
     {
         this.CheckCardSeen();
         this.m_actor.SetActorState(ActorStateType.CARD_IDLE);
         this.ShowNewItemCallout(false);
     }
 }
Exemplo n.º 5
0
 private void Awake()
 {
     s_instance = this;
     this.m_keywordPanelPool.SetCreateItemCallback(new Pool <KeywordHelpPanel> .CreateItemCallback(this.CreateKeywordPanel));
     this.m_keywordPanelPool.SetDestroyItemCallback(new Pool <KeywordHelpPanel> .DestroyItemCallback(this.DestroyKeywordPanel));
     this.m_keywordPanelPool.SetExtensionCount(1);
     if (SceneMgr.Get() != null)
     {
         SceneMgr.Get().RegisterSceneUnloadedEvent(new SceneMgr.SceneUnloadedCallback(this.OnSceneUnloaded));
     }
 }
 protected override void OnOver(PegUIElement.InteractionState oldState)
 {
     if (this.m_actor.GetEntityDef().IsHero())
     {
         SoundManager.Get().LoadAndPlay("collection_manager_hero_mouse_over");
     }
     else
     {
         SoundManager.Get().LoadAndPlay("collection_manager_card_mouse_over");
     }
     this.m_actor.SetActorState(ActorStateType.CARD_MOUSE_OVER);
     KeywordHelpPanelManager.Get().UpdateKeywordHelpForForge(this.m_actor.GetEntityDef(), this.m_actor, this.m_cardChoice);
 }
Exemplo n.º 7
0
 protected override void OnOver(PegUIElement.InteractionState oldState)
 {
     if (!this.ShouldIgnoreAllInput())
     {
         EntityDef entityDef = this.m_actor.GetEntityDef();
         if (entityDef != null)
         {
             KeywordHelpPanelManager.Get().UpdateKeywordHelpForCollectionManager(entityDef, this.m_actor, this.m_cmRow > 0);
         }
         SoundManager.Get().LoadAndPlay("collection_manager_card_mouse_over", base.gameObject);
         if (this.IsInCollection())
         {
             ActorStateType stateType = ActorStateType.CARD_MOUSE_OVER;
             if (this.CheckCardSeen())
             {
                 stateType = ActorStateType.CARD_RECENTLY_ACQUIRED_MOUSE_OVER;
             }
             this.m_actor.SetActorState(stateType);
         }
     }
 }
    private void UpdateLayoutImpl(int slotMousedOver, int overrideCardCount)
    {
        int num = 0;

        if ((((this.lastMousedOver != slotMousedOver) && (this.lastMousedOver != -1)) && ((this.lastMousedOver < base.m_cards.Count) && (base.m_cards[this.lastMousedOver] != null))) && this.CanAnimateCard(base.m_cards[this.lastMousedOver]))
        {
            Card card = base.m_cards[this.lastMousedOver];
            iTween.Stop(card.gameObject);
            if (!this.enemyHand)
            {
                Vector3 mouseOverCardPosition = this.GetMouseOverCardPosition(card);
                Vector3 cardPosition          = this.GetCardPosition(card, overrideCardCount);
                card.transform.position         = new Vector3(mouseOverCardPosition.x, this.centerOfHand.y, cardPosition.z + 0.5f);
                card.transform.localScale       = this.GetCardScale(card);
                card.transform.localEulerAngles = this.GetCardRotation(card);
            }
            card.NotifyMousedOut();
            GameLayer cardRaycast = GameLayer.Default;
            if ((base.m_Side == Player.Side.OPPOSING) && SpectatorManager.Get().IsSpectatingOpposingSide())
            {
                cardRaycast = GameLayer.CardRaycast;
            }
            SceneUtils.SetLayer(card.gameObject, cardRaycast);
        }
        float delaySec = 0f;

        for (int i = 0; i < base.m_cards.Count; i++)
        {
            Vector3 vector3;
            Card    card2 = base.m_cards[i];
            if (!this.CanAnimateCard(card2))
            {
                continue;
            }
            num++;
            float z = !this.m_flipHandCards ? 354.5f : 534.5f;
            card2.transform.rotation = Quaternion.Euler(new Vector3(card2.transform.localEulerAngles.x, card2.transform.localEulerAngles.y, z));
            float num5 = 0.5f;
            if (this.m_handMoving)
            {
                num5 = 0.25f;
            }
            if (this.enemyHand)
            {
                num5 = 1.5f;
            }
            float           num6            = 0.25f;
            iTween.EaseType easeOutExpo     = iTween.EaseType.easeOutExpo;
            float           transitionDelay = card2.GetTransitionDelay();
            card2.SetTransitionDelay(0f);
            ZoneTransitionStyle transitionStyle = card2.GetTransitionStyle();
            card2.SetTransitionStyle(ZoneTransitionStyle.NORMAL);
            switch (transitionStyle)
            {
            case ZoneTransitionStyle.SLOW:
                easeOutExpo = iTween.EaseType.easeInExpo;
                num6        = num5;
                break;

            case ZoneTransitionStyle.VERY_SLOW:
                easeOutExpo = iTween.EaseType.easeInOutCubic;
                num6        = 1f;
                num5        = 1f;
                break;

            case ZoneTransitionStyle.NORMAL:
                goto Label_0265;
            }
            card2.GetActor().TurnOnCollider();
Label_0265:
            vector3 = this.GetCardPosition(card2, overrideCardCount);
            Vector3 cardRotation = this.GetCardRotation(card2, overrideCardCount);
            Vector3 cardScale    = this.GetCardScale(card2);
            if (i == slotMousedOver)
            {
                easeOutExpo = iTween.EaseType.easeOutExpo;
                if (this.enemyHand)
                {
                    num6 = 0.15f;
                    float num8 = 0.3f;
                    vector3 = new Vector3(vector3.x, vector3.y, vector3.z - num8);
                }
                else
                {
                    float num9 = 0.5f * i;
                    num9 -= (0.5f * base.m_cards.Count) / 2f;
                    float selectCardScale = (float)this.m_SelectCardScale;
                    float num11           = (float)this.m_SelectCardScale;
                    cardRotation = new Vector3(0f, 0f, 0f);
                    cardScale    = new Vector3(selectCardScale, cardScale.y, num11);
                    card2.transform.localScale = cardScale;
                    num5 = 4f;
                    float num12 = 0.1f;
                    vector3 = this.GetMouseOverCardPosition(card2);
                    float x = vector3.x;
                    if (this.m_handEnlarged)
                    {
                        vector3.x = Mathf.Max(vector3.x, this.m_enlargedHandCardMinX);
                        vector3.x = Mathf.Min(vector3.x, this.m_enlargedHandCardMaxX);
                    }
                    card2.transform.position         = new Vector3((x == vector3.x) ? card2.transform.position.x : vector3.x, vector3.y, vector3.z - num12);
                    card2.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
                    iTween.Stop(card2.gameObject);
                    easeOutExpo = iTween.EaseType.easeOutExpo;
                    if (CardTypeBanner.Get() != null)
                    {
                        CardTypeBanner.Get().Show(card2.GetActor());
                    }
                    InputManager.Get().SetMousedOverCard(card2);
                    bool    showOnRight    = card2.GetActor().GetMeshRenderer().bounds.center.x < base.GetComponent <BoxCollider>().bounds.center.x;
                    float?  overrideScale  = null;
                    Vector3?overrideOffset = null;
                    KeywordHelpPanelManager.Get().UpdateKeywordHelp(card2, card2.GetActor(), showOnRight, overrideScale, overrideOffset);
                    SceneUtils.SetLayer(card2.gameObject, GameLayer.Tooltip);
                }
            }
            else if (this.GetStandIn(card2) != null)
            {
                CardStandIn standIn = this.GetStandIn(card2);
                iTween.Stop(standIn.gameObject);
                standIn.transform.position = vector3;
                if (!card2.CardStandInIsInteractive())
                {
                    standIn.DisableStandIn();
                }
                else
                {
                    standIn.EnableStandIn();
                }
            }
            card2.EnableTransitioningZones(true);
            string    tweenName = ZoneMgr.Get().GetTweenName <ZoneHand>();
            object[]  args      = new object[] { "scale", cardScale, "delay", transitionDelay, "time", num6, "easeType", easeOutExpo, "name", tweenName };
            Hashtable hashtable = iTween.Hash(args);
            iTween.ScaleTo(card2.gameObject, hashtable);
            object[]  objArray2  = new object[] { "rotation", cardRotation, "delay", transitionDelay, "time", num6, "easeType", easeOutExpo, "name", tweenName };
            Hashtable hashtable2 = iTween.Hash(objArray2);
            iTween.RotateTo(card2.gameObject, hashtable2);
            object[]  objArray3  = new object[] { "position", vector3, "delay", transitionDelay, "time", num5, "easeType", easeOutExpo, "name", tweenName };
            Hashtable hashtable3 = iTween.Hash(objArray3);
            iTween.MoveTo(card2.gameObject, hashtable3);
            float[] values = new float[] { delaySec, transitionDelay + num5, transitionDelay + num6 };
            delaySec = Mathf.Max(values);
        }
        this.lastMousedOver = slotMousedOver;
        if (num > 0)
        {
            base.StartFinishLayoutTimer(delaySec);
        }
        else
        {
            base.UpdateLayoutFinished();
        }
    }
 protected override void OnOut(PegUIElement.InteractionState oldState)
 {
     this.m_actor.SetActorState(ActorStateType.CARD_IDLE);
     KeywordHelpPanelManager.Get().HideKeywordHelp();
 }
Exemplo n.º 10
0
    private void PositionMouseOverCard()
    {
        if (!this.mousedOver)
        {
            base.m_mainCardActor.Hide();
        }
        else
        {
            base.m_mainCardActor.Show();
            this.ShowDisplayedCreator();
            if (!base.IsInitialized())
            {
                base.InitializeActor();
            }
            base.DisplaySpells();
            if (UniversalInputManager.UsePhoneUI != null)
            {
                base.m_mainCardActor.transform.position = new Vector3(base.transform.position.x + this.MOUSE_OVER_X_OFFSET, base.transform.position.y + 7.524521f, this.GetZOffsetForThisTilesMouseOverCard());
            }
            else
            {
                base.m_mainCardActor.transform.position = new Vector3(base.transform.position.x + this.MOUSE_OVER_X_OFFSET, base.transform.position.y + 7.524521f, base.transform.position.z + this.GetZOffsetForThisTilesMouseOverCard());
            }
            base.m_mainCardActor.transform.localScale = new Vector3((float)this.MOUSE_OVER_SCALE, 1f, (float)this.MOUSE_OVER_SCALE);
            if (!this.m_gameEntityMousedOver)
            {
                this.m_gameEntityMousedOver = true;
                GameState.Get().GetGameEntity().NotifyOfHistoryTokenMousedOver(base.gameObject);
            }
            if (!base.isFatigue)
            {
                KeywordHelpPanelManager.Get().UpdateKeywordHelpForHistoryCard(base.m_entity, base.m_mainCardActor, this.m_createdByText);
            }
            if (this.historyChildren.Count > 0)
            {
                float max  = 1f;
                float num2 = 1f;
                if ((this.historyChildren.Count > 4) && (this.historyChildren.Count < 9))
                {
                    num2 = 2f;
                    max  = 0.5f;
                }
                else if (this.historyChildren.Count >= 9)
                {
                    num2 = 3f;
                    max  = 0.3f;
                }
                int   num3 = Mathf.CeilToInt(((float)this.historyChildren.Count) / num2);
                float num4 = num3 * this.X_SIZE_OF_MOUSE_OVER_CHILD;
                float num5 = 5f / num4;
                num5 = Mathf.Clamp(num5, 0.1f, max);
                int num6 = 0;
                int num7 = 1;
                for (int i = 0; i < this.historyChildren.Count; i++)
                {
                    float num10;
                    this.historyChildren[i].m_mainCardActor.Show();
                    if (!this.historyChildren[i].IsInitialized())
                    {
                        this.historyChildren[i].InitializeActor();
                    }
                    this.historyChildren[i].DisplaySpells();
                    float z = base.m_mainCardActor.transform.position.z;
                    switch (num2)
                    {
                    case 2f:
                        if (num7 == 1)
                        {
                            z += 0.78f;
                        }
                        else
                        {
                            z -= 0.78f;
                        }
                        break;

                    case 3f:
                        switch (num7)
                        {
                        case 1:
                            z += 0.98f;
                            goto Label_031B;

                        case 3:
                            z -= 0.93f;
                            goto Label_031B;
                        }
                        break;
                    }
Label_031B:
                    num10 = base.m_mainCardActor.transform.position.x + ((this.X_SIZE_OF_MOUSE_OVER_CHILD * (1f + num5)) / 2f);
                    this.historyChildren[i].m_mainCardActor.transform.position   = new Vector3(num10 + ((this.X_SIZE_OF_MOUSE_OVER_CHILD * num6) * num5), base.m_mainCardActor.transform.position.y, z);
                    this.historyChildren[i].m_mainCardActor.transform.localScale = new Vector3(num5, num5, num5);
                    num6++;
                    if (num6 >= num3)
                    {
                        num6 = 0;
                        num7++;
                    }
                }
                if (this.seperator != null)
                {
                    float num11 = 0.4f;
                    float num12 = this.X_SIZE_OF_MOUSE_OVER_CHILD / 2f;
                    this.seperator.Show();
                    this.seperator.transform.position = new Vector3(base.m_mainCardActor.transform.position.x + num12, base.m_mainCardActor.transform.position.y + num11, base.m_mainCardActor.transform.position.z);
                }
            }
        }
    }
 protected override void OnOver(PegUIElement.InteractionState oldState)
 {
     SoundManager.Get().LoadAndPlay("collection_manager_card_mouse_over");
     this.m_actor.SetActorState(ActorStateType.CARD_MOUSE_OVER);
     KeywordHelpPanelManager.Get().UpdateKeywordHelpForDeckHelper(this.m_actor.GetEntityDef(), this.m_actor);
 }
Exemplo n.º 12
0
 private void OnDestroy()
 {
     s_instance = null;
 }
Exemplo n.º 13
0
 private void OnOverWhileFlipped(UIEvent e)
 {
     this.m_actor.SetActorState(ActorStateType.CARD_HISTORY);
     KeywordHelpPanelManager.Get().UpdateKeywordHelpForPackOpening(this.m_actor.GetEntityDef(), this.m_actor);
 }
Exemplo n.º 14
0
 private void OnOutWhileFlipped(UIEvent e)
 {
     this.m_actor.SetActorState(ActorStateType.CARD_IDLE);
     KeywordHelpPanelManager.Get().HideKeywordHelp();
 }