public void addPlayers() { this.wallScrollArea.clearControls(); this.appScrollArea.clearControls(); int y = 0; int num2 = 0; this.lineList.Clear(); this.lineList2.Clear(); if (GameEngine.Instance.World.getRank() >= 6) { int position = 0; FactionInviteData[] factionInvites = GameEngine.Instance.World.FactionInvites; if (factionInvites != null) { foreach (FactionInviteData data in factionInvites) { FactionData factionData = GameEngine.Instance.World.getFaction(data.factionID); if (factionData != null) { FactionInviteLine control = new FactionInviteLine(); if (y != 0) { y += 5; } control.Position = new Point(0, y); control.init(factionData, position, this, true); this.wallScrollArea.addControl(control); y += control.Height; this.lineList.Add(control); position++; } } } int num4 = 0; List<FactionInviteData> factionApplications = GameEngine.Instance.World.FactionApplications; if (factionApplications != null) { foreach (FactionInviteData data3 in factionApplications) { FactionData data4 = GameEngine.Instance.World.getFaction(data3.factionID); if (data4 != null) { FactionInviteLine line2 = new FactionInviteLine(); if (num2 != 0) { num2 += 5; } line2.Position = new Point(0, num2); line2.init(data4, num4, this, false); this.appScrollArea.addControl(line2); num2 += line2.Height; this.lineList2.Add(line2); num4++; } } } } 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.appScrollArea.Size = new Size(this.appScrollArea.Width, num2); if (y < this.appScrollBar.Height) { this.appScrollBar.Visible = false; } else { this.appScrollBar.Visible = true; this.appScrollBar.NumVisibleLines = this.appScrollBar.Height; this.appScrollBar.Max = num2 - this.appScrollBar.Height; } this.appScrollArea.invalidate(); this.appScrollBar.invalidate(); this.update(); base.Invalidate(); }
public void addPlayers() { this.wallScrollArea.clearControls(); this.appScrollArea.clearControls(); int y = 0; int num2 = 0; this.lineList.Clear(); this.lineList2.Clear(); if (GameEngine.Instance.World.getRank() >= 6) { int position = 0; FactionInviteData[] factionInvites = GameEngine.Instance.World.FactionInvites; if (factionInvites != null) { foreach (FactionInviteData data in factionInvites) { FactionData factionData = GameEngine.Instance.World.getFaction(data.factionID); if (factionData != null) { FactionInviteLine control = new FactionInviteLine(); if (y != 0) { y += 5; } control.Position = new Point(0, y); control.init(factionData, position, this, true); this.wallScrollArea.addControl(control); y += control.Height; this.lineList.Add(control); position++; } } } int num4 = 0; List <FactionInviteData> factionApplications = GameEngine.Instance.World.FactionApplications; if (factionApplications != null) { foreach (FactionInviteData data3 in factionApplications) { FactionData data4 = GameEngine.Instance.World.getFaction(data3.factionID); if (data4 != null) { FactionInviteLine line2 = new FactionInviteLine(); if (num2 != 0) { num2 += 5; } line2.Position = new Point(0, num2); line2.init(data4, num4, this, false); this.appScrollArea.addControl(line2); num2 += line2.Height; this.lineList2.Add(line2); num4++; } } } } 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.appScrollArea.Size = new Size(this.appScrollArea.Width, num2); if (y < this.appScrollBar.Height) { this.appScrollBar.Visible = false; } else { this.appScrollBar.Visible = true; this.appScrollBar.NumVisibleLines = this.appScrollBar.Height; this.appScrollBar.Max = num2 - this.appScrollBar.Height; } this.appScrollArea.invalidate(); this.appScrollBar.invalidate(); this.update(); base.Invalidate(); }