protected void EnableGridLoadHelper(GridLoadHelper gridLoadHelper, bool isEnabled) { UXGrid grid = gridLoadHelper.GetGrid(); grid.Enabled = isEnabled; grid.Visible = isEnabled; grid.LocalPosition = ((!isEnabled) ? AbstractLeaderboardScreen.OFFSCREEN_GRID_POSITION : Vector3.zero); }
protected GridLoadHelper CreateGridLoadHelperByCloningGrid(UXGrid originalGrid, string itemId) { UXGrid grid = base.CloneElement <UXGrid>(originalGrid, itemId, originalGrid.Root.transform.parent.gameObject); GridLoadHelper result = new GridLoadHelper(new GridLoadHelper.CreateUXElementFromGridItem(this.CreateUXElementFromGridItem), grid); this.EnableGridLoadHelper(result, false); Service.EventManager.SendEvent(EventId.AllUXElementsCreated, this); return(result); }
protected void DestroyGridLoadHelper(GridLoadHelper tmpGridLoadHelper, bool isDestroyGrid) { if (tmpGridLoadHelper != null) { tmpGridLoadHelper.OnDestroyElement(); if (isDestroyGrid) { base.DestroyElement(tmpGridLoadHelper.GetGrid()); } } }
private void DoTabClickedReset(GridLoadHelper switchingGridLoadHelper) { ProcessingScreen.Hide(); this.EnableGridLoadHelper(this.gridLoadHelper, false); this.gridLoadHelper = switchingGridLoadHelper; this.EnableGridLoadHelper(this.gridLoadHelper, true); Service.EventManager.SendEvent(EventId.SquadSelect, null); this.ResetGrid(); this.RepositionGridItems(); this.scrollView.ResetPosition(); }
protected override void InitIndividualGrids(UXGrid baseGrid) { GridLoadHelper tabGridLoadHelper = base.CreateGridLoadHelperByCloningGrid(baseGrid, "LBSquadGrid"); base.GetTabInfo(SocialTabs.Squads).TabGridLoadHelper = tabGridLoadHelper; tabGridLoadHelper = base.CreateGridLoadHelperByCloningGrid(baseGrid, "LBFriendsGrid"); base.GetTabInfo(SocialTabs.Friends).TabGridLoadHelper = tabGridLoadHelper; tabGridLoadHelper = base.CreateGridLoadHelperByCloningGrid(baseGrid, "LBPlayersGrid"); base.GetTabInfo(SocialTabs.Leaders).TabGridLoadHelper = tabGridLoadHelper; tabGridLoadHelper = base.CreateGridLoadHelperByCloningGrid(baseGrid, "LBTournamentGrid"); base.GetTabInfo(SocialTabs.Tournament).TabGridLoadHelper = tabGridLoadHelper; }
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; }