public TranslatedMedalInfo Translate(NetCache.NetCacheMedalInfo medalInfo)
    {
        TranslatedMedalInfo info = new TranslatedMedalInfo();

        if (medalInfo != null)
        {
            info.rank        = 0x1a - medalInfo.StarLevel;
            info.bestRank    = 0x1a - medalInfo.BestStarLevel;
            info.legendIndex = medalInfo.LegendIndex;
            info.totalStars  = medalInfo.GainLevelStars - medalInfo.StartStars;
            info.earnedStars = medalInfo.Stars;
            if (medalInfo.StarLevel != 1)
            {
                info.earnedStars -= medalInfo.StartStars - 1;
            }
            info.winStreak    = medalInfo.Streak;
            info.textureName  = "Medal_Ranked_" + info.rank;
            info.name         = GameStrings.Get("GLOBAL_MEDAL_" + info.rank);
            info.canLoseStars = medalInfo.CanLoseStars;
            info.canLoseLevel = medalInfo.CanLoseLevel;
            string key  = "GLOBAL_MEDAL_" + (info.rank - 1);
            string str2 = GameStrings.Get(key);
            if (str2 != key)
            {
                info.nextMedalName = str2;
                return(info);
            }
            info.nextMedalName = string.Empty;
        }
        return(info);
    }
예제 #2
0
 private void ShowReconnectingDialog()
 {
     AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
         m_headerText = GameStrings.Get("GLOBAL_RECONNECT_RECONNECTING_HEADER")
     };
     if (this.m_reconnectType == ReconnectType.LOGIN)
     {
         info.m_text = GameStrings.Get("GLOBAL_RECONNECT_RECONNECTING_LOGIN");
     }
     else
     {
         info.m_text = GameStrings.Get("GLOBAL_RECONNECT_RECONNECTING");
     }
     if (ApplicationMgr.CanQuitGame != null)
     {
         info.m_responseDisplay = AlertPopup.ResponseDisplay.CANCEL;
         info.m_cancelText      = GameStrings.Get("GLOBAL_RECONNECT_EXIT_BUTTON");
     }
     else
     {
         info.m_responseDisplay = AlertPopup.ResponseDisplay.NONE;
     }
     info.m_showAlertIcon    = true;
     info.m_responseCallback = new AlertPopup.ResponseCallback(this.OnReconnectingDialogResponse);
     DialogManager.Get().ShowPopup(info, new DialogManager.DialogProcessCallback(this.OnReconnectingDialogProcessed));
 }
 public void SetMoneyValue(Network.Bundle bundle, string quantityText)
 {
     if ((bundle != null) && !StoreManager.Get().IsProductAlreadyOwned(bundle))
     {
         if (this.m_fullText != null)
         {
             this.m_quantityText.gameObject.SetActive(true);
             this.m_costText.gameObject.SetActive(true);
             this.m_fullText.gameObject.SetActive(false);
         }
         this.m_costText.Text          = StoreManager.Get().FormatCostBundle(bundle);
         this.m_costText.TextColor     = this.m_moneyCostTextColor;
         this.m_quantityText.Text      = quantityText;
         this.m_quantityText.TextColor = this.m_moneyQuantityTextColor;
     }
     else
     {
         this.m_costText.Text = string.Empty;
         UberText fullText = this.m_quantityText;
         if (this.m_fullText != null)
         {
             this.m_quantityText.gameObject.SetActive(false);
             this.m_costText.gameObject.SetActive(false);
             this.m_fullText.gameObject.SetActive(true);
             fullText = this.m_fullText;
         }
         fullText.Text = GameStrings.Get("GLUE_STORE_PACK_BUTTON_TEXT_PURCHASED");
     }
     this.m_isGold = false;
     this.UpdateButtonState();
 }
 private void Awake()
 {
     s_instance              = this;
     this.m_MyTurnText.Text  = GameStrings.Get("GAMEPLAY_END_TURN");
     this.m_WaitingText.Text = string.Empty;
     base.GetComponent <Collider>().enabled = false;
 }
    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);
    }
예제 #6
0
    private void OnFrameMouseOver(UIEvent e)
    {
        string key  = string.Empty;
        string str2 = string.Empty;

        switch (this.m_showingCurrency)
        {
        case CurrencyType.GOLD:
            key  = "GLUE_TOOLTIP_GOLD_HEADER";
            str2 = "GLUE_TOOLTIP_GOLD_DESCRIPTION";
            break;

        case CurrencyType.ARCANE_DUST:
            key  = "GLUE_CRAFTING_ARCANEDUST";
            str2 = "GLUE_CRAFTING_ARCANEDUST_DESCRIPTION";
            break;
        }
        if (key != string.Empty)
        {
            KeywordHelpPanel panel = base.GetComponent <TooltipZone>().ShowTooltip(GameStrings.Get(key), GameStrings.Get(str2), 0.7f, true);
            SceneUtils.SetLayer(panel.gameObject, GameLayer.BattleNet);
            panel.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
            panel.transform.localScale       = new Vector3(70f, 70f, 70f);
            if (UniversalInputManager.UsePhoneUI != null)
            {
                TransformUtil.SetPoint((Component)panel, Anchor.TOP, (Component)this.m_mouseOverZone, Anchor.BOTTOM, Vector3.zero);
            }
            else
            {
                TransformUtil.SetPoint((Component)panel, Anchor.BOTTOM, (Component)this.m_mouseOverZone, Anchor.TOP, Vector3.zero);
            }
        }
    }
예제 #7
0
 protected void UpdateOnlineStatus()
 {
     if (this.m_player.IsAway())
     {
         this.m_StatusText.Text = FriendUtils.GetAwayTimeString(this.m_player.GetBestAwayTimeMicrosec());
     }
     else if (this.m_player.IsBusy())
     {
         this.m_StatusText.Text = GameStrings.Get("GLOBAL_FRIENDLIST_BUSYSTATUS");
     }
     else
     {
         string statusText = PresenceMgr.Get().GetStatusText(this.m_player);
         if (statusText != null)
         {
             this.m_StatusText.Text = statusText;
         }
         else
         {
             BnetProgramId bestProgramId = this.m_player.GetBestProgramId();
             if (bestProgramId != null)
             {
                 this.m_StatusText.Text = BnetProgramId.GetName(bestProgramId);
             }
             else
             {
                 this.m_StatusText.Text = string.Empty;
             }
         }
     }
 }
예제 #8
0
 protected void ContinueButtonPress_FirstTimeHub(UIEvent e)
 {
     if (base.HasShownScoops())
     {
         base.HideTwoScoop();
         if (base.ShowNextReward())
         {
             SoundManager.Get().LoadAndPlay("VO_INNKEEPER_TUT_COMPLETE_05");
         }
         else if (!base.ShowNextCompletedQuest())
         {
             base.ContinueButtonPress_Common();
             base.m_hitbox.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.ContinueButtonPress_FirstTimeHub));
             if (Network.ShouldBeConnectedToAurora())
             {
                 base.BackToMode(SceneMgr.Mode.HUB);
             }
             else
             {
                 Notification component = AssetLoader.Get().LoadActor("TutorialIntroDialog", true, false).GetComponent <Notification>();
                 NotificationManager.Get().CreatePopupDialogFromObject(component, GameStrings.Get("GLOBAL_MEDAL_REWARD_CONGRATULATIONS"), GameStrings.Get("TUTORIAL_MOBILE_COMPLETE_CONGRATS"), GameStrings.Get("GLOBAL_OKAY"));
                 component.ButtonStart.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.UserPressedStartButton));
                 component.artOverlay.material = component.swapMaterial;
                 component.artOverlay.material.mainTextureOffset = new Vector2(0.5f, 0f);
                 base.m_hitbox.gameObject.SetActive(false);
                 base.m_continueText.gameObject.SetActive(false);
             }
         }
     }
 }
 protected override void Awake()
 {
     base.Awake();
     this.m_lockedText.Text = GameStrings.Get("GLUE_QUEST_LOG_CLASS_LOCKED");
     this.AddEventListener(UIEventType.ROLLOVER, new UIEvent.Handler(this.OnProgressBarOver));
     this.AddEventListener(UIEventType.ROLLOUT, new UIEvent.Handler(this.OnProgressBarOut));
 }
 private void Awake()
 {
     s_instance = this;
     AssetLoader.Get().LoadActor((UniversalInputManager.UsePhoneUI == null) ? "DeckPickerTray" : "DeckPickerTray_phone", delegate(string name, GameObject go, object data) {
         if (go == null)
         {
             Debug.LogError("Unable to load DeckPickerTray.");
         }
         else
         {
             this.m_deckPickerTray = go.GetComponent <DeckPickerTrayDisplay>();
             if (this.m_deckPickerTray == null)
             {
                 Debug.LogError("DeckPickerTrayDisplay component not found in DeckPickerTray object.");
             }
             else
             {
                 GameUtils.SetParent(this.m_deckPickerTray, this.m_deckPickerTrayContainer, false);
                 this.m_deckPickerTray.SetHeaderText(GameStrings.Get(!FriendChallengeMgr.Get().IsChallengeTavernBrawl() ? "GLOBAL_FRIEND_CHALLENGE_TITLE" : "GLOBAL_TAVERN_BRAWL"));
                 this.m_deckPickerTray.Init();
                 this.DisableOtherModeStuff();
                 NetCache.Get().RegisterScreenFriendly(new NetCache.NetCacheCallback(this.OnNetCacheReady));
                 MusicManager.Get().StartPlaylist(!FriendChallengeMgr.Get().IsChallengeTavernBrawl() ? MusicPlaylistType.UI_Friendly : MusicPlaylistType.UI_TavernBrawl);
             }
         }
     }, null, false);
 }
예제 #11
0
    public override string CustomChoiceBannerText()
    {
        if (((TAG_STEP)base.GetTag <TAG_STEP>(GAME_TAG.STEP)) == TAG_STEP.MAIN_START)
        {
            string key = null;
            switch (this.m_mostRecentMissionEvent)
            {
            case 10:
                key = "MISSION_GLOWING_POOL";
                break;

            case 11:
                key = "MISSION_PIT_OF_SPIKES";
                break;

            case 12:
                key = "MISSION_TAKE_THE_SHORTCUT";
                break;

            case 4:
                key = "MISSION_STATUES_EYE";
                break;
            }
            if (key != null)
            {
                return(GameStrings.Get(key));
            }
        }
        return(null);
    }
예제 #12
0
    public UBattleTower BindTower(int prefabNameId, int prefabFolderId, bool forceBind)
    {
        var prefabName   = GameStrings.Get(prefabNameId);
        var prefabFolder = GameStrings.Get(prefabFolderId);

        return(BindTower(prefabName, prefabFolder, forceBind));
    }
예제 #13
0
 private void Awake()
 {
     s_instance = this;
     this.InitMissionRecords();
     foreach (Transform transform in base.gameObject.GetComponents <Transform>())
     {
         transform.gameObject.SetActive(false);
     }
     base.gameObject.SetActive(true);
     if (this.m_backButton != null)
     {
         this.m_backButton.SetText(GameStrings.Get("GLOBAL_BACK"));
         this.m_backButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.BackButtonReleased));
     }
     this.m_trayLabel.Text = GameStrings.Get("GLUE_CHOOSE_OPPONENT");
     this.m_playButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.PlayGameButtonRelease));
     this.m_heroDefsToLoad = this.m_sortedMissionRecords.Count;
     foreach (DbfRecord record in this.m_sortedMissionRecords)
     {
         string missionHeroCardId = GameUtils.GetMissionHeroCardId(record.GetId());
         DefLoader.Get().LoadFullDef(missionHeroCardId, new DefLoader.LoadDefCallback <FullDef>(this.OnFullDefLoaded));
     }
     SoundManager.Get().Load("choose_opponent_panel_slide_on");
     SoundManager.Get().Load("choose_opponent_panel_slide_off");
     this.SetupHeroAchieves();
     base.StartCoroutine(this.NotifyWhenTrayLoaded());
     GameMgr.Get().RegisterFindGameEvent(new GameMgr.FindGameCallback(this.OnFindGameEvent));
 }
예제 #14
0
    private static bool GetChoicesByCost(CostRequirement costRequirement, int numChoicesRequired, RDM_Deck currentDeck, Map <int, List <RDMDeckEntry> > deckCardsByManaCost, ref RandomDeckChoices returnChoices)
    {
        int costFilterValue      = costRequirement.m_costFilterValue;
        List <RDMDeckEntry> list = !deckCardsByManaCost.ContainsKey(costFilterValue) ? null : deckCardsByManaCost[costFilterValue];
        int num2 = (list != null) ? list.Count : 0;

        if (num2 < costRequirement.m_minNumCards)
        {
            returnChoices.Clear();
            returnChoices.displayString = GameStrings.Get(costRequirement.m_displayStringKey);
            CollectionFilterSet cardsIOwnFilterSet = GetCardsIOwnFilterSet();
            cardsIOwnFilterSet.AddGameFilter(GAME_TAG.COST, costFilterValue, costRequirement.m_costFilterFunc);
            cardsIOwnFilterSet.AddGameFilter(GAME_TAG.CARDTYPE, TAG_CARDTYPE.HERO, CollectionFilterFunc.NOT_EQUAL);
            List <FilteredArtStack> newChoiceOptions = cardsIOwnFilterSet.GenerateList();
            for (int i = 0; i < numChoicesRequired; i++)
            {
                RDMDeckEntry item = GetValidChoiceForDeck(newChoiceOptions, returnChoices.choices, currentDeck);
                if (item != null)
                {
                    returnChoices.choices.Add(item);
                }
            }
            if (returnChoices.choices.Count >= numChoicesRequired)
            {
                return(true);
            }
            returnChoices.Clear();
        }
        return(false);
    }
 private void Awake()
 {
     s_instance         = this;
     this.m_fakeCards   = new List <Actor>();
     this.m_creditsDefs = new List <FullDef>();
     this.creditsRootStartLocalPosition  = this.m_creditsRoot.transform.localPosition;
     this.creditsText1StartLocalPosition = this.m_creditsText1.transform.localPosition;
     this.creditsText2StartLocalPosition = this.m_creditsText2.transform.localPosition;
     this.m_doneButton.SetText(GameStrings.Get("GLOBAL_BACK"));
     this.m_doneButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnDonePressed));
     this.m_yearButton.SetText(!this.m_displayingLatestYear ? "2015" : "2014");
     this.m_yearButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnYearPressed));
     if (UniversalInputManager.UsePhoneUI != null)
     {
         Box.Get().m_tableTop.SetActive(false);
         Box.Get().m_letterboxingContainer.SetActive(false);
         this.m_doneButton.SetText(string.Empty);
         this.m_doneArrowInButton.SetActive(true);
     }
     AssetLoader.Get().LoadActor("Card_Hand_Ally", new AssetLoader.GameObjectCallback(this.ActorLoadedCallback), null, false);
     AssetLoader.Get().LoadActor("Card_Hand_Ally", new AssetLoader.GameObjectCallback(this.ActorLoadedCallback), null, false);
     this.LoadAllCreditsCards();
     this.LoadCreditsText();
     Navigation.Push(new Navigation.NavigateBackHandler(this.EndCredits));
 }
예제 #16
0
    // contentFlag 0数字  1GameString
    public static void SetText(int cacheId, int index, int content, int contentFlag = 0)
    {
        var text = ObjectCache.GetComponent <Text>(cacheId, index);

        if (text == null)
        {
            return;
        }
        var str = string.Empty;

        switch (contentFlag)
        {
        case 0:
        {
            using (zstring.Block())
            {
                str = zstring.Format("{0}", content).Intern();
            }
        }
        break;

        case 1:
        {
            str = GameStrings.Get(content);
        }
        break;
        }
        text.text = str;
    }
    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);
    }
    private void SetUpBuyWithGoldButton()
    {
        string text = string.Empty;
        NoGTAPPTransactionData noGTAPPTransactionData = new NoGTAPPTransactionData {
            Product     = ProductType.PRODUCT_TYPE_DRAFT,
            ProductData = 0,
            Quantity    = 1
        };
        long goldCostNoGTAPP = StoreManager.Get().GetGoldCostNoGTAPP(noGTAPPTransactionData);

        if (goldCostNoGTAPP > 0L)
        {
            this.m_goldTransactionData = noGTAPPTransactionData;
            text = goldCostNoGTAPP.ToString();
            NetCache.NetCacheGoldBalance netObject = NetCache.Get().GetNetObject <NetCache.NetCacheGoldBalance>();
            this.UpdateGoldButtonState(netObject);
        }
        else
        {
            Debug.LogWarning("ForgeStore.SetUpBuyWithGoldButton(): no gold price for purchase Arena without GTAPP");
            text = GameStrings.Get("GLUE_STORE_PRODUCT_PRICE_NA");
            base.SetGoldButtonState(Store.BuyButtonState.DISABLED);
        }
        base.m_buyWithGoldButton.SetText(text);
    }
예제 #19
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;
        }
    }
 protected override void Awake()
 {
     s_instance = this;
     base.m_destroyOnSceneLoad = false;
     base.Awake();
     this.m_backButton.SetText(GameStrings.Get("GLOBAL_BACK"));
 }
예제 #21
0
    public void SetRank(int rank)
    {
        Log.EndOfGame.Print("setting chest to rank " + rank, new object[0]);
        ChestVisual chestVisualFromRank = this.GetChestVisualFromRank(rank);

        this.m_baseMeshFilter.mesh       = chestVisualFromRank.m_chestMesh;
        this.m_baseMeshRenderer.material = chestVisualFromRank.m_chestMaterial;
        if (this.m_glowMeshRenderer != null)
        {
            this.m_glowMeshRenderer.material = chestVisualFromRank.m_glowMaterial;
        }
        if (rank == 0)
        {
            this.m_legendaryGem.SetActive(true);
            this.m_rankNumber.gameObject.SetActive(false);
        }
        else
        {
            this.m_legendaryGem.SetActive(false);
            this.m_rankNumber.gameObject.SetActive(true);
        }
        this.m_rankNumber.gameObject.SetActive(true);
        this.m_rankNumber.Text = rank.ToString();
        this.m_rankBanner.Text = GameStrings.Get(chestVisualFromRank.chestName);
    }
예제 #22
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);
     }
 }
    private void Awake()
    {
        GameObject obj2 = AssetLoader.Get().LoadActor((UniversalInputManager.UsePhoneUI == null) ? "DeckPickerTray" : "DeckPickerTray_phone", false, false);

        if (obj2 == null)
        {
            Debug.LogError("Unable to load DeckPickerTray.");
        }
        else
        {
            this.m_deckPickerTray = obj2.GetComponent <DeckPickerTrayDisplay>();
            if (this.m_deckPickerTray == null)
            {
                Debug.LogError("DeckPickerTrayDisplay component not found in DeckPickerTray object.");
            }
            else
            {
                if (this.m_deckPickerTrayContainer != null)
                {
                    GameUtils.SetParent(this.m_deckPickerTray, this.m_deckPickerTrayContainer, false);
                }
                this.m_deckPickerTray.AddDeckTrayLoadedListener(new DeckPickerTrayDisplay.DeckTrayLoaded(this.OnTrayLoaded));
                this.m_deckPickerTray.Init();
                this.m_deckPickerTray.SetPlayButtonText(GameStrings.Get("GLOBAL_PLAY"));
                AdventureConfig   config            = AdventureConfig.Get();
                AdventureDbId     selectedAdventure = config.GetSelectedAdventure();
                AdventureModeDbId selectedMode      = config.GetSelectedMode();
                string            locString         = GameUtils.GetAdventureDataRecord((int)selectedAdventure, (int)selectedMode).GetLocString("NAME");
                this.m_deckPickerTray.SetHeaderText(locString);
            }
        }
    }
예제 #24
0
    private void BnetParty_OnPartyAttributeChanged_DeclineReason(PartyInfo party, string attributeKey, bnet.protocol.attribute.Variant value)
    {
        if (((party.Type == PartyType.FRIENDLY_CHALLENGE) && this.DidSendChallenge()) && value.HasIntValue)
        {
            DeclineReason intValue = (DeclineReason)((int)value.IntValue);
            string        key      = null;
            switch (intValue)
            {
            case DeclineReason.NoValidDeck:
                key = "GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_RECIPIENT_NO_VALID_DECK_SENDER";
                break;

            case DeclineReason.NotUnlocked:
                key = "GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_RECIPIENT_NOT_UNLOCKED_SENDER";
                break;
            }
            if (key != null)
            {
                this.m_hasSeenDeclinedReason = true;
                AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
                    m_headerText      = GameStrings.Get("GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_HEADER"),
                    m_text            = GameStrings.Get(key),
                    m_responseDisplay = AlertPopup.ResponseDisplay.OK
                };
                DialogManager.Get().ShowPopup(info);
            }
        }
    }
예제 #25
0
    private string GetGameTypeName(GameType gameType, int missionId)
    {
        DbfRecord adventureRecord = GameUtils.GetAdventureRecord(missionId);

        if (adventureRecord == null)
        {
            string str;
            if (this.m_gameTypeNameKeys.TryGetValue(gameType, out str))
            {
                return(GameStrings.Get(str));
            }
            object[] messageArgs = new object[] { missionId, gameType };
            Error.AddDevFatal("ReconnectMgr.GetGameTypeName() - no name for mission {0} gameType {1}", messageArgs);
            return(string.Empty);
        }
        switch (adventureRecord.GetInt("ID"))
        {
        case 1:
            return(GameStrings.Get("GLUE_RECONNECT_GAME_TYPE_TUTORIAL"));

        case 2:
            return(GameStrings.Get("GLUE_RECONNECT_GAME_TYPE_PRACTICE"));

        case 3:
            return(GameStrings.Get("GLUE_RECONNECT_GAME_TYPE_NAXXRAMAS"));

        case 4:
            return(GameStrings.Get("GLUE_RECONNECT_GAME_TYPE_BRM"));

        case 7:
            return(GameStrings.Get("GLUE_RECONNECT_GAME_TYPE_TAVERN_BRAWL"));
        }
        return(adventureRecord.GetLocString("NAME"));
    }
 private void HandleLastFatalBnetError()
 {
     if (this.m_lastFatalBnetErrorInfo != null)
     {
         if (this.m_handleLastFatalBnetErrorNow)
         {
             Network.Get().OnFatalBnetError(this.m_lastFatalBnetErrorInfo);
             this.m_handleLastFatalBnetErrorNow = false;
         }
         else
         {
             string key = (ApplicationMgr.AllowResetFromFatalError == null) ? "GAMEPLAY_DISCONNECT_BODY" : "GAMEPLAY_DISCONNECT_BODY_RESET";
             if (GameMgr.Get().IsSpectator())
             {
                 key = (ApplicationMgr.AllowResetFromFatalError == null) ? "GAMEPLAY_SPECTATOR_DISCONNECT_BODY" : "GAMEPLAY_SPECTATOR_DISCONNECT_BODY_RESET";
             }
             AlertPopup.PopupInfo info = new AlertPopup.PopupInfo {
                 m_headerText       = GameStrings.Get("GAMEPLAY_DISCONNECT_HEADER"),
                 m_text             = GameStrings.Get(key),
                 m_showAlertIcon    = true,
                 m_responseDisplay  = AlertPopup.ResponseDisplay.OK,
                 m_responseCallback = new AlertPopup.ResponseCallback(this.OnBnetErrorResponse)
             };
             DialogManager.Get().ShowPopup(info);
         }
         this.m_lastFatalBnetErrorInfo = null;
     }
 }
 private void Awake()
 {
     s_Instance = this;
     this.m_headlineText.Text        = GameStrings.Get("GLUE_MASS_DISENCHANT_HEADLINE");
     this.m_detailsHeadlineText.Text = GameStrings.Get("GLUE_MASS_DISENCHANT_DETAILS_HEADLINE");
     this.m_disenchantButton.SetText(GameStrings.Get("GLUE_MASS_DISENCHANT_BUTTON_TEXT"));
     if (this.m_detailsText != null)
     {
         this.m_detailsText.Text = GameStrings.Get("GLUE_MASS_DISENCHANT_DETAILS");
     }
     if (this.m_singleSubHeadlineText != null)
     {
         this.m_singleSubHeadlineText.Text = GameStrings.Get("GLUE_MASS_DISENCHANT_SUB_HEADLINE_TEXT");
     }
     if (this.m_doubleSubHeadlineText != null)
     {
         this.m_doubleSubHeadlineText.Text = GameStrings.Get("GLUE_MASS_DISENCHANT_SUB_HEADLINE_TEXT");
     }
     this.m_disenchantButton.SetUserOverYOffset(-0.04409015f);
     foreach (DisenchantBar bar in this.m_singleDisenchantBars)
     {
         bar.Init();
     }
     foreach (DisenchantBar bar2 in this.m_doubleDisenchantBars)
     {
         bar2.Init();
     }
     CollectionManager.Get().RegisterMassDisenchantListener(new CollectionManager.OnMassDisenchant(this.OnMassDisenchant));
 }
 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);
         }
     }
 }
예제 #29
0
 private void InitMoneyOption(Network.Bundle bundle)
 {
     this.m_goldRoot.SetActive(false);
     this.m_realMoneyTextRoot.SetActive(true);
     this.m_bonusFrame.SetActive(false);
     this.m_cost.Text = string.Format(GameStrings.Get("GLUE_STORE_PRODUCT_PRICE"), StoreManager.Get().FormatCostBundle(bundle));
 }
 private bool SwitchToEditDeckMode(CollectionDeck deck)
 {
     if ((CollectionManagerDisplay.Get() == null) || (deck == null))
     {
         return(false);
     }
     this.m_tavernBrawlTray.HideTray();
     this.UpdateDeckPanels(true, true);
     if (UniversalInputManager.UsePhoneUI == null)
     {
         this.m_editDeckButton.gameObject.SetActive(TavernBrawlManager.Get().CurrentMission().canEditDeck);
         this.m_editDeckButton.SetText(GameStrings.Get("GLUE_COLLECTION_DECK_DELETE"));
         if (this.m_editIcon != null)
         {
             this.m_editIcon.SetActive(false);
         }
         if (this.m_deleteIcon != null)
         {
             this.m_deleteIcon.SetActive(true);
         }
         this.m_editDeckHighlight.ChangeState(ActorStateType.HIGHLIGHT_OFF);
     }
     this.m_deckBeingEdited = deck.ID;
     BnetBar.Get().m_currencyFrame.RefreshContents();
     CollectionDeckTray.Get().EnterEditDeckModeForTavernBrawl();
     FriendChallengeMgr.Get().UpdateMyAvailability();
     return(true);
 }