public void Show()
 {
     this.m_isShown = true;
     base.gameObject.SetActive(true);
     this.ShowImpl();
     if (!GameMgr.Get().IsTutorial() && !GameMgr.Get().IsSpectator())
     {
         NetCache.HeroLevel heroLevel = GameUtils.GetHeroLevel(GameState.Get().GetFriendlySidePlayer().GetStartingHero().GetClass());
         if (heroLevel == null)
         {
             this.HideXpBar();
         }
         else
         {
             this.m_xpBar = UnityEngine.Object.Instantiate <HeroXPBar>(this.m_xpBarPrefab);
             this.m_xpBar.transform.parent        = this.m_heroActor.transform;
             this.m_xpBar.transform.localScale    = new Vector3(0.88f, 0.88f, 0.88f);
             this.m_xpBar.transform.localPosition = new Vector3(-0.1886583f, 0.2122119f, -0.7446293f);
             this.m_xpBar.m_soloLevelLimit        = NetCache.Get().GetNetObject <NetCache.NetCacheRewardProgress>().XPSoloLimit;
             this.m_xpBar.m_isAnimated            = true;
             this.m_xpBar.m_delay           = BAR_ANIMATION_DELAY;
             this.m_xpBar.m_heroLevel       = heroLevel;
             this.m_xpBar.m_levelUpCallback = new HeroXPBar.PlayLevelUpEffectCallback(this.PlayLevelUpEffect);
             this.m_xpBar.UpdateDisplay();
         }
     }
 }
Ejemplo n.º 2
0
    private void InitRewardText()
    {
        CardRewardData data      = base.Data as CardRewardData;
        EntityDef      entityDef = DefLoader.Get().GetEntityDef(data.CardID);

        if (!entityDef.IsHero())
        {
            string       headline  = GameStrings.Get("GLOBAL_REWARD_CARD_HEADLINE");
            string       details   = string.Empty;
            string       source    = string.Empty;
            TAG_CARD_SET cardSet   = entityDef.GetCardSet();
            TAG_CLASS    tag       = entityDef.GetClass();
            string       className = GameStrings.GetClassName(tag);
            if (GameMgr.Get().IsTutorial())
            {
                details = GameUtils.GetCurrentTutorialCardRewardDetails();
            }
            else if (cardSet == TAG_CARD_SET.CORE)
            {
                int num            = 20;
                int basicCardsIOwn = CollectionManager.Get().GetBasicCardsIOwn(tag);
                if (data.Premium == TAG_PREMIUM.GOLDEN)
                {
                    details = string.Empty;
                }
                else
                {
                    if (num == basicCardsIOwn)
                    {
                        data.InnKeeperLine = CardRewardData.InnKeeperTrigger.CORE_CLASS_SET_COMPLETE;
                    }
                    else if (basicCardsIOwn == 4)
                    {
                        data.InnKeeperLine = CardRewardData.InnKeeperTrigger.SECOND_REWARD_EVER;
                    }
                    object[] args = new object[] { basicCardsIOwn, num, className };
                    details = GameStrings.Format("GLOBAL_REWARD_CORE_CARD_DETAILS", args);
                }
            }
            if (base.Data.Origin == NetCache.ProfileNotice.NoticeOrigin.LEVEL_UP)
            {
                TAG_CLASS          originData = (TAG_CLASS)((int)base.Data.OriginData);
                NetCache.HeroLevel heroLevel  = GameUtils.GetHeroLevel(originData);
                object[]           objArray2  = new object[] { heroLevel.CurrentLevel.Level.ToString(), GameStrings.GetClassName(originData) };
                source = GameStrings.Format("GLOBAL_REWARD_CARD_LEVEL_UP", objArray2);
            }
            else
            {
                source = string.Empty;
            }
            base.SetRewardText(headline, details, source);
        }
    }