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; } } } }
private void Close() { Navigation.PopUnique(new Navigation.NavigateBackHandler(WelcomeQuests.OnNavigateBack)); s_instance = null; this.m_clickCatcher.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.CloseWelcomeQuests)); this.FadeEffectsOut(); object[] args = new object[] { "scale", Vector3.zero, "time", 0.5f, "oncompletetarget", base.gameObject, "oncomplete", "DestroyWelcomeQuests" }; iTween.ScaleTo(base.gameObject, iTween.Hash(args)); SoundManager.Get().LoadAndPlay("new_quest_click_and_shrink"); this.m_bannerFX.Play("BannerClose"); GameToastMgr.Get().UpdateQuestProgressToasts(); GameToastMgr.Get().AddSeasonTimeRemainingToast(); if (this.m_showRequestData != null) { if (!this.m_showRequestData.m_keepRichPresence) { PresenceMgr.Get().SetPrevStatus(); } if (this.m_showRequestData.m_onCloseCallback != null) { this.m_showRequestData.m_onCloseCallback(); } } InnKeepersSpecial.Get().Show(false); }
public static PresenceMgr Get() { if (s_instance == null) { s_instance = new PresenceMgr(); s_instance.Initialize(); } return(s_instance); }
private bool RevertTavernBrawlStatus() { Enum[] status = PresenceMgr.Get().GetStatus(); if ((this.IsChallengeTavernBrawl() && (status != null)) && ((status.Length > 0) && (((PresenceStatus)status[0]) == PresenceStatus.TAVERN_BRAWL_FRIENDLY_WAITING))) { PresenceMgr.Get().SetPrevStatus(); return(true); } return(false); }
private void ChangeMode_Tutorial() { Enum[] args = new Enum[] { PresenceStatus.TUTORIAL_PREGAME }; PresenceMgr.Get().SetStatus(args); Box.Get().SetLightState(BoxLightStateType.TUTORIAL); Spell eventSpell = Box.Get().GetEventSpell(BoxEventType.STARTUP_TUTORIAL); eventSpell.AddFinishedCallback(new Spell.FinishedCallback(this.OnStartupTutorialSpellFinished)); eventSpell.Activate(); }
private void Awake() { s_instance = this; this.m_presencePrevStatus = PresenceMgr.Get().GetStatus(); Enum[] args = new Enum[] { PresenceStatus.QUESTLOG }; PresenceMgr.Get().SetStatus(args); if (this.m_closeButton != null) { this.m_closeButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnCloseButtonReleased)); } }
private void CheckArenaGameStarted(BnetPlayer player) { if (PresenceMgr.Get().GetStatus(player) == PresenceStatus.ARENA_GAME) { ArenaRecord record; BnetGameAccount hearthstoneGameAccount = player.GetHearthstoneGameAccount(); if (((hearthstoneGameAccount != null) && ArenaRecord.TryParse(hearthstoneGameAccount.GetArenaRecord(), out record)) && (record.wins >= 8)) { object[] args = new object[] { "5ecaf0ff", player.GetBestName(), record.wins }; this.AddToast(GameStrings.Format("GLOBAL_SOCIAL_TOAST_FRIEND_ARENA_START_WITH_MANY_WINS", args)); } } }
private void EditOrDeleteDeck(UIEvent e) { if (this.IsInDeckEditMode()) { this.OnDeleteButtonPressed(); } else { Enum[] args = new Enum[] { PresenceStatus.TAVERN_BRAWL_DECKEDITOR }; PresenceMgr.Get().SetStatus(args); if (this.SwitchToEditDeckMode(TavernBrawlManager.Get().CurrentDeck())) { } } }
private void Start() { this.m_tavernBrawlTray.ToggleTraySlider(true, null, false); Enum[] status = PresenceMgr.Get().GetStatus(); if (((status == null) || (status.Length <= 0)) || (((PresenceStatus)status[0]) != PresenceStatus.TAVERN_BRAWL_FRIENDLY_WAITING)) { Enum[] args = new Enum[] { PresenceStatus.TAVERN_BRAWL_SCREEN }; PresenceMgr.Get().SetStatus(args); } this.RefreshStateBasedUI(false); this.RefreshDataBasedUI(this.m_wipeAnimStartDelay); MusicManager.Get().StartPlaylist(MusicPlaylistType.UI_TavernBrawl); if (TavernBrawlManager.Get().CurrentMission() != null) { int @int = Options.Get().GetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON_CHALKBOARD); if (@int == 0) { this.m_doWipeAnimation = true; if (!NotificationManager.Get().HasSoundPlayedThisSession("VO_INNKEEPER_TAVERNBRAWL_WELCOME1_27")) { NotificationManager.Get().CreateInnkeeperQuote(GameStrings.Get("VO_INNKEEPER_TAVERNBRAWL_WELCOME1_27"), "VO_INNKEEPER_TAVERNBRAWL_WELCOME1_27", 0f, null); NotificationManager.Get().ForceAddSoundToPlayedList("VO_INNKEEPER_TAVERNBRAWL_WELCOME1_27"); } } else if (@int < TavernBrawlManager.Get().CurrentMission().seasonId) { this.m_doWipeAnimation = true; int val = Options.Get().GetInt(Option.TIMES_SEEN_TAVERNBRAWL_CRAZY_RULES_QUOTE); if (!NotificationManager.Get().HasSoundPlayedThisSession("VO_INNKEEPER_TAVERNBRAWL_DESC2_30") && (val < 3)) { NotificationManager.Get().CreateInnkeeperQuote(GameStrings.Get("VO_INNKEEPER_TAVERNBRAWL_DESC2_30"), "VO_INNKEEPER_TAVERNBRAWL_DESC2_30", 0f, null); NotificationManager.Get().ForceAddSoundToPlayedList("VO_INNKEEPER_TAVERNBRAWL_DESC2_30"); val++; Options.Get().SetInt(Option.TIMES_SEEN_TAVERNBRAWL_CRAZY_RULES_QUOTE, val); } } if (@int != TavernBrawlManager.Get().CurrentMission().seasonId) { Options.Get().SetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON_CHALKBOARD, TavernBrawlManager.Get().CurrentMission().seasonId); } } if (TavernBrawlManager.Get().RewardProgress() == 0) { this.m_rewardHighlight.ChangeState(ActorStateType.HIGHLIGHT_PRIMARY_ACTIVE); } base.StartCoroutine(this.UpdateQuestsWhenReady()); }
private void OnChallengeChanged(FriendChallengeEvent challengeEvent, BnetPlayer player, object userData) { switch (challengeEvent) { case FriendChallengeEvent.I_SENT_CHALLENGE: this.ShowISentChallengeDialog(player); break; case FriendChallengeEvent.OPPONENT_ACCEPTED_CHALLENGE: this.StartChallengeProcess(); break; case FriendChallengeEvent.OPPONENT_DECLINED_CHALLENGE: this.ShowOpponentDeclinedChallengeDialog(player); break; case FriendChallengeEvent.I_RECEIVED_CHALLENGE: if (this.CanPromptReceivedChallenge()) { if (this.IsChallengeTavernBrawl()) { Enum[] args = new Enum[] { PresenceStatus.TAVERN_BRAWL_FRIENDLY_WAITING }; PresenceMgr.Get().SetStatus(args); } this.ShowIReceivedChallengeDialog(player); break; } break; case FriendChallengeEvent.I_ACCEPTED_CHALLENGE: this.StartChallengeProcess(); break; case FriendChallengeEvent.OPPONENT_RESCINDED_CHALLENGE: this.ShowOpponentCanceledChallengeDialog(player); break; case FriendChallengeEvent.OPPONENT_CANCELED_CHALLENGE: this.ShowOpponentCanceledChallengeDialog(player); break; case FriendChallengeEvent.OPPONENT_REMOVED_FROM_FRIENDS: this.ShowOpponentRemovedFromFriendsDialog(player); break; } }
protected override void Hide(bool animate) { if (this.m_presencePrevStatus == null) { this.m_presencePrevStatus = new Enum[] { PresenceStatus.HUB }; } PresenceMgr.Get().SetStatus(this.m_presencePrevStatus); if (ShownUIMgr.Get() != null) { ShownUIMgr.Get().ClearShownUI(); } base.DoHideAnimation(!animate, delegate { AchieveManager.Get().RemoveQuestCanceledListener(new AchieveManager.AchieveCanceledCallback(this.OnQuestCanceled)); this.DeleteQuests(); FullScreenFXMgr.Get().EndStandardBlurVignette(0.1f, null); base.m_shown = false; }); }
public static void Show(bool fromLogin, DelOnWelcomeQuestsClosed onCloseCallback = null, bool keepRichPresence = false) { Enum[] args = new Enum[] { PresenceStatus.WELCOMEQUESTS }; PresenceMgr.Get().SetStatus(args); ShowRequestData showRequestData = new ShowRequestData { m_fromLogin = fromLogin, m_onCloseCallback = onCloseCallback, m_keepRichPresence = keepRichPresence }; if (s_instance != null) { Debug.LogWarning("WelcomeQuests.Show(): requested to show welcome quests while it was already active!"); s_instance.InitAndShow(showRequestData); } else { AssetLoader.Get().LoadGameObject("WelcomeQuests", new AssetLoader.GameObjectCallback(WelcomeQuests.OnWelcomeQuestsLoaded), showRequestData, false); } }
private void TavernBrawl_ReceivedChallenge_OnEnsureServerDataReady_OnDeckContentsReady(long deckId) { CollectionManager.Get().RemoveDeckContentsListener(new CollectionManager.DelOnDeckContents(this.TavernBrawl_ReceivedChallenge_OnEnsureServerDataReady_OnDeckContentsReady)); TavernBrawlMission mission = TavernBrawlManager.Get().CurrentMission(); string key = null; DeclineReason? nullable = null; if (mission == null) { nullable = 0; } if (((mission != null) && mission.canCreateDeck) && !TavernBrawlManager.Get().HasValidDeck()) { nullable = 2; key = "GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_RECIPIENT_NO_VALID_DECK_RECIPIENT"; } if (key != null) { AlertPopup.PopupInfo info = new AlertPopup.PopupInfo { m_headerText = GameStrings.Get("GLOBAL_FRIEND_CHALLENGE_TAVERN_BRAWL_HEADER") }; object[] args = new object[] { FriendUtils.GetUniqueName(this.m_challenger) }; info.m_text = GameStrings.Format(key, args); info.m_responseDisplay = AlertPopup.ResponseDisplay.OK; DialogManager.Get().ShowPopup(info); } if (nullable.HasValue) { BnetParty.SetPartyAttributeLong(this.m_partyId, "WTCG.Friendly.DeclineReason", (long)nullable.Value); this.DeclineChallenge(); } else { if (this.IsChallengeTavernBrawl()) { Enum[] enumArray1 = new Enum[] { PresenceStatus.TAVERN_BRAWL_FRIENDLY_WAITING }; PresenceMgr.Get().SetStatus(enumArray1); } this.ShowIReceivedChallengeDialog(this.m_challenger); } }
public void SendChallenge(BnetPlayer player) { if (this.CanChallenge(player)) { this.m_challenger = BnetPresenceMgr.Get().GetMyPlayer(); this.m_challengerId = this.m_challenger.GetHearthstoneGameAccount().GetId(); this.m_challengee = player; this.m_hasSeenDeclinedReason = false; this.m_scenarioId = 2; this.m_isChallengeTavernBrawl = false; if (TavernBrawlManager.Get().ShouldNewFriendlyChallengeBeTavernBrawl()) { this.m_scenarioId = TavernBrawlManager.Get().CurrentMission().missionId; Enum[] args = new Enum[] { PresenceStatus.TAVERN_BRAWL_FRIENDLY_WAITING }; PresenceMgr.Get().SetStatus(args); this.m_isChallengeTavernBrawl = true; } Network.SendFriendChallenge(player.GetHearthstoneGameAccount().GetId(), this.m_scenarioId); this.UpdateMyAvailability(); this.FireChangedEvent(FriendChallengeEvent.I_SENT_CHALLENGE, player); } }
public bool BackFromDeckEdit(bool animate) { if (!this.IsInDeckEditMode()) { return(false); } if (animate) { PresenceMgr.Get().SetPrevStatus(); } if (CollectionManagerDisplay.Get().GetViewMode() != CollectionManagerDisplay.ViewMode.CARDS) { TAG_CLASS pageClass = (TavernBrawlManager.Get().CurrentDeck() != null) ? TavernBrawlManager.Get().CurrentDeck().GetClass() : TAG_CLASS.DRUID; CollectionManagerDisplay.Get().m_pageManager.JumpToCollectionClassPage(pageClass); } this.m_tavernBrawlTray.ToggleTraySlider(true, null, animate); this.RefreshStateBasedUI(animate); this.m_deckBeingEdited = 0L; BnetBar.Get().m_currencyFrame.RefreshContents(); FriendChallengeMgr.Get().UpdateMyAvailability(); this.UpdateEditOrCreate(); if (UniversalInputManager.UsePhoneUI == null) { this.m_editDeckButton.SetText(GameStrings.Get("GLUE_EDIT")); if (this.m_editIcon != null) { this.m_editIcon.SetActive(true); } if (this.m_deleteIcon != null) { this.m_deleteIcon.SetActive(false); } } CollectionDeckTray.Get().ExitEditDeckModeForTavernBrawl(); return(true); }
private void AssetsVersionCheckCompleted() { if (!string.IsNullOrEmpty(UpdateManager.Get().GetError()) && UpdateManager.Get().UpdateIsRequired()) { Error.AddFatalLoc("GLUE_PATCHING_ERROR", new object[0]); } else { if (Network.ShouldBeConnectedToAurora()) { BnetPresenceMgr.Get().Initialize(); BnetFriendMgr.Get().Initialize(); BnetChallengeMgr.Get().Initialize(); BnetWhisperMgr.Get().Initialize(); BnetNearbyPlayerMgr.Get().Initialize(); FriendChallengeMgr.Get().OnLoggedIn(); SpectatorManager.Get().Initialize(); if (!Options.Get().GetBool(Option.CONNECT_TO_AURORA)) { Options.Get().SetBool(Option.CONNECT_TO_AURORA, true); } TutorialProgress progress = Options.Get().GetEnum <TutorialProgress>(Option.LOCAL_TUTORIAL_PROGRESS); if (progress > TutorialProgress.NOTHING_COMPLETE) { this.m_waitingForSetProgress = true; ConnectAPI.SetProgress((long)progress); } if (WebAuth.GetIsNewCreatedAccount()) { AdTrackingManager.Get().TrackAccountCreated(); WebAuth.SetIsNewCreatedAccount(false); } } ConnectAPI.RequestAccountLicenses(); ConnectAPI.RequestGameLicenses(); Box.Get().OnLoggedIn(); BaseUI.Get().OnLoggedIn(); InactivePlayerKicker.Get().OnLoggedIn(); HealthyGamingMgr.Get().OnLoggedIn(); DefLoader.Get().Initialize(); CollectionManager.Init(); AdventureProgressMgr.Init(); Tournament.Init(); GameMgr.Get().OnLoggedIn(); if (Network.ShouldBeConnectedToAurora()) { StoreManager.Get().Init(); } Network.TrackClient(Network.TrackLevel.LEVEL_INFO, Network.TrackWhat.TRACK_LOGIN_FINISHED); Network.ResetConnectionFailureCount(); if (Network.ShouldBeConnectedToAurora()) { ConnectAPI.DoLoginUpdate(); } else { this.m_waitingForUpdateLoginComplete = false; } Enum[] args = new Enum[] { PresenceStatus.LOGIN }; PresenceMgr.Get().SetStatus(args); if (SplashScreen.Get() != null) { SplashScreen.Get().StopPatching(); SplashScreen.Get().ShowRatings(); } this.PreloadActors(); if (!Network.ShouldBeConnectedToAurora()) { base.StartCoroutine(this.RegisterScreenWhenReady()); } SceneMgr.Get().LoadShaderPreCompiler(); } }
private void CreateDeck() { Enum[] args = new Enum[] { PresenceStatus.TAVERN_BRAWL_DECKEDITOR }; PresenceMgr.Get().SetStatus(args); CollectionManagerDisplay.Get().EnterSelectNewDeckHeroMode(); }
private void OnRockTournamentMode(bool ranked) { if (SingletonOnGameRequest) { return; } SingletonOnGameRequest = true; if (SceneMgr.Get().IsInGame() || Network.Get().IsFindingGame()) { HoldBack(1000); return; } if (DeckPickerTrayDisplay.Get() == null) { HoldBack(1000); SingletonOnGameRequest = false; return; } long deck = DeckPickerTrayDisplay.Get().GetSelectedDeckID(); if (deck == 0) { HoldBack(1000); SingletonOnGameRequest = false; return; } /* * DeckPickerTrayDisplay.Get().GetSelectedDeckID(); * * HoldBack(5000); * MissionID mission = HearthRockEngine.RandomAIMissionID(expert); * * Notify("PraticeMode: Deck " + deck + "Mission " + mission); * GameMgr.Get().StartGame(GameMode.PRACTICE, mission, deck); * GameMgr.Get().UpdatePresence(); * */ bool is_ranked = Options.Get().GetBool(Option.IN_RANKED_PLAY_MODE); if (is_ranked != ranked) { Options.Get().SetBool(Option.IN_RANKED_PLAY_MODE, ranked); SingletonOnGameRequest = false; return; } long selectedDeckID = DeckPickerTrayDisplay.Get().GetSelectedDeckID(); // Network.TrackWhat what; // Network. PegasusShared.GameType type; if (ranked) { // what = Network.TrackWhat.TRACK_PLAY_TOURNAMENT_WITH_CUSTOM_DECK; type = PegasusShared.GameType.GT_RANKED; } else { // what = Network.TrackWhat.TRACK_PLAY_CASUAL_WITH_CUSTOM_DECK; // type = PegasusShared.GameType.GT_UNRANKED; type = PegasusShared.GameType.GT_CASUAL; } // Network.TrackClient(Network.TrackLevel.LEVEL_INFO, what); GameMgr.Get().FindGame(type, PegasusShared.FormatType.FT_STANDARD, 2, selectedDeckID, 0L); Enum[] args = new Enum[] { PresenceStatus.PLAY_QUEUE }; PresenceMgr.Get().SetStatus(args); }
public void Hide() { PresenceMgr.Get().SetPrevStatus(); CollectionManagerDisplay.Get().HideCraftingTray(); CollectionManagerDisplay.Get().m_pageManager.HideMassDisenchant(); }