private string GetItemsText()
    {
        string productName = StoreManager.Get().GetProductName(this.m_bundle.Items);

        object[] args = new object[] { this.m_quantity, productName };
        return(GameStrings.Format("GLUE_STORE_SUMMARY_ITEM_ORDERED", args));
    }
    private void UpdateTimeText()
    {
        string requestElapsedTimeString = FriendUtils.GetRequestElapsedTimeString(this.m_invite.GetCreationTimeMicrosec());

        object[] args = new object[] { requestElapsedTimeString };
        this.m_TimeText.Text = GameStrings.Format("GLOBAL_FRIENDLIST_REQUEST_SENT_TIME", args);
    }
    private void CheckForNewRank(BnetPlayer player)
    {
        MedalInfoTranslator rankPresenceField = RankMgr.Get().GetRankPresenceField(player);

        if (rankPresenceField != null)
        {
            BnetGameAccountId hearthstoneGameAccountId = player.GetHearthstoneGameAccountId();
            int rank = rankPresenceField.GetCurrentMedal().rank;
            if (!this.m_lastKnownMedal.ContainsKey(hearthstoneGameAccountId))
            {
                this.m_lastKnownMedal[hearthstoneGameAccountId] = rank;
            }
            else if ((rank <= 10) && (this.m_lastKnownMedal[hearthstoneGameAccountId] > rank))
            {
                this.m_lastKnownMedal[hearthstoneGameAccountId] = rank;
                if (rank == 0)
                {
                    object[] args = new object[] { "5ecaf0ff", player.GetBestName() };
                    this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_RANK_LEGEND", args));
                }
                else
                {
                    object[] objArray2 = new object[] { "5ecaf0ff", player.GetBestName(), rankPresenceField.GetCurrentMedal().rank };
                    this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_GAINED_RANK", objArray2));
                }
            }
        }
    }
 private void UpdateWhisper()
 {
     if (this.m_whisper != null)
     {
         if (this.m_whisper.GetSpeakerId() == BnetPresenceMgr.Get().GetMyGameAccountId())
         {
             this.m_MyDecoration.SetActive(true);
             this.m_TheirDecoration.SetActive(false);
             BnetPlayer receiver = this.m_whisper.GetReceiver();
             object[]   args     = new object[] { receiver.GetBestName() };
             this.m_NameText.Text = GameStrings.Format("GLOBAL_CHAT_BUBBLE_RECEIVER_NAME", args);
         }
         else
         {
             this.m_MyDecoration.SetActive(false);
             this.m_TheirDecoration.SetActive(true);
             BnetPlayer speaker = this.m_whisper.GetSpeaker();
             if (speaker.IsOnline())
             {
                 this.m_NameText.TextColor = GameColors.PLAYER_NAME_ONLINE;
             }
             else
             {
                 this.m_NameText.TextColor = GameColors.PLAYER_NAME_OFFLINE;
             }
             this.m_NameText.Text = speaker.GetBestName();
         }
         this.m_MessageText.Text = ChatUtils.GetMessage(this.m_whisper);
     }
 }
예제 #5
0
 private void UpdateVisibility()
 {
     if (this.m_count <= 1)
     {
         this.Hide();
     }
     else
     {
         GameObject border;
         GameObject wideBorder;
         base.gameObject.SetActive(true);
         if (this.m_count < 10)
         {
             border     = this.m_border;
             wideBorder = this.m_wideBorder;
             object[] args = new object[] { this.m_count };
             this.m_countText.Text = GameStrings.Format("GLUE_COLLECTION_CARD_COUNT", args);
         }
         else
         {
             border                = this.m_wideBorder;
             wideBorder            = this.m_border;
             this.m_countText.Text = GameStrings.Get("GLUE_COLLECTION_CARD_COUNT_LARGE");
         }
         border.SetActive(true);
         wideBorder.SetActive(false);
     }
 }
    public void SetBasicSetProgress(TAG_CLASS classTag)
    {
        int basicCardsIOwn = CollectionManager.Get().GetBasicCardsIOwn(classTag);
        int num2           = 20;

        if (basicCardsIOwn == num2)
        {
            this.m_classLabel.transform.position         = this.m_bones.m_classLabelOneLine.position;
            this.m_labelGradient.transform.parent        = this.m_bones.m_gradientOneLine;
            this.m_labelGradient.transform.localPosition = Vector3.zero;
            this.m_labelGradient.transform.localScale    = Vector3.one;
            this.m_setProgressLabel.gameObject.SetActive(false);
        }
        else
        {
            this.m_classLabel.transform.position  = this.m_bones.m_classLabelTwoLine.position;
            this.m_labelGradient.transform.parent = this.m_bones.m_gradientTwoLine;
            object[] args = new object[] { basicCardsIOwn, num2 };
            this.m_setProgressLabel.Text = GameStrings.Format((UniversalInputManager.UsePhoneUI == null) ? "GLUE_BASIC_SET_PROGRESS" : "GLUE_BASIC_SET_PROGRESS_PHONE", args);
            this.m_labelGradient.transform.localPosition = Vector3.zero;
            this.m_labelGradient.transform.localScale    = Vector3.one;
            this.m_setProgressLabel.gameObject.SetActive(true);
            this.m_setProgressLabel.TextColor = BASIC_SET_COLOR_IN_PROGRESS;
        }
    }
예제 #7
0
    private void ChinaRestrictions_LessThan3Hours(int minutesPlayed, int hours)
    {
        if (this.m_NextMessageDisplayTime < 0f)
        {
            this.m_NextMessageDisplayTime = this.m_TimePlayed + (60 - (minutesPlayed % 60));
        }
        else
        {
            this.m_NextMessageDisplayTime = this.m_TimePlayed + 60;
        }
        object[] args    = new object[] { hours };
        string   textArg = GameStrings.Format("GLOBAL_HEALTHY_GAMING_CHINA_LESS_THAN_THREE_HOURS", args);

        SocialToastMgr.Get().AddToast(textArg, SocialToastMgr.TOAST_TYPE.DEFAULT, (float)60f);
        if (this.m_DebugMode)
        {
            Log.HealthyGaming.Print("GLOBAL_HEALTHY_GAMING_CHINA_LESS_THAN_THREE_HOURS: " + minutesPlayed.ToString(), new object[0]);
            object[] objArray2 = new object[] { hours };
            Log.HealthyGaming.Print(GameStrings.Format("GLOBAL_HEALTHY_GAMING_CHINA_LESS_THAN_THREE_HOURS", objArray2), new object[0]);
            Log.HealthyGaming.Print("NextMessageDisplayTime: " + this.m_NextMessageDisplayTime.ToString(), new object[0]);
        }
        else
        {
            Log.HealthyGaming.Print(string.Format("Time: {0},  Played: {1},  {2}", UnityEngine.Time.realtimeSinceStartup, minutesPlayed, textArg), new object[0]);
        }
    }
 private void OnFontDefLoaded(string name, GameObject go, object userData)
 {
     if (go == null)
     {
         this.OnInitialDefLoaded();
     }
     else
     {
         FontDef component = go.GetComponent <FontDef>();
         if (component == null)
         {
             object[] args    = new object[] { name };
             string   message = GameStrings.Format("GLOBAL_ERROR_ASSET_INCORRECT_DATA", args);
             Error.AddFatal(message);
             Debug.LogError(string.Format("FontTable.OnFontDefLoaded() - name={0} message={1}", name, message));
             this.OnInitialDefLoaded();
         }
         else
         {
             component.transform.parent = base.transform;
             this.m_defs.Add(name, component);
             this.OnInitialDefLoaded();
         }
     }
 }
    private void AddOnlineMessage()
    {
        object[] args    = new object[] { this.receiver.GetBestName() };
        string   message = GameStrings.Format("GLOBAL_CHAT_RECEIVER_ONLINE", args);

        this.AddSystemMessage(message, this.messageInfo.infoColor);
    }
예제 #10
0
 private void OnInputComplete(string input)
 {
     if (!string.IsNullOrEmpty(input))
     {
         if (this.m_receiver.IsOnline())
         {
             BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input);
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else if (ChatMgr.Get().IsChatLogFrameShown())
         {
             if (!BnetWhisperMgr.Get().SendWhisper(this.m_receiver, input))
             {
                 this.m_chatLogFrame.m_chatLog.OnWhisperFailed();
             }
             ChatMgr.Get().AddRecentWhisperPlayerToTop(this.m_receiver);
         }
         else
         {
             object[] args    = new object[] { this.m_receiver.GetBestName() };
             string   message = GameStrings.Format("GLOBAL_CHAT_RECEIVER_OFFLINE", args);
             UIStatus.Get().AddError(message);
         }
     }
     if (ChatMgr.Get().IsChatLogFrameShown())
     {
         this.ShowInput(false);
     }
     else
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
예제 #11
0
    public void UpdateText()
    {
        EntityDef def;
        CardFlair flair;

        if (CraftingManager.Get().GetShownCardInfo(out def, out flair))
        {
            TAG_RARITY   rarity  = def.GetRarity();
            TAG_CARD_SET cardSet = def.GetCardSet();
            if (cardSet == TAG_CARD_SET.CORE)
            {
                this.m_rarityLabel.Text = string.Empty;
            }
            else
            {
                this.m_rarityLabel.Text = GameStrings.GetRarityText(rarity);
            }
            this.AssignRarityColors(rarity, cardSet);
            this.m_rarityGem.SetRarityGem(rarity, cardSet);
            this.m_setName.Text = GameStrings.GetCardSetName(cardSet);
            object[] args = new object[] { def.GetArtistName() };
            this.m_artistName.Text = GameStrings.Format("GLUE_COLLECTION_ARTIST", args);
            string             str       = "<color=#000000ff>" + def.GetFlavorText() + "</color>";
            NetCache.CardValue cardValue = CraftingManager.Get().GetCardValue(def.GetCardId(), flair.Premium);
            if ((cardValue != null) && cardValue.Nerfed)
            {
                if (!string.IsNullOrEmpty(str))
                {
                    str = str + "\n\n";
                }
                str = str + GameStrings.Get("GLUE_COLLECTION_RECENTLY_NERFED");
            }
            this.m_flavorText.Text = str;
        }
    }
 private void CheckForCardOpened(BnetGameAccount oldPlayerAccount, BnetGameAccount newPlayerAccount, BnetPlayer newPlayer)
 {
     if (newPlayerAccount.GetCardsOpened() != oldPlayerAccount.GetCardsOpened())
     {
         string cardsOpened = newPlayerAccount.GetCardsOpened();
         if (!string.IsNullOrEmpty(cardsOpened))
         {
             char[]   separator = new char[] { ',' };
             string[] strArray  = cardsOpened.Split(separator);
             if (strArray.Length == 2)
             {
                 EntityDef entityDef = DefLoader.Get().GetEntityDef(strArray[0]);
                 if (entityDef != null)
                 {
                     if (strArray[1] == "1")
                     {
                         object[] args = new object[] { "5ecaf0ff", newPlayer.GetBestName(), entityDef.GetName(), "ffd200" };
                         this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_GOLDEN_LEGENDARY", args));
                     }
                     else
                     {
                         object[] objArray2 = new object[] { "5ecaf0ff", newPlayer.GetBestName(), entityDef.GetName(), "ff9c00" };
                         this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_LEGENDARY", objArray2));
                     }
                 }
             }
         }
     }
 }
    public void MedalOver(UIEvent e)
    {
        string bodytext = string.Empty;
        bool   flag     = SceneMgr.Get().IsModeRequested(SceneMgr.Mode.HUB);

        if (Options.Get().GetBool(Option.IN_RANKED_PLAY_MODE) || flag)
        {
            string rankPercentile = SeasonEndDialog.GetRankPercentile(this.m_medal.GetCurrentMedal().rank);
            if (this.m_medal.GetCurrentMedal().rank == 0)
            {
                bodytext = GameStrings.Format("GLOBAL_MEDAL_TOOLTIP_BODY_LEGEND", new object[0]);
            }
            else if (rankPercentile.Length > 0)
            {
                object[] args = new object[] { rankPercentile, this.m_medal.GetCurrentMedal().nextMedalName };
                bodytext = GameStrings.Format("GLOBAL_MEDAL_TOURNAMENT_TOOLTIP_BODY", args);
            }
            else
            {
                object[] objArray2 = new object[] { this.m_medal.GetCurrentMedal().nextMedalName };
                bodytext = GameStrings.Format("GLOBAL_MEDAL_TOOLTIP_BODY", objArray2);
            }
        }
        base.gameObject.GetComponent <TooltipZone>().ShowLayerTooltip(this.m_medal.GetCurrentMedal().name, bodytext);
    }
    protected override void ShowReward(bool updateCacheValues)
    {
        string headline = string.Empty;
        string details  = string.Empty;
        string source   = string.Empty;

        if (base.Data.Origin == NetCache.ProfileNotice.NoticeOrigin.OUT_OF_BAND_LICENSE)
        {
            ForgeTicketRewardData data = base.Data as ForgeTicketRewardData;
            headline = GameStrings.Get("GLOBAL_REWARD_FORGE_HEADLINE");
            object[] objArray1 = new object[] { data.Quantity };
            source = GameStrings.Format("GLOBAL_REWARD_BOOSTER_DETAILS_OUT_OF_BAND", objArray1);
        }
        else
        {
            headline = GameStrings.Get("GLOBAL_REWARD_FORGE_UNLOCKED_HEADLINE");
            source   = GameStrings.Get("GLOBAL_REWARD_FORGE_UNLOCKED_SOURCE");
        }
        base.SetRewardText(headline, details, source);
        base.m_root.SetActive(true);
        this.m_rotateParent.transform.localEulerAngles = new Vector3(0f, 0f, 180f);
        object[]  args      = new object[] { "amount", new Vector3(0f, 0f, 540f), "time", 1.5f, "easeType", iTween.EaseType.easeOutElastic, "space", Space.Self };
        Hashtable hashtable = iTween.Hash(args);

        iTween.RotateAdd(this.m_rotateParent, hashtable);
    }
    public void UpdateVisuals(int totalNumCards)
    {
        this.m_numCardsText.Text = this.m_numCards.ToString();
        this.m_amountText.Text   = this.m_amount.ToString();
        if (this.m_numGoldText != null)
        {
            if (this.m_numGoldCards > 0)
            {
                this.m_numGoldText.gameObject.SetActive(true);
                object[] args = new object[] { this.m_numGoldCards.ToString() };
                this.m_numGoldText.Text = GameStrings.Format("GLUE_MASS_DISENCHANT_NUM_GOLDEN_CARDS", args);
                TransformUtil.SetLocalPosX(this.m_numCardsText, 7.638979f);
                this.m_barFrameMesh.GetComponent <MeshFilter>().mesh = MassDisenchant.Get().m_rarityBarGoldMesh;
                this.m_barFrameMesh.material = MassDisenchant.Get().m_rarityBarGoldMaterial;
            }
            else
            {
                this.m_numGoldText.gameObject.SetActive(false);
                TransformUtil.SetLocalPosX(this.m_numCardsText, 2.902672f);
                this.m_barFrameMesh.GetComponent <MeshFilter>().mesh = MassDisenchant.Get().m_rarityBarNormalMesh;
                this.m_barFrameMesh.material = MassDisenchant.Get().m_rarityBarNormalMaterial;
            }
        }
        float num = (totalNumCards <= 0f) ? 0f : (((float)this.m_numCards) / ((float)totalNumCards));

        this.m_amountBar.GetComponent <Renderer>().material.SetFloat("_Percent", num);
    }
 protected override void OnDataSet(bool updateVisuals)
 {
     if (updateVisuals)
     {
         this.m_BoosterPackBone.gameObject.SetActive(false);
         BoosterPackRewardData data = base.Data as BoosterPackRewardData;
         string headline            = string.Empty;
         string details             = string.Empty;
         string source = string.Empty;
         if (base.Data.Origin == NetCache.ProfileNotice.NoticeOrigin.OUT_OF_BAND_LICENSE)
         {
             headline = GameStrings.Get("GLOBAL_REWARD_BOOSTER_HEADLINE_OUT_OF_BAND");
             object[] args = new object[] { data.Count };
             source = GameStrings.Format("GLOBAL_REWARD_BOOSTER_DETAILS_OUT_OF_BAND", args);
         }
         else if (data.Count <= 1)
         {
             string key = "GLOBAL_REWARD_BOOSTER_HEADLINE_GENERIC";
             headline = GameStrings.Get(key);
         }
         else
         {
             object[] objArray2 = new object[] { data.Count };
             headline = GameStrings.Format("GLOBAL_REWARD_BOOSTER_HEADLINE_MULTIPLE", objArray2);
         }
         base.SetRewardText(headline, details, source);
         DbfRecord record = GameDbf.Booster.GetRecord(data.Id);
         if (record != null)
         {
             base.SetReady(false);
             string assetName = record.GetAssetName("PACK_OPENING_PREFAB");
             AssetLoader.Get().LoadActor(assetName, new AssetLoader.GameObjectCallback(this.OnUnopenedPackPrefabLoaded), null, false);
         }
     }
 }
예제 #17
0
 private void InitDisplayedCreator()
 {
     if (base.m_entity != null)
     {
         Entity displayedCreator = base.m_entity.GetDisplayedCreator();
         if (displayedCreator != null)
         {
             GameObject relative = base.m_mainCardActor.FindBone("HistoryCreatedByBone");
             if (relative == null)
             {
                 object[] messageArgs = new object[] { "HistoryCreatedByBone", base.m_mainCardActor };
                 Error.AddDevWarning("Missing Bone", "Missing {0} on {1}", messageArgs);
             }
             else
             {
                 string   name = displayedCreator.GetName();
                 object[] args = new object[] { name };
                 this.m_createdByText.Text             = GameStrings.Format("GAMEPLAY_HISTORY_CREATED_BY", args);
                 this.m_createdByText.transform.parent = base.m_mainCardActor.GetRootObject().transform;
                 this.m_createdByText.gameObject.SetActive(true);
                 TransformUtil.SetPoint(this.m_createdByText, new Vector3(0.5f, 0f, 1f), relative, new Vector3(0.5f, 0f, 0f));
                 this.m_createdByText.gameObject.SetActive(false);
                 this.m_haveDisplayedCreator = true;
             }
         }
     }
 }
    private void MedalOver(UIEvent e)
    {
        float num;

        object[] args     = new object[] { this.m_medal.GetBaseMedalName() };
        string   headline = GameStrings.Format("GLOBAL_MEDAL_TOOLTIP_HEADER", args);
        string   bodytext = string.Empty;

        if (this.m_nextMedal == null)
        {
            bodytext = GameStrings.Get("GLOBAL_MEDAL_TOOLTIP_BODY_ARENA_GRAND_MASTER");
        }
        else
        {
            object[] objArray2 = new object[] { this.m_nextMedal.GetBaseMedalName() };
            bodytext = GameStrings.Format("GLOBAL_MEDAL_TOOLTIP_BODY", objArray2);
        }
        if (SceneMgr.Get().IsInGame())
        {
            num = 0.3f;
        }
        else if (SceneMgr.Get().IsModeRequested(SceneMgr.Mode.HUB))
        {
            num = 6f;
        }
        else
        {
            num = 3f;
        }
        base.gameObject.GetComponent <TooltipZone>().ShowTooltip(headline, bodytext, num, true);
    }
    public void UpdateText()
    {
        string str;
        int    tag = this.m_player.GetTag(GAME_TAG.RESOURCES);

        if (!base.gameObject.activeInHierarchy)
        {
            base.gameObject.SetActive(true);
        }
        int numAvailableResources = this.m_player.GetNumAvailableResources();

        if ((UniversalInputManager.UsePhoneUI != null) && (tag >= 10))
        {
            str = numAvailableResources.ToString();
        }
        else
        {
            object[] args = new object[] { numAvailableResources, tag };
            str = GameStrings.Format("GAMEPLAY_MANA_COUNTER", args);
        }
        this.m_textMesh.Text = str;
        if ((UniversalInputManager.UsePhoneUI != null) && (this.m_availableManaPhone != null))
        {
            this.m_availableManaPhone.Text = numAvailableResources.ToString();
            this.m_permanentManaPhone.Text = tag.ToString();
        }
    }
 public static void OnPlayerChallengeButtonPressed(FriendListChallengeButton challengeButton, BnetPlayer player)
 {
     SoundManager.Get().LoadAndPlay("Small_Click");
     if (ChatMgr.Get().FriendListFrame.IsInEditMode)
     {
         ChatMgr.Get().FriendListFrame.ShowRemoveFriendPopup(player);
     }
     else
     {
         BnetGameAccountId hearthstoneGameAccountId = player.GetHearthstoneGameAccountId();
         SpectatorManager  manager = SpectatorManager.Get();
         if (manager.CanSpectate(player))
         {
             manager.SpectatePlayer(player);
         }
         else if (manager.IsSpectatingMe(hearthstoneGameAccountId))
         {
             AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
                 m_headerText = GameStrings.Get("GLOBAL_SPECTATOR_KICK_PROMPT_HEADER")
             };
             object[] args = new object[] { FriendUtils.GetUniqueName(player) };
             info.m_text             = GameStrings.Format("GLOBAL_SPECTATOR_KICK_PROMPT_TEXT", args);
             info.m_showAlertIcon    = true;
             info.m_responseDisplay  = AlertPopup.ResponseDisplay.CONFIRM_CANCEL;
             info.m_responseCallback = new AlertPopup.ResponseCallback(FriendListFriendFrame.OnKickSpectatorDialogResponse);
             info.m_responseUserData = player;
             DialogManager.Get().ShowPopup(info);
         }
         else if (manager.CanInviteToSpectateMyGame(hearthstoneGameAccountId))
         {
             manager.InviteToSpectateMe(player);
         }
         else if (manager.IsSpectatingPlayer(hearthstoneGameAccountId))
         {
             if ((GameMgr.Get().IsFindingGame() || SceneMgr.Get().IsTransitioning()) || GameMgr.Get().IsTransitionPopupShown())
             {
                 return;
             }
             AlertPopup.PopupInfo info2 = new AlertPopup.PopupInfo {
                 m_headerText       = GameStrings.Get("GLOBAL_SPECTATOR_LEAVE_PROMPT_HEADER"),
                 m_text             = GameStrings.Get("GLOBAL_SPECTATOR_LEAVE_PROMPT_TEXT"),
                 m_showAlertIcon    = true,
                 m_responseDisplay  = AlertPopup.ResponseDisplay.CONFIRM_CANCEL,
                 m_responseCallback = new AlertPopup.ResponseCallback(FriendListFriendFrame.OnLeaveSpectatingDialogResponse)
             };
             DialogManager.Get().ShowPopup(info2);
         }
         else if (!manager.IsInvitedToSpectateMyGame(hearthstoneGameAccountId) && challengeButton.CanChallenge())
         {
             FriendChallengeMgr.Get().SendChallenge(player);
         }
         else
         {
             return;
         }
         challengeButton.UpdateButton();
         ChatMgr.Get().CloseChatUI();
     }
 }
 private void CheckForMageLevelChanged(BnetGameAccount oldPlayerAccount, BnetGameAccount newPlayerAccount, BnetPlayer newPlayer)
 {
     if (this.ShouldToastThisLevel(oldPlayerAccount.GetMageLevel(), newPlayerAccount.GetMageLevel()))
     {
         object[] args = new object[] { "5ecaf0ff", newPlayer.GetBestName(), newPlayerAccount.GetMageLevel() };
         this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_MAGE_LEVEL", args));
     }
 }
    public static void AddFatalLoc(string messageKey, params object[] messageArgs)
    {
        ErrorParams parms = new ErrorParams {
            m_message = GameStrings.Format(messageKey, messageArgs)
        };

        AddFatal(parms);
    }
 private void CheckForMissionComplete(BnetGameAccount oldPlayerAccount, BnetGameAccount newPlayerAccount, BnetPlayer newPlayer)
 {
     if ((newPlayerAccount.GetTutorialBeaten() != oldPlayerAccount.GetTutorialBeaten()) && (newPlayerAccount.GetTutorialBeaten() == 1))
     {
         object[] args = new object[] { "5ecaf0ff", newPlayer.GetBestName() };
         this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_ILLIDAN_COMPLETE", args));
     }
 }
    public void UpdateLockVisual(EntityDef entityDef, CollectionCardVisual.LockType lockType)
    {
        if ((entityDef == null) || (lockType == CollectionCardVisual.LockType.NONE))
        {
            base.gameObject.SetActive(false);
        }
        else
        {
            GameObject allyBg;
            base.gameObject.SetActive(true);
            TAG_CARDTYPE cardType = entityDef.GetCardType();
            this.m_allyBg.SetActive(false);
            this.m_spellBg.SetActive(false);
            this.m_weaponBg.SetActive(false);
            switch (cardType)
            {
            case TAG_CARDTYPE.MINION:
                allyBg = this.m_allyBg;
                this.m_lockPlate.transform.localPosition = this.m_lockPlateBone.transform.localPosition;
                break;

            case TAG_CARDTYPE.SPELL:
                allyBg = this.m_spellBg;
                this.m_lockPlate.transform.localPosition = this.m_lockPlateBone.transform.localPosition;
                break;

            case TAG_CARDTYPE.WEAPON:
                allyBg = this.m_weaponBg;
                this.m_lockPlate.transform.localPosition = this.m_weaponLockPlateBone.transform.localPosition;
                break;

            default:
                allyBg = this.m_spellBg;
                break;
            }
            float num = 0f;
            switch (lockType)
            {
            case CollectionCardVisual.LockType.MAX_COPIES_IN_DECK:
            {
                num = 0f;
                int      num2 = !entityDef.IsElite() ? 2 : 1;
                object[] args = new object[] { num2 };
                this.SetLockText(GameStrings.Format("GLUE_COLLECTION_LOCK_MAX_DECK_COPIES", args));
                break;
            }

            case CollectionCardVisual.LockType.NO_MORE_INSTANCES:
                num = 1f;
                this.SetLockText(GameStrings.Get("GLUE_COLLECTION_LOCK_NO_MORE_INSTANCES"));
                break;
            }
            this.m_lockPlate.GetComponent <Renderer>().material.SetFloat("_Desaturate", num);
            allyBg.GetComponent <Renderer>().material.SetFloat("_Desaturate", num);
            allyBg.SetActive(true);
        }
    }
    public static void AddWarningLoc(string headerKey, string messageKey, params object[] messageArgs)
    {
        ErrorParams parms = new ErrorParams {
            m_header  = GameStrings.Get(headerKey),
            m_message = GameStrings.Format(messageKey, messageArgs)
        };

        AddWarning(parms);
    }
    protected override void OnDataSet(bool updateVisuals)
    {
        if (updateVisuals)
        {
            GoldRewardData data = base.Data as GoldRewardData;
            if (data == null)
            {
                Debug.LogWarning(string.Format("goldRewardData.SetData() - data {0} is not GoldRewardData", base.Data));
            }
            else
            {
                string   headline = GameStrings.Get("GLOBAL_REWARD_GOLD_HEADLINE");
                string   details  = data.Amount.ToString();
                string   source   = string.Empty;
                UberText text     = this.m_coin.GetComponentsInChildren <UberText>(true)[0];
                if (text != null)
                {
                    base.m_rewardBanner.m_detailsText = text;
                    base.m_rewardBanner.AlignHeadlineToCenterBone();
                }
                NetCache.ProfileNotice.NoticeOrigin origin = base.Data.Origin;
                switch (origin)
                {
                case NetCache.ProfileNotice.NoticeOrigin.BETA_REIMBURSE:
                    headline = GameStrings.Get("GLOBAL_BETA_REIMBURSEMENT_HEADLINE");
                    source   = GameStrings.Get("GLOBAL_BETA_REIMBURSEMENT_DETAILS");
                    break;

                case NetCache.ProfileNotice.NoticeOrigin.TOURNEY:
                {
                    NetCache.NetCacheRewardProgress netObject = NetCache.Get().GetNetObject <NetCache.NetCacheRewardProgress>();
                    object[] args = new object[] { netObject.WinsPerGold };
                    source = GameStrings.Format("GLOBAL_REWARD_GOLD_SOURCE_TOURNEY", args);
                    break;
                }

                default:
                    if (origin == NetCache.ProfileNotice.NoticeOrigin.IGR)
                    {
                        if (data.Date.HasValue)
                        {
                            object[] objArray2 = new object[] { data.Date };
                            string   str4      = GameStrings.Format("GLOBAL_CURRENT_DATE", objArray2);
                            object[] objArray3 = new object[] { str4 };
                            source = GameStrings.Format("GLOBAL_REWARD_GOLD_SOURCE_IGR_DATED", objArray3);
                        }
                        else
                        {
                            source = GameStrings.Get("GLOBAL_REWARD_GOLD_SOURCE_IGR");
                        }
                    }
                    break;
                }
                base.SetRewardText(headline, details, source);
            }
        }
    }
예제 #27
0
 private void OnCancelButtonPressed(UIEvent e)
 {
     AlertPopup.PopupInfo info = new AlertPopup.PopupInfo();
     object[]             args = new object[] { this.m_recruitInfo.Nickname };
     info.m_text             = GameStrings.Format("GLOBAL_FRIENDLIST_CANCEL_RECRUIT_ALERT_MESSAGE", args);
     info.m_showAlertIcon    = true;
     info.m_responseDisplay  = AlertPopup.ResponseDisplay.CONFIRM_CANCEL;
     info.m_responseCallback = new AlertPopup.ResponseCallback(this.OnCancelPopupResponse);
     DialogManager.Get().ShowPopup(info, new DialogManager.DialogProcessCallback(this.OnCancelShown));
 }
예제 #28
0
 private void ShowAlertPopup(string msgGameStringKey)
 {
     AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
         m_text             = GameStrings.Format(msgGameStringKey, new object[0]),
         m_showAlertIcon    = true,
         m_responseDisplay  = AlertPopup.ResponseDisplay.OK,
         m_responseCallback = null
     };
     DialogManager.Get().ShowPopup(info);
 }
예제 #29
0
    public bool ShowDisconnectedGameResult(NetCache.ProfileNoticeDisconnectedGame dcGame)
    {
        object[]             objArray1;
        AlertPopup.PopupInfo info;
        string str;

        if (GameUtils.IsMatchmadeGameType(dcGame.GameType))
        {
            switch (dcGame.GameResult)
            {
            case ProfileNoticeDisconnectedGameResult.GameResult.GR_WINNER:
            case ProfileNoticeDisconnectedGameResult.GameResult.GR_TIE:
                if (dcGame.GameType != GameType.GT_UNKNOWN)
                {
                    info = new AlertPopup.PopupInfo {
                        m_headerText = GameStrings.Get("GLUE_RECONNECT_RESULT_HEADER")
                    };
                    str = null;
                    if (dcGame.GameResult == ProfileNoticeDisconnectedGameResult.GameResult.GR_TIE)
                    {
                        str = "GLUE_RECONNECT_RESULT_TIE";
                        goto Label_00EA;
                    }
                    switch (dcGame.YourResult)
                    {
                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_WON:
                        str = "GLUE_RECONNECT_RESULT_WIN";
                        goto Label_00EA;

                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_LOST:
                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_QUIT:
                        str = "GLUE_RECONNECT_RESULT_LOSE";
                        goto Label_00EA;

                    case ProfileNoticeDisconnectedGameResult.PlayerResult.PR_DISCONNECTED:
                        str = "GLUE_RECONNECT_RESULT_DISCONNECT";
                        goto Label_00EA;
                    }
                    Debug.LogError(string.Format("ReconnectMgr.ShowDisconnectedGameResult() - unhandled player result {0}", dcGame.YourResult));
                }
                return(false);
            }
            Debug.LogError(string.Format("ReconnectMgr.ShowDisconnectedGameResult() - unhandled game result {0}", dcGame.GameResult));
        }
        return(false);

Label_00EA:
        objArray1              = new object[] { this.GetGameTypeName(dcGame.GameType, dcGame.MissionId) };
        info.m_text            = GameStrings.Format(str, objArray1);
        info.m_responseDisplay = AlertPopup.ResponseDisplay.OK;
        info.m_showAlertIcon   = true;
        DialogManager.Get().ShowPopup(info);
        return(true);
    }
예제 #30
0
 private void UpdateNewItemCountVisuals()
 {
     if (this.m_newItemCountText != null)
     {
         object[] args = new object[] { this.m_numNewItems };
         this.m_newItemCountText.Text = GameStrings.Format("GLUE_COLLECTION_NEW_CARD_CALLOUT", args);
     }
     if (this.m_newItemCount != null)
     {
         this.m_newItemCount.SetActive(this.m_numNewItems > 0);
     }
 }