protected void TabClicked(bool selected, SocialTabs clickedTab) { if (!selected) { return; } if (this.curTab != clickedTab) { this.curTab = clickedTab; SocialTabInfo tabInfo = this.GetTabInfo(clickedTab); this.DoTabClickedReset(tabInfo.TabGridLoadHelper); tabInfo.LoadAction(); string cookie = (tabInfo.EventActionId == null) ? this.GetSelectedFactionString() : tabInfo.EventActionId; Service.EventManager.SendEvent(tabInfo.TabEventId, cookie); Service.UXController.MiscElementsManager.TryCloseNonFatalAlertScreen(); this.PositionScrollViewForTop50(); foreach (KeyValuePair <SocialTabs, SocialTabInfo> current in this.tabs) { if (current.Key == clickedTab) { current.Value.TabLabel.TextColor = UXUtils.COLOR_NAV_TAB_ENABLED; } else { current.Value.TabLabel.TextColor = UXUtils.COLOR_NAV_TAB_DISABLED; } } } }
protected void ReloadCurrentTab() { base.CancelLoaderAndResetGrid(); SocialTabInfo tabInfo = base.GetTabInfo(this.curTab); tabInfo.LoadAction.Invoke(); }
protected override void InitButtons() { base.InitButtons(); UXCheckbox element = base.GetElement <UXCheckbox>("BtnSquads"); element.OnSelected = new UXCheckboxSelectedDelegate(this.FeaturedTabClicked); element.Selected = true; SocialTabInfo tabInfo = base.GetTabInfo(SocialTabs.Featured); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelSquads"); tabInfo.TabLabel.Text = this.lang.Get("s_Featured", new object[0]); element = base.GetElement <UXCheckbox>("BtnFriends"); element.OnSelected = new UXCheckboxSelectedDelegate(this.SquadFriendsTabClicked); element.Selected = false; tabInfo = base.GetTabInfo(SocialTabs.Friends); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnFriends"); tabInfo.TabLabel.Text = this.lang.Get("s_Friends", new object[0]); element = base.GetElement <UXCheckbox>("BtnLeaders"); element.OnSelected = new UXCheckboxSelectedDelegate(this.SearchTabClicked); element.Selected = false; tabInfo = base.GetTabInfo(SocialTabs.Search); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnLeaders"); tabInfo.TabLabel.Text = this.lang.Get("s_Search", new object[0]); element = base.GetElement <UXCheckbox>("BtnTournament"); element.OnSelected = new UXCheckboxSelectedDelegate(this.InvitesTabClicked); element.Selected = false; element.Visible = GameConstants.SQUAD_INVITES_ENABLED; tabInfo = base.GetTabInfo(SocialTabs.Invites); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnTournament"); tabInfo.TabLabel.Text = this.lang.Get("s_Invites", new object[0]); }
protected override void InitTabInfo() { SocialTabInfo value = new SocialTabInfo(new Action(this.LoadSquads), EventId.UILeaderboardSquadTabShown, null, PlayerListType.Squads); this.tabs.Add(SocialTabs.Squads, value); value = new SocialTabInfo(new Action(base.LoadFriends), EventId.UILeaderboardFriendsTabShown, null, PlayerListType.Friends); this.tabs.Add(SocialTabs.Friends, value); value = new SocialTabInfo(new Action(this.LoadLeaders), EventId.UILeaderboardPlayersTabShown, null, PlayerListType.Leaders); this.tabs.Add(SocialTabs.Leaders, value); value = new SocialTabInfo(new Action(this.LoadTournamentLeaders), EventId.UILeaderboardTournamentTabShown, null, PlayerListType.TournamentLeaders); this.tabs.Add(SocialTabs.Tournament, value); }
protected override void InitTabInfo() { SocialTabInfo value = new SocialTabInfo(new Action(this.LoadFeatureSquads), EventId.UISquadJoinTabShown, "featured", PlayerListType.FeaturedSquads); this.tabs.Add(SocialTabs.Featured, value); value = new SocialTabInfo(new Action(base.LoadFriends), EventId.UISquadJoinTabShown, "friends", PlayerListType.Friends); this.tabs.Add(SocialTabs.Friends, value); value = new SocialTabInfo(new Action(this.LoadSearchTab), EventId.UISquadJoinTabShown, "search", PlayerListType.SearchedSquads); this.tabs.Add(SocialTabs.Search, value); value = new SocialTabInfo(new Action(this.LoadSquadInvites), EventId.UISquadJoinTabShown, "invites", PlayerListType.Invites); this.tabs.Add(SocialTabs.Invites, value); }
protected void PlanetChanged(PlanetVO planet) { if (!this.Visible) { return; } Service.Get <EventManager>().SendEvent(EventId.SquadSelect, null); SocialTabInfo tabInfo = base.GetTabInfo(this.curTab); tabInfo.LoadAction.Invoke(); this.top50Button.Enabled = false; this.findMeButton.Enabled = true; this.LogLeaderboardPlanetSelection(); }
protected override void OnScreenLoaded() { this.squadInfoView.OnScreenLoaded(); this.createSquadItemTemplate = base.GetElement <UXElement>("SquadCreateItem"); this.fbItemTemplate = base.GetElement <UXElement>("SquadFacebookItem"); this.itemTemplate = base.GetElement <UXElement>("SquadItem"); this.createSquadItemTemplate.Visible = false; this.fbItemTemplate.Visible = false; this.itemTemplate.Visible = false; this.searchOverlay = base.GetElement <UXElement>("ContainerSearchWindow"); this.searchOverlay.Visible = false; this.scrollUp = base.GetElement <UXSprite>("SpriteLeaderboardsPanelScrollUp"); this.scrollDown = base.GetElement <UXSprite>("SpriteLeaderboardsPanelScrollDown"); this.titleLabel = base.GetElement <UXLabel>("LabelLeaderboards"); this.container = base.GetElement <UXElement>("LeaderboardsContainer"); this.container.Visible = true; this.navigation = base.GetElement <UXElement>("LeaderboardNavigation"); this.navigation.Visible = true; this.navigationRow = base.GetElement <UXElement>("NavigationRow"); this.navigationRow.Visible = true; this.panel = base.GetElement <UXElement>("LeaderboardsPanel"); this.scrollView = NGUITools.FindInParents <UIScrollView>(this.panel.Root); this.InitButtons(); List <UXElement> elements = new List <UXElement> { this.navigation, this.container }; this.backButtonHelper.InitWithMultipleElementsLayer(elements); UXGrid element = base.GetElement <UXGrid>("SquadGrid"); element.BypassLocalPositionOnAdd = true; element.LocalPosition = AbstractLeaderboardScreen.OFFSCREEN_GRID_POSITION; element.Enabled = false; this.InitIndividualGrids(element); UIPanel component = this.panel.Root.GetComponent <UIPanel>(); Vector2 clipOffset = component.clipOffset; clipOffset.x = 0f; component.clipOffset = clipOffset; SocialTabInfo tabInfo = this.GetTabInfo(this.initialTab); tabInfo.TabButton.SetSelected(true); this.gridLoadHelper = tabInfo.TabGridLoadHelper; }
protected override void InitButtons() { base.InitButtons(); UXCheckbox element = base.GetElement <UXCheckbox>("BtnSquads"); element.OnSelected = new UXCheckboxSelectedDelegate(this.SquadsTabClicked); element.Selected = false; SocialTabInfo tabInfo = base.GetTabInfo(SocialTabs.Squads); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelSquads"); tabInfo.TabLabel.Text = this.lang.Get("s_Squads", new object[0]); element = base.GetElement <UXCheckbox>("BtnLeaders"); element.Selected = false; element.OnSelected = new UXCheckboxSelectedDelegate(this.LeadersTabClicked); tabInfo = base.GetTabInfo(SocialTabs.Leaders); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnLeaders"); tabInfo.TabLabel.Text = this.lang.Get("s_Leaders", new object[0]); element = base.GetElement <UXCheckbox>("BtnFriends"); element.OnSelected = new UXCheckboxSelectedDelegate(this.FriendsTabClicked); element.Selected = false; tabInfo = base.GetTabInfo(SocialTabs.Friends); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnFriends"); tabInfo.TabLabel.Text = this.lang.Get("s_Friends", new object[0]); element = base.GetElement <UXCheckbox>("BtnTournament"); element.Visible = (TournamentController.GetAllLiveAndClosingTournaments().Count > 0); element.OnSelected = new UXCheckboxSelectedDelegate(this.TournamentTabClicked); element.Selected = false; tabInfo = base.GetTabInfo(SocialTabs.Tournament); tabInfo.TabButton = element; tabInfo.TabLabel = base.GetElement <UXLabel>("LabelBtnTournament"); tabInfo.TabLabel.Text = this.lang.Get("s_Conflicts", new object[0]); this.top50Button = base.GetElement <UXButton>("BtnSortTop"); this.top50Button.OnClicked = new UXButtonClickedDelegate(this.Top50ButtonClicked); base.GetElement <UXLabel>("LabelBtnSortTop").Text = this.lang.Get("leaderboard_top_50", new object[0]); this.findMeButton = base.GetElement <UXButton>("BtnFindMe"); this.findMeButton.OnClicked = new UXButtonClickedDelegate(this.FindMeButtonClicked); base.GetElement <UXLabel>("LabelBtnFindMe").Text = this.lang.Get("leaderboard_find_me", new object[0]); this.featureSquadButton = base.GetElement <UXButton>("BtnFeaturedSquads"); this.featureSquadButton.OnClicked = new UXButtonClickedDelegate(this.FeatureSquadButtonClicked); base.GetElement <UXLabel>("LabelBtnFeaturedSquads").Text = this.lang.Get("s_Featured", new object[0]); this.featureSquadButton.Visible = false; }