Esempio n. 1
0
        public override void OnVisitClicked(UXButton button)
        {
            string     playerId = button.Tag as string;
            bool       isFriend = false;
            string     tabName  = null;
            SocialTabs curTab   = this.curTab;

            if (curTab != SocialTabs.Friends)
            {
                if (curTab != SocialTabs.Search)
                {
                    if (curTab == SocialTabs.Featured)
                    {
                        tabName = "JoinSquad_Featured";
                    }
                }
                else
                {
                    tabName = "JoinSquad_Search";
                }
            }
            else
            {
                isFriend = true;
                tabName  = "JoinSquad_Friends";
            }
            PlayerVisitTag cookie = new PlayerVisitTag(false, isFriend, tabName, playerId);

            Service.EventManager.SendEvent(EventId.VisitPlayer, cookie);
            base.OnVisitClicked(button);
        }
Esempio n. 2
0
        private UXElement CreateUXElementFromGridItem(object itemObject, object cookie, int position)
        {
            GridDataCookie             gridDataCookie             = (GridDataCookie)cookie;
            SocialTabs                 selectedTab                = gridDataCookie.SelectedTab;
            FactionToggle              selectedFaction            = gridDataCookie.SelectedFaction;
            string                     selectedPlanet             = gridDataCookie.SelectedPlanet;
            AbstractLeaderboardRowView abstractLeaderboardRowView = null;

            if (itemObject is PlayerLBEntity)
            {
                abstractLeaderboardRowView = this.AddPlayerRow((PlayerLBEntity)itemObject, selectedTab, selectedFaction, selectedPlanet, position);
            }
            else if (itemObject is Squad)
            {
                abstractLeaderboardRowView = this.AddSquadRow((Squad)itemObject, selectedTab, selectedFaction, position);
            }
            else if (itemObject is SquadInvite)
            {
                abstractLeaderboardRowView = this.AddSquadInviteRow((SquadInvite)itemObject, selectedTab, selectedFaction, position);
            }
            UXElement result = null;

            if (abstractLeaderboardRowView != null)
            {
                result = abstractLeaderboardRowView.GetItem();
                this.rowViews.Add(abstractLeaderboardRowView);
            }
            return(result);
        }
        public void SetStatePlanetOptions(SocialTabs type)
        {
            switch (type)
            {
            case SocialTabs.Friends:
                this.DisablePlanetSelection();
                goto IL_54;

            case SocialTabs.Squads:
                this.DisablePlanetSelection();
                goto IL_54;

            case SocialTabs.Leaders:
                this.InitPlanetOptionPlayerTab();
                this.ActivatePlanetSelection();
                goto IL_54;

            case SocialTabs.Tournament:
                this.InitPlanetOptionTournamentTab();
                this.ActivatePlanetSelection();
                goto IL_54;
            }
            this.DisablePlanetSelection();
IL_54:
            this.UpdateCurrentPlanetButton();
        }
Esempio n. 4
0
        private void RefreshCurrentTab()
        {
            SocialTabs curTab = this.curTab;

            switch (curTab)
            {
            case SocialTabs.Featured:
                this.LoadFeatureSquads();
                return;

            case SocialTabs.Friends:
                base.LoadFriends();
                return;

            case SocialTabs.Search:
                this.LoadSearchTab();
                return;

            default:
                if (curTab != SocialTabs.Invites)
                {
                    return;
                }
                this.LoadSquadInvites();
                return;
            }
        }
Esempio n. 5
0
 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;
             }
         }
     }
 }
Esempio n. 6
0
 public GridDataCookie(SocialTabs socialTab, FactionToggle factionToggle, string selectedPlanet)
 {
     this = default(GridDataCookie);
     this.SelectedFaction = factionToggle;
     this.SelectedTab     = socialTab;
     this.SelectedPlanet  = selectedPlanet;
 }
Esempio n. 7
0
 public void ForceSwitchTab(SocialTabs tab)
 {
     foreach (KeyValuePair <SocialTabs, SocialTabInfo> current in this.tabs)
     {
         current.Value.TabButton.Selected = false;
     }
     this.GetTabInfo(tab).TabButton.Selected = true;
     this.TabClicked(true, tab);
 }
Esempio n. 8
0
        private void AddCreateSquadItem(SocialTabs socialTab)
        {
            int nexElementPosition = this.gridLoadHelper.GetNexElementPosition();
            LeaderboardRowCreateSquadView leaderboardRowCreateSquadView = new LeaderboardRowCreateSquadView(this, this.gridLoadHelper.GetGrid(), this.createSquadItemTemplate, nexElementPosition);

            this.rowViews.Add(leaderboardRowCreateSquadView);
            UXElement item = leaderboardRowCreateSquadView.GetItem();

            this.gridLoadHelper.AddElement(item);
        }
 public AbstractLeaderboardScreen()
 {
     this.curTab = SocialTabs.Empty;
     base..ctor("gui_leaderboards");
     Service.Get <BuildingController>().CancelEditModeTimer();
     this.backButtonHelper = new BackButtonHelper(this);
     this.squadInfoView    = new SquadInfoView(this);
     this.backButtonHelper.BackButtonCallBack = new Action(this.CheckBackButton);
     this.rowViews = new List <AbstractLeaderboardRowView>();
     this.tabs     = new Dictionary <SocialTabs, SocialTabInfo>();
     this.InitTabInfo();
 }
Esempio n. 10
0
 public AbstractLeaderboardRowView(AbstractLeaderboardScreen screen, UXGrid grid, UXElement templateItem, SocialTabs tab, FactionToggle faction, int position, bool initAllElements)
 {
     this.screen       = screen;
     this.grid         = grid;
     this.templateItem = templateItem;
     this.tab          = tab;
     this.faction      = faction;
     this.position     = position;
     this.CreateItem();
     if (initAllElements)
     {
         this.InitElements();
     }
 }
Esempio n. 11
0
        private AbstractLeaderboardRowView AddSquadInviteRow(SquadInvite invite, SocialTabs tab, FactionToggle faction, int position)
        {
            if (invite == null || string.IsNullOrEmpty(invite.SquadId))
            {
                return(null);
            }
            Squad orCreateSquad = Service.LeaderboardController.GetOrCreateSquad(invite.SquadId);

            if (!this.IsFactionToggleValidFactionType(faction, orCreateSquad.Faction) || position >= 51)
            {
                return(null);
            }
            return(new LeaderboardRowSquadInviteView(this, this.gridLoadHelper.GetGrid(), this.itemTemplate, tab, faction, position, invite, orCreateSquad));
        }
 protected void AddFBConnectItem(SocialTabs socialTab)
 {
     if (Service.Get <EnvironmentController>().IsRestrictedProfile())
     {
         return;
     }
     if (this.facebookRow != null)
     {
         return;
     }
     this.facebookRow = new LeaderboardRowFacebookView(this, this.gridLoadHelper.GetGrid(), this.fbItemTemplate, this.curTab);
     this.rowViews.Add(this.facebookRow);
     this.gridLoadHelper.AddElement(this.facebookRow.GetItem());
     this.RepositionGridItems();
     this.scrollView.ResetPosition();
 }
Esempio n. 13
0
 private AbstractLeaderboardRowView AddPlayerRow(PlayerLBEntity player, SocialTabs tab, FactionToggle faction, string planetUid, int position)
 {
     if (player == null || string.IsNullOrEmpty(player.PlayerName))
     {
         return(null);
     }
     if (!this.IsFactionToggleValidFactionType(faction, player.Faction) || position >= 51)
     {
         return(null);
     }
     if (player.PlayerID == Service.CurrentPlayer.PlayerId)
     {
         this.currentPlayerTileIndex = position;
     }
     return(new LeaderboardRowPlayerView(this, this.gridLoadHelper.GetGrid(), this.itemTemplate, tab, faction, position, player, planetUid));
 }
Esempio n. 14
0
        private AbstractLeaderboardRowView AddSquadRow(Squad squad, SocialTabs tab, FactionToggle faction, int position)
        {
            if (squad == null)
            {
                return(null);
            }
            if (!this.IsFactionToggleValidFactionType(faction, squad.Faction) || position >= 51)
            {
                return(null);
            }
            Squad currentSquad = Service.SquadController.StateManager.GetCurrentSquad();

            if (currentSquad != null && currentSquad.SquadID == squad.SquadID)
            {
                this.currentPlayerTileIndex = position;
            }
            return(new LeaderboardRowSquadView(this, this.gridLoadHelper.GetGrid(), this.itemTemplate, tab, faction, position, squad));
        }
Esempio n. 15
0
        private string GetSquadElementPrefix(SocialTabs selectedTab)
        {
            string result;

            if (selectedTab != SocialTabs.Search)
            {
                if (selectedTab != SocialTabs.Invites)
                {
                    result = "squad_";
                }
                else
                {
                    result = "squad_invite_";
                }
            }
            else
            {
                result = "squad_search_";
            }
            return(result);
        }
Esempio n. 16
0
        private string GetPlayerElementPrefix(SocialTabs selectedTab)
        {
            string result;

            if (selectedTab != SocialTabs.Friends)
            {
                if (selectedTab != SocialTabs.Tournament)
                {
                    result = "player_";
                }
                else
                {
                    result = "tournament_player_";
                }
            }
            else
            {
                result = "friend_";
            }
            return(result);
        }
Esempio n. 17
0
 public LeaderboardRowSquadInviteView(AbstractLeaderboardScreen screen, UXGrid grid, UXElement templateItem, SocialTabs tab, FactionToggle faction, int position, SquadInvite invite, Squad squad) : base(screen, grid, templateItem, tab, faction, position, squad)
 {
     this.invite = invite;
     base.InitBaseView();
     this.InitFullView();
 }
Esempio n. 18
0
 public override void Close(object modalResult)
 {
     this.curTab = SocialTabs.Empty;
     base.Close(modalResult);
 }
Esempio n. 19
0
 public LeaderboardRowFacebookView(AbstractLeaderboardScreen screen, UXGrid grid, UXElement templateItem, SocialTabs tab) : base(screen, grid, templateItem, tab, FactionToggle.All, 0, false)
 {
     this.InitView();
 }
Esempio n. 20
0
 protected SocialTabInfo GetTabInfo(SocialTabs socialTab)
 {
     return(this.tabs[socialTab]);
 }
Esempio n. 21
0
 public LeaderboardRowPlayerView(AbstractLeaderboardScreen screen, UXGrid grid, UXElement templateItem, SocialTabs tab, FactionToggle faction, int position, PlayerLBEntity player, string planetUid) : base(screen, grid, templateItem, tab, faction, position, true)
 {
     this.player    = player;
     this.planetUid = planetUid;
     this.InitView();
 }