public void UpdateMode() { bool @bool = Options.Get().GetBool(Option.IN_RANKED_PLAY_MODE); NetCache.NetCacheFeatures netObject = NetCache.Get().GetNetObject <NetCache.NetCacheFeatures>(); if (((netObject != null) && (netObject.Games != null)) && !netObject.Games.Casual) { this.m_casualButton.SetEnabled(false); if (!@bool) { @bool = true; Options.Get().SetBool(Option.IN_RANKED_PLAY_MODE, true); } } else { this.m_casualButton.SetEnabled(true); } if (@bool) { DeckPickerTrayDisplay.Get().SetPlayButtonText(GameStrings.Get("GLOBAL_PLAY_RANKED")); if (UniversalInputManager.UsePhoneUI != null) { DeckPickerTrayDisplay.Get().ToggleRankedDetailsTray(true); } this.m_casualButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnCasualButtonRelease)); this.m_rankedButton.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnRankedButtonRelease)); this.m_casualButton.Up(); this.m_rankedButton.Down(); } else { DeckPickerTrayDisplay.Get().SetPlayButtonText(GameStrings.Get("GLOBAL_PLAY")); if (UniversalInputManager.UsePhoneUI != null) { DeckPickerTrayDisplay.Get().ToggleRankedDetailsTray(false); } this.m_casualButton.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnCasualButtonRelease)); this.m_rankedButton.AddEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnRankedButtonRelease)); this.m_casualButton.Down(); this.m_rankedButton.Up(); } if (DeckPickerTrayDisplay.Get().m_playButton.IsEnabled()) { DeckPickerTrayDisplay.Get().m_playButton.m_newPlayButtonText.TextAlpha = 1f; } else { DeckPickerTrayDisplay.Get().m_playButton.m_newPlayButtonText.TextAlpha = 0f; } DeckPickerTrayDisplay.Get().UpdateRankedClassWinsPlate(); }
private void CheckLatestSeenSeason(bool canSetOption) { if (this.IsTavernBrawlInfoReady) { bool flag = !this.m_hasGottenClientOptionsAtLeastOnce; this.m_hasGottenClientOptionsAtLeastOnce = true; bool isFirstTimeSeeingThisFeature = this.IsFirstTimeSeeingThisFeature; bool isFirstTimeSeeingCurrentSeason = this.IsFirstTimeSeeingCurrentSeason; this.s_isFirstTimeSeeingThisFeature = false; this.s_isFirstTimeSeeingCurrentSeason = false; TavernBrawlInfo serverInfo = this.ServerInfo; if (serverInfo.HasCurrentTavernBrawl) { NetCache.NetCacheFeatures netObject = NetCache.Get().GetNetObject <NetCache.NetCacheFeatures>(); bool flag4 = ((netObject != null) && netObject.Games.TavernBrawl) && this.HasUnlockedTavernBrawl; TavernBrawlSpec currentTavernBrawl = serverInfo.CurrentTavernBrawl; int @int = Options.Get().GetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON); if ((@int == 0) && flag4) { this.s_isFirstTimeSeeingThisFeature = true; NotificationManager.Get().ForceRemoveSoundFromPlayedList("VO_INNKEEPER_TAVERNBRAWL_PUSH_32"); NotificationManager.Get().ForceRemoveSoundFromPlayedList("VO_INNKEEPER_TAVERNBRAWL_WELCOME1_27"); } if ((@int < currentTavernBrawl.SeasonId) && flag4) { this.s_isFirstTimeSeeingCurrentSeason = true; NotificationManager.Get().ForceRemoveSoundFromPlayedList("VO_INNKEEPER_TAVERNBRAWL_DESC2_30"); Hub.s_hasAlreadyShownTBAnimation = false; if (canSetOption) { Options.Get().SetInt(Option.LATEST_SEEN_TAVERNBRAWL_SEASON, currentTavernBrawl.SeasonId); } } } if (((flag || (isFirstTimeSeeingThisFeature != this.IsFirstTimeSeeingThisFeature)) || (isFirstTimeSeeingCurrentSeason != this.IsFirstTimeSeeingCurrentSeason)) && (this.OnTavernBrawlUpdated != null)) { this.OnTavernBrawlUpdated(); } } }