Esempio n. 1
0
 public FrmStatsLadder()
 {
     this.mSelectedRating = null;
     this.mLastRating = -1;
     this.mCategory = null;
     this.mCurrentPage = 0;
     this.mCurrentDataSet = null;
     this.components = null;
     this.InitializeComponent();
 }
Esempio n. 2
0
 public FrmStatsLadder(FrmMain mainForm, string category) : base(mainForm)
 {
     this.mSelectedRating = null;
     this.mLastRating = -1;
     this.mCategory = null;
     this.mCurrentPage = 0;
     this.mCurrentDataSet = null;
     this.components = null;
     this.InitializeComponent();
     this.SetCategory(category, true);
 }
Esempio n. 3
0
 internal void Construct()
 {
     if (GameInformation.SelectedGame.IsSpaceSiege || GameInformation.SelectedGame.IsChatOnly)
     {
         this.gpgLabel1.Hide();
         this.gpgLabel2.Hide();
         this.gpgLabel3.Hide();
         this.gpgLabel6.Hide();
         this.gpgLabel7.Hide();
         this.gpgLabel8.Hide();
         this.gpgLabel9.Hide();
         this.gpgLabel10.Hide();
         this.gpgLabel11.Hide();
         this.gpgPanelAwards.Hide();
         this.skinLabel1.Hide();
         this.statDiconnectPct.Hide();
         this.statDisconnects.Hide();
         this.statDraws.Hide();
         this.statLosses.Hide();
         this.statRank.Hide();
         this.statRating.Hide();
         this.statTotalGames.Hide();
         this.statWinPct.Hide();
         this.statWins.Hide();
         this.skinButtonWebStats.Hide();
     }
     if (!this.ViewList.Contains(this.CurrentPlayer))
     {
         this.ViewList.AddLast(new LinkedListNode<PlayerView>(this.CurrentPlayer));
     }
     if (!this.ViewList.Last.Value.Equals(this.CurrentPlayer))
     {
         this.skinButtonNextProfile.Enabled = true;
         base.ttDefault.SetToolTip(this.skinButtonNextProfile, Loc.Get(string.Format("<LOC>Forward to {0}", this.ViewList.Find(this.CurrentPlayer).Next.Value.Player.Name)));
     }
     else
     {
         this.skinButtonNextProfile.Enabled = false;
         base.ttDefault.SetToolTip(this.skinButtonNextProfile, "");
     }
     if (!this.ViewList.First.Value.Equals(this.CurrentPlayer))
     {
         this.skinButtonPreviousProfile.Enabled = true;
         base.ttDefault.SetToolTip(this.skinButtonPreviousProfile, Loc.Get(string.Format("<LOC>Back to {0}", this.ViewList.Find(this.CurrentPlayer).Previous.Value.Player.Name)));
     }
     else
     {
         this.skinButtonPreviousProfile.Enabled = false;
         base.ttDefault.SetToolTip(this.skinButtonPreviousProfile, "");
     }
     User player = this.CurrentPlayer.Player;
     ThreadPool.QueueUserWorkItem(delegate (object s) {
         if (player.Description == null)
         {
             player.Description = DataAccess.GetString("GetPlayerDescription", new object[] { player.ID });
         }
         if (!this.Disposing && !this.IsDisposed)
         {
             PlayerDisplayAwards awards = new PlayerDisplayAwards(player);
             Image avatar = awards.Avatar.Image;
             this.Invoke((VGen0)delegate {
                 this.gpgPictureBoxAvatar.Image = avatar;
                 if (((player.Description == null) || (player.Description == "")) || (player.Description == "(null)"))
                 {
                     this.gpgLabelDescription.Text = Loc.Get("<LOC>(no description)");
                     this.gpgTextAreaDescription.Text = "";
                 }
                 else
                 {
                     this.gpgLabelDescription.Text = player.Description;
                     this.gpgTextAreaDescription.Text = player.Description;
                 }
             });
             this.CurrentPlayer.Friends = new QuazalQuery("GetFriendsByPlayerID", new object[] { player.ID }).GetObjects<User>();
             this.pnlUserList.ClearData();
             this.pnlUserList.AddUsers(this.CurrentPlayer.Friends);
             this.pnlUserList.RefreshData();
         }
     });
     this.Text = string.Format(Loc.Get("<LOC>Profile: {0}"), player.Name);
     this.Refresh();
     this.skinGroupPanelPlayer.Text = player.Name;
     this.gpgPictureBoxSave.Visible = false;
     this.gpgPictureBoxCancel.Visible = false;
     if (player.Equals(User.Current))
     {
         this.gpgPictureBoxEdit.Visible = true;
         this.gpgPanelDescription.Width = this.gpgPictureBoxEdit.Left - (this.gpgPanelDescription.Left + 4);
         if (!(GameInformation.SelectedGame.IsSpaceSiege || GameInformation.SelectedGame.IsChatOnly))
         {
             base.ttDefault.SetToolTip(this.gpgPictureBoxAvatar, Loc.Get("<LOC>Click here to change your avatar"));
             this.gpgPictureBoxAvatar.Cursor = Cursors.Hand;
         }
         this.gpgPictureBoxAvatar.Click += new EventHandler(this.Avatar_Click);
     }
     else
     {
         this.gpgPictureBoxEdit.Visible = false;
         this.gpgPanelDescription.Width = this.gpgPictureBoxEdit.Right - this.gpgPanelDescription.Left;
         base.ttDefault.SetToolTip(this.gpgPictureBoxAvatar, Loc.Get(""));
         this.gpgPictureBoxAvatar.Cursor = Cursors.Default;
         this.gpgPictureBoxAvatar.Click -= new EventHandler(this.Avatar_Click);
     }
     if (player.IsInClan)
     {
         this.pictureBoxClanRank.Visible = true;
         this.gpgLabelClanTag.Visible = true;
         this.gpgLabelClanTag.Text = player.ClanAbbreviation;
         this.gpgLabelClanTag.Left = (this.skinGroupPanelPlayer.TextPadding.Left + this.skinGroupPanelPlayer.HeaderLabel.TextWidth) + 8;
         this.gpgLabelClanTag.BringToFront();
         this.gpgLabelClanTag.ForeColor = Program.Settings.Chat.Appearance.ClanColor;
         base.ttDefault.SetToolTip(this.gpgLabelClanTag, player.ClanName);
         string imageSource = ClanRanking.FindBySeniority(player.Rank).ImageSource;
         object obj2 = ClanImages.ResourceManager.GetObject(imageSource);
         this.pictureBoxClanRank.Image = obj2 as Image;
         base.ttDefault.SetToolTip(this.pictureBoxClanRank, ClanRanking.FindBySeniority(player.Rank).Description);
         this.pictureBoxClanRank.Left = this.gpgLabelClanTag.Right + 4;
     }
     else
     {
         this.pictureBoxClanRank.Visible = false;
         this.gpgLabelClanTag.Visible = false;
     }
     this.mCurrentStats = this.CurrentPlayer.Player.Rating_1v1;
     this.LoadStats();
     this.LoadLifetimeAwards();
     this.LoadDisplayAwards();
 }
Esempio n. 4
0
 public DlgPlayerProfile(FrmMain mainform) : base(mainform)
 {
     this.components = null;
     this.mCurrentStats = null;
     this.mViewList = new LinkedList<PlayerView>();
     this.PlayerViewLookups = new Dictionary<string, PlayerView>();
     this.FriendContainers = new BoundContainerList();
     this.FriendContainerLookup = new Dictionary<string, TextContainer>();
     this.mSelectedParticipantView = null;
     this.mDescriptionModified = false;
     this.InitializeComponent();
     this.gvFriend_Member.CustomDrawCell += new RowCellCustomDrawEventHandler(this.gvFriend_Member_CustomDrawCell);
     this.gvFriend_Member.MouseDown += new MouseEventHandler(this.SetCurrentGridView);
     this.gvFriend_Member.MouseUp += new MouseEventHandler(this.ChatGridMouseDown);
     this.gvFriend_Member.DoubleClick += new EventHandler(this.gvFriend_Member_DoubleClick);
 }
Esempio n. 5
0
 internal void Construct()
 {
     if (!this.ViewList.Contains(this.CurrentPlayer))
     {
         this.ViewList.AddLast(new LinkedListNode<PlayerView>(this.CurrentPlayer));
     }
     this.skinButtonNext.Visible = !this.ViewList.Last.Value.Equals(this.CurrentPlayer);
     this.skinButtonLast.Visible = !this.ViewList.First.Value.Equals(this.CurrentPlayer);
     User player = this.CurrentPlayer.Player;
     MappedObjectList<User> friends = this.CurrentPlayer.Friends;
     this.Text = string.Format(Loc.Get("<LOC>Profile: {0}"), player.Name);
     this.Refresh();
     this.gpgLabelName.Text = player.Name;
     this.pictureBoxPlayerIcon.Image = player.PlayerIcon;
     if (this.pictureBoxPlayerIcon.Image == null)
     {
         this.pictureBoxPlayerIcon.Visible = false;
     }
     if (((player.Description == null) || (player.Description == "")) || (player.Description == "(null)"))
     {
         this.gpgLabelDescription.Text = Loc.Get("<LOC>(no description)");
         this.gpgTextAreaDescription.Text = "";
     }
     else
     {
         this.gpgLabelDescription.Text = player.Description;
         this.gpgTextAreaDescription.Text = player.Description;
     }
     this.ResizeDescriptionText();
     using (Graphics graphics = base.CreateGraphics())
     {
         this.gpgLabelDescription.Height = Convert.ToInt32(DrawUtil.MeasureString(graphics, this.gpgLabelDescription.Text, this.gpgLabelDescription.Font, (float) this.gpgLabelDescription.Width).Height) + 10;
     }
     if (player.Equals(User.Current))
     {
         this.skinButtonEdit.Visible = true;
         this.gpgPanelEdit.Visible = true;
         this.gpgPanelEdit.Height -= this.gpgTextAreaDescription.Height;
         this.gpgPanelEdit.Panel2Collapsed = true;
     }
     else
     {
         this.skinButtonEdit.Visible = false;
         this.gpgPanelEdit.Visible = false;
     }
     int num = 4;
     if (player.IsInClan)
     {
         this.pictureBoxClanIcon.Visible = true;
         this.pictureBoxClanRank.Visible = true;
         this.gpgLinkLabelClan.Visible = true;
         this.gpgLinkLabelClan.Text = player.ClanAbbreviation;
         this.gpgLinkLabelClan.Location = new Point(this.gpgLabelName.TextWidth + 6, this.gpgLabelName.Top);
         this.gpgLinkLabelClan.Width = this.gpgLinkLabelClan.TextWidth + 4;
         this.gpgLinkLabelClan.BringToFront();
         this.gpgLinkLabelClan.ForeColor = Program.Settings.Chat.Appearance.ClanColor;
         string imageSource = ClanRanking.FindBySeniority(player.Rank).ImageSource;
         object obj2 = ClanImages.ResourceManager.GetObject(imageSource);
         this.pictureBoxClanRank.Image = obj2 as Image;
         this.pictureBoxClanIcon.Visible = false;
         if (this.pictureBoxPlayerIcon.Image != null)
         {
             this.pictureBoxPlayerIcon.Left = ((this.gpgLinkLabelClan.Width - this.pictureBoxClanRank.Width) - num) - this.pictureBoxPlayerIcon.Width;
         }
         this.gpgLinkLabelClan.Refresh();
     }
     else
     {
         this.pictureBoxClanIcon.Visible = false;
         this.pictureBoxClanRank.Visible = false;
         this.gpgLinkLabelClan.Visible = false;
         this.pictureBoxPlayerIcon.Left = this.gpgLinkLabelClan.Width - this.pictureBoxPlayerIcon.Width;
     }
     if (friends.Count > 0)
     {
         this.gvFriend_Member.DetailHeight = 0x1f40;
         this.gpgScrollPanelFriends.Visible = true;
         this.FriendContainers = new BoundContainerList();
         this.FriendContainerLookup = new Dictionary<string, TextContainer>();
         this.gvFriend_Container.Columns["Count"].FilterInfo = new ColumnFilterInfo("[Count] > 0");
         this.gpgScrollPanelFriends.ChildControl = this.gpgGridFriends;
         this.FriendContainerLookup["Online"] = new TextContainer(Loc.Get("<LOC>Friends Online"));
         this.FriendContainers.Add(this.FriendContainerLookup["Online"]);
         this.FriendContainerLookup["Offline"] = new TextContainer(Loc.Get("<LOC>Friends Offline"));
         this.FriendContainers.Add(this.FriendContainerLookup["Offline"]);
         foreach (User user2 in friends)
         {
             this.AddFriendParticipant(user2);
         }
         this.FriendContainerLookup["Online"].Sort();
         this.FriendContainerLookup["Offline"].Sort();
         this.gpgGridFriends.DataSource = null;
         this.gpgGridFriends.DataSource = this.FriendContainers;
     }
     else
     {
         this.backLabelFriends.Text = Loc.Get("<LOC>0 Friends Found");
         this.gpgScrollPanelFriends.Visible = false;
     }
     this.mCurrentStats = this.CurrentPlayer.Player.Rating_1v1;
     this.LoadStats();
 }
Esempio n. 6
0
        private void gvLadder_MouseDown(object sender, MouseEventArgs e)
        {
            GridHitInfo info;
            switch (e.Button)
            {
                case MouseButtons.Left:
                    (sender as GridView).Focus();
                    info = (sender as GridView).CalcHitInfo(e.Location);
                    if (info.InRow)
                    {
                        this.mSelectedRating = (sender as GridView).GetRow(info.RowHandle) as PlayerRating;
                    }
                    break;

                case MouseButtons.Right:
                    (sender as GridView).Focus();
                    info = (sender as GridView).CalcHitInfo(e.Location);
                    if (info.InRow)
                    {
                        this.mSelectedRating = (sender as GridView).GetRow(info.RowHandle) as PlayerRating;
                        int[] selectedRows = this.gvLadder.GetSelectedRows();
                        for (int i = 0; i < selectedRows.Length; i++)
                        {
                            this.gvLadder.UnselectRow(selectedRows[i]);
                        }
                        (sender as GridView).SelectRow(info.RowHandle);
                    }
                    break;
            }
            base.OnMouseDown(e);
        }