public void addPlayers() { this.wallScrollArea.clearControls(); int y = 0; this.lineList.Clear(); int yourVotes = 0; if (this.parishMembers != null) { foreach (ParishMember member in this.parishMembers) { if (member.userID == RemoteServices.Instance.UserID) { yourVotes = member.numSpareVotes; break; } } if ((GameEngine.Instance.World.getRank() + 1) < GameEngine.Instance.LocalWorldData.MinParishVoteRank) { int minParishVoteRank = GameEngine.Instance.LocalWorldData.MinParishVoteRank; yourVotes = 0; this.votesAvailableLabel.Text = SK.Text("ParishPanel_Rank_Required", "Rank Required") + " : " + Rankings.getRankingName(minParishVoteRank - 1) + " ( " + minParishVoteRank.ToString() + " )"; this.votesAvailableLabel.Size = new Size(400, 40); this.votesAvailableLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.voteCapLabelValue.Visible = false; this.voteCapLabel.Visible = false; this.votesAvailableLabelValue.Visible = false; } else { this.votesAvailableLabelValue.Text = yourVotes.ToString(); } this.parishMembers.Sort(this.parishMemberComparer); int position = 0; foreach (ParishMember member2 in this.parishMembers) { VoteLine control = new VoteLine(); if (y != 0) { y += 5; } control.Position = new Point(0, y); if (member2.numVotesReceived > this.voteCap) { int voteCap = this.voteCap; } control.init(member2.userName, member2.userID, member2.rank, member2.points, this.votingAllowed, member2.numSpareVotes, member2.numVotesReceived, member2.factionID, yourVotes, position, this); this.wallScrollArea.addControl(control); y += control.Height; this.lineList.Add(control); position++; } } this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, y); if (y < this.wallScrollBar.Height) { this.wallScrollBar.Visible = false; } else { this.wallScrollBar.Visible = true; this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height; this.wallScrollBar.Max = y - this.wallScrollBar.Height; } this.wallScrollArea.invalidate(); this.wallScrollBar.invalidate(); this.stewardLabel.Text = SK.Text("ParishWallPanel_Steward", "Steward") + " : " + this.currentLeaderName; this.m_userIDOnCurrent = this.currentLeaderID; TimeSpan span = (TimeSpan)(VillageMap.getCurrentServerTime() - this.lastProclamationTime); if (this.currentLeaderID == RemoteServices.Instance.UserID) { this.proclamationButton.Visible = true; if (span.TotalDays >= 7.0) { this.proclamationButton.Enabled = true; this.proclamationLabel.Visible = false; } else { this.proclamationButton.Enabled = false; this.proclamationLabel.Visible = true; } } else { this.proclamationButton.Visible = false; this.proclamationLabel.Visible = false; } this.update(); }
public void addPlayers() { this.wallScrollArea.clearControls(); int y = 0; this.lineList.Clear(); int yourVotes = 0; if (this.provinceMembers != null) { foreach (ParishMember member in this.provinceMembers) { if (member.userID == RemoteServices.Instance.UserID) { yourVotes = member.numSpareVotes; break; } } this.provinceMembers.Sort(this.parishMemberComparer); int position = 0; foreach (ParishMember member2 in this.provinceMembers) { VoteLine control = new VoteLine(); if (y != 0) { y += 5; } control.Position = new Point(0, y); int numVotesReceived = member2.numVotesReceived; if (numVotesReceived > this.voteCap) { numVotesReceived = this.voteCap; } control.init(member2.userName, member2.userID, member2.rank, member2.points, this.votingAllowed, member2.numSpareVotes, numVotesReceived, member2.areaID, member2.factionID, yourVotes, position, this); this.wallScrollArea.addControl(control); y += control.Height; this.lineList.Add(control); position++; } } this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, y); if (y < this.wallScrollBar.Height) { this.wallScrollBar.Visible = false; } else { this.wallScrollBar.Visible = true; this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height; this.wallScrollBar.Max = y - this.wallScrollBar.Height; } this.wallScrollArea.invalidate(); this.wallScrollBar.invalidate(); this.stewardLabel.Text = SK.Text("ParishWallPanel_Governor", "Governor") + " : " + this.currentLeaderName; this.m_userIDOnCurrent = this.currentLeaderID; TimeSpan span = (TimeSpan)(VillageMap.getCurrentServerTime() - this.lastProclamationTime); if (this.currentLeaderID == RemoteServices.Instance.UserID) { this.proclamationButton.Visible = true; if (span.TotalDays >= 3.0) { this.proclamationButton.Enabled = true; this.proclamationLabel.Visible = false; } else { this.proclamationButton.Enabled = false; this.proclamationLabel.Visible = true; } } else { this.proclamationButton.Visible = false; this.proclamationLabel.Visible = false; } this.update(); }