Exemplo n.º 1
0
 public UserListRow(PnlUserList parent, GPG.Multiplayer.Quazal.User user, UserListStyles style, UserListCategories initialCategory)
 {
     this.PlayerAwards = null;
     this.PlayerStatus = null;
     this.mCategory = UserListCategories.Online;
     this.mPreviousRow = null;
     this.mNextRow = null;
     this.mIsSelected = false;
     this.LastCategory = null;
     this.ClanRankImage = null;
     this.Award1Image = null;
     this.Award2Image = null;
     this.Award3Image = null;
     this.AvatarImage = null;
     this.StatusImage = null;
     this.ClanLabelBounds = null;
     this.mParent = parent;
     this.mUser = user;
     this.mStyle = style;
     this.mCategory = initialCategory;
     this.Parent.MouseMove += new MouseEventHandler(this.Parent_MouseMove);
     this.Parent.MouseDown += new MouseEventHandler(this.Parent_MouseDown);
     this.Parent.MouseUp += new MouseEventHandler(this.Parent_MouseUp);
     this.BindToUser(this.User);
 }
Exemplo n.º 2
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();
 }
Exemplo n.º 3
0
 internal void LoadDisplayAwards()
 {
     this.gpgPictureBoxAward1.Image = null;
     base.ttDefault.SetToolTip(this.gpgPictureBoxAward1, "");
     this.gpgPictureBoxAward2.Image = null;
     base.ttDefault.SetToolTip(this.gpgPictureBoxAward2, "");
     this.gpgPictureBoxAward3.Image = null;
     base.ttDefault.SetToolTip(this.gpgPictureBoxAward3, "");
     if (!GameInformation.SelectedGame.IsSpaceSiege && !GameInformation.SelectedGame.IsChatOnly)
     {
         ThreadPool.QueueUserWorkItem(delegate (object s) {
             PlayerDisplayAwards awards = new PlayerDisplayAwards(this.CurrentPlayer.Player);
             Image img = null;
             if (awards.Award1Specified)
             {
                 img = awards.Award1.SmallImage;
             }
             else if (this.CurrentPlayer.Player.Equals(User.Current))
             {
                 img = AwardsImages.award_empty;
             }
             base.Invoke((VGen0)delegate {
                 this.gpgPictureBoxAward1.Image = img;
                 if (awards.Award1Specified)
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward1, awards.Award1.AchievementDescription);
                 }
                 else if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward1, Loc.Get("<LOC>Click here to set this display award."));
                 }
                 if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.gpgPictureBoxAward1.Cursor = Cursors.Hand;
                     this.gpgPictureBoxAward1.Click -= new EventHandler(this.DisplayAwardClick);
                     this.gpgPictureBoxAward1.Click += new EventHandler(this.DisplayAwardClick);
                 }
                 else
                 {
                     this.gpgPictureBoxAward1.Cursor = Cursors.Default;
                     this.gpgPictureBoxAward1.Click -= new EventHandler(this.DisplayAwardClick);
                 }
             });
             img = null;
             if (awards.Award2Specified)
             {
                 img = awards.Award2.SmallImage;
             }
             else if (this.CurrentPlayer.Player.Equals(User.Current))
             {
                 img = AwardsImages.award_empty;
             }
             base.Invoke((VGen0)delegate {
                 this.gpgPictureBoxAward2.Image = img;
                 if (awards.Award2Specified)
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward2, awards.Award2.AchievementDescription);
                 }
                 else if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward2, Loc.Get("<LOC>Click here to set this display award."));
                 }
                 if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.gpgPictureBoxAward2.Cursor = Cursors.Hand;
                     this.gpgPictureBoxAward2.Click -= new EventHandler(this.DisplayAwardClick);
                     this.gpgPictureBoxAward2.Click += new EventHandler(this.DisplayAwardClick);
                 }
                 else
                 {
                     this.gpgPictureBoxAward2.Cursor = Cursors.Default;
                     this.gpgPictureBoxAward2.Click -= new EventHandler(this.DisplayAwardClick);
                 }
             });
             img = null;
             if (awards.Award3Specified)
             {
                 img = awards.Award3.SmallImage;
             }
             else if (this.CurrentPlayer.Player.Equals(User.Current))
             {
                 img = AwardsImages.award_empty;
             }
             base.Invoke((VGen0)delegate {
                 this.gpgPictureBoxAward3.Image = img;
                 if (awards.Award3Specified)
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward3, awards.Award3.AchievementDescription);
                 }
                 else if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.ttDefault.SetToolTip(this.gpgPictureBoxAward3, Loc.Get("<LOC>Click here to set this display award."));
                 }
                 if (this.CurrentPlayer.Player.Equals(User.Current))
                 {
                     this.gpgPictureBoxAward3.Cursor = Cursors.Hand;
                     this.gpgPictureBoxAward3.Click -= new EventHandler(this.DisplayAwardClick);
                     this.gpgPictureBoxAward3.Click += new EventHandler(this.DisplayAwardClick);
                 }
                 else
                 {
                     this.gpgPictureBoxAward3.Cursor = Cursors.Default;
                     this.gpgPictureBoxAward3.Click -= new EventHandler(this.DisplayAwardClick);
                 }
             });
         });
     }
 }
Exemplo n.º 4
0
 public void BindToUser(GPG.Multiplayer.Quazal.User user, UserListCategories initialCategory)
 {
     this.mUser = user;
     this.mCategory = initialCategory;
     this.Award1Image = null;
     this.Award2Image = null;
     this.Award3Image = null;
     try
     {
         this.NameColor = Program.Settings.Chat.Appearance.DefaultColor;
         this.NameFont = DefaultFont;
         this.PlayerAwards = new PlayerDisplayAwards(user);
         if (!AvatarCache.ContainsKey(this.PlayerAwards.Avatar.ID))
         {
             AvatarCache[this.PlayerAwards.Avatar.ID] = DrawUtil.CopyImage(this.PlayerAwards.Avatar.Image);
         }
         this.AvatarImage = AvatarCache[this.PlayerAwards.Avatar.ID];
         if (this.PlayerAwards.Award1Specified)
         {
             this.Award1Image = this.PlayerAwards.Award1.SmallImage;
         }
         if (this.PlayerAwards.Award2Specified)
         {
             this.Award2Image = this.PlayerAwards.Award2.SmallImage;
         }
         if (this.PlayerAwards.Award3Specified)
         {
             this.Award3Image = this.PlayerAwards.Award3.SmallImage;
         }
         if (!(((!user.IsAway && !user.IsDND) && !user.IsIgnored) && user.Online))
         {
             this.NameColor = Program.Settings.Chat.Appearance.UnavailableColor;
             this.NameFont = DefaultFont;
         }
         else if (user.IsAdmin || ((Chatroom.InChatroom && !Chatroom.Current.IsPersistent) && user.IsChannelOperator))
         {
             this.NameColor = Program.Settings.Chat.Appearance.AdminColor;
             this.NameFont = AdminFont;
         }
         else if (user.IsModerator)
         {
             this.NameColor = Program.Settings.Chat.Appearance.ModeratorColor;
             this.NameFont = Program.Settings.Chat.Appearance.ModeratorFont;
         }
         else
         {
             this.NameColor = Program.Settings.Chat.Appearance.DefaultColor;
             this.NameFont = DefaultFont;
         }
         if (this.NameColor == Color.Empty)
         {
             this.NameColor = Program.Settings.Chat.Appearance.DefaultColor;
         }
         if (this.NameFont == null)
         {
             this.NameFont = DefaultFont;
         }
         this.PlayerStatus = UserStatus.GetStatus(user);
         if (this.PlayerStatus != null)
         {
             this.StatusImage = this.PlayerStatus.Icon;
         }
     }
     catch (Exception exception)
     {
         ErrorLog.WriteLine(exception);
     }
 }