private void InitPlanetOptionTournamentTab() { IDataController dataController = Service.Get <IDataController>(); CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>(); bool flag = false; this.planetGrid.Clear(); this.planetGrid.Visible = true; List <TournamentVO> allLiveAndClosingTournaments = TournamentController.GetAllLiveAndClosingTournaments(); int num = 2147483647; foreach (TournamentVO current in allLiveAndClosingTournaments) { PlanetVO planetVO = dataController.Get <PlanetVO>(current.PlanetId); if (planetVO != null) { if (planetVO.Uid == currentPlayer.Planet.Uid) { flag = true; } if (current.EndTimestamp < num) { this.selectedPlanet = planetVO; num = current.EndTimestamp; } this.AddPlanetButton(planetVO, true, planetVO.Uid == currentPlayer.Planet.Uid); } if (flag) { this.selectedPlanet = currentPlayer.Planet; } } this.planetOptionPanelBackground.Height = (float)this.planetGrid.Count * this.planetGrid.CellHeight + 20f; this.planetGrid.RepositionItems(); }
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; }
public LeaderboardsScreen(bool useScreenTransition, string initalPlanetId) { this.useScreenTransitions = useScreenTransition; this.factionSelectorDropDown = new FactionSelectorDropDown(this); this.planetSelectionDropDown = new PlanetSelectionDropDown(this); if (TournamentController.GetAllLiveAndClosingTournaments().Count > 0) { this.initialTab = SocialTabs.Tournament; } else { this.initialTab = SocialTabs.Squads; } if (!string.IsNullOrEmpty(initalPlanetId)) { this.initialPlanet = Service.Get <IDataController>().GetOptional <PlanetVO>(initalPlanetId); } }