public void init(FactionData factionData, int position, bool ally, FactionDiplomacyPanel parent) { this.m_parent = parent; this.m_position = position; this.m_factionData = factionData; this.clearControls(); if ((position & 1) == 0) { this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_light; } else { this.backgroundImage.Image = (Image)GFXLibrary.lineitem_strip_02_dark; } this.backgroundImage.Position = new Point(60, 0); this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); base.addControl(this.backgroundImage); this.Size = this.backgroundImage.Size; this.flagImage.createFromFlagData(factionData.flagData); this.flagImage.Position = new Point(0, 0); this.flagImage.Scale = 0.25; this.flagImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); base.addControl(this.flagImage); this.factionName.Text = factionData.factionName; this.factionName.Color = ARGBColors.Black; this.factionName.Position = new Point(9, 0); this.factionName.Size = new Size(500, this.backgroundImage.Height); this.factionName.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.factionName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.factionName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); this.backgroundImage.addControl(this.factionName); }
public void init(FactionData factionData, int position, bool ally, FactionDiplomacyPanel parent) { this.m_parent = parent; this.m_position = position; this.m_factionData = factionData; this.clearControls(); if ((position & 1) == 0) { this.backgroundImage.Image = (Image) GFXLibrary.lineitem_strip_02_light; } else { this.backgroundImage.Image = (Image) GFXLibrary.lineitem_strip_02_dark; } this.backgroundImage.Position = new Point(60, 0); this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); base.addControl(this.backgroundImage); this.Size = this.backgroundImage.Size; this.flagImage.createFromFlagData(factionData.flagData); this.flagImage.Position = new Point(0, 0); this.flagImage.Scale = 0.25; this.flagImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); base.addControl(this.flagImage); this.factionName.Text = factionData.factionName; this.factionName.Color = ARGBColors.Black; this.factionName.Position = new Point(9, 0); this.factionName.Size = new Size(500, this.backgroundImage.Height); this.factionName.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.factionName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.factionName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick)); this.backgroundImage.addControl(this.factionName); }
public void init(bool resized) { int height = base.Height; this.blockYSize = height / 2; instance = this; base.clearControls(); this.sidebar.addSideBar(4, this); this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5); this.mainBackgroundImage.Position = new Point(0, 0); this.mainBackgroundImage.Size = new Size(base.Width - 200, height); base.addControl(this.mainBackgroundImage); this.backgroundFade.Image = (Image)GFXLibrary.background_top; this.backgroundFade.Position = new Point(0, 0); this.backgroundFade.Size = new Size(base.Width - 200, this.backgroundFade.Image.Height); this.mainBackgroundImage.addControl(this.backgroundFade); this.headerLabelsImage.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 0x1c); this.headerLabelsImage.Position = new Point(0x19, 5); this.mainBackgroundImage.addControl(this.headerLabelsImage); this.headerLabelsImage.Create((Image)GFXLibrary.mail2_field_bar_mail_left, (Image)GFXLibrary.mail2_field_bar_mail_middle, (Image)GFXLibrary.mail2_field_bar_mail_right); this.headerLabelsImage2.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 0x1c); this.headerLabelsImage2.Position = new Point(0x19, this.blockYSize + 5); this.mainBackgroundImage.addControl(this.headerLabelsImage2); this.headerLabelsImage2.Create((Image)GFXLibrary.mail2_field_bar_mail_left, (Image)GFXLibrary.mail2_field_bar_mail_middle, (Image)GFXLibrary.mail2_field_bar_mail_right); this.alliesLabel.Text = SK.Text("FactionDiplomacy_Allies", "Allies"); this.alliesLabel.Color = ARGBColors.Black; this.alliesLabel.Position = new Point(9, -2); this.alliesLabel.Size = new Size(0x143, this.headerLabelsImage.Height); this.alliesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.alliesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.alliesLabel); this.enemiesLabel.Text = SK.Text("FactionDiplomacy_Enemies", "Enemies"); this.enemiesLabel.Color = ARGBColors.Black; this.enemiesLabel.Position = new Point(9, -2); this.enemiesLabel.Size = new Size(0x143, this.headerLabelsImage.Height); this.enemiesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.enemiesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage2.addControl(this.enemiesLabel); InterfaceMgr.Instance.setVillageHeading(SK.Text("AllArmiesPanel_Diplomacy", "Diplomacy")); this.alliesScrollArea.Position = new Point(0x19, 40); this.alliesScrollArea.Size = new Size(0x2cb, (this.blockYSize - 40) - 10); this.alliesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10)); this.mainBackgroundImage.addControl(this.alliesScrollArea); this.mouseWheelOverlay1.Position = this.alliesScrollArea.Position; this.mouseWheelOverlay1.Size = this.alliesScrollArea.Size; this.mouseWheelOverlay1.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved1)); this.mainBackgroundImage.addControl(this.mouseWheelOverlay1); int num1 = this.alliesScrollBar.Value; this.alliesScrollBar.Position = new Point(0x2dd, 40); this.alliesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10); this.mainBackgroundImage.addControl(this.alliesScrollBar); this.alliesScrollBar.Value = 0; this.alliesScrollBar.Max = 100; this.alliesScrollBar.NumVisibleLines = 0x19; this.alliesScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom); this.alliesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved)); this.enemiesScrollArea.Position = new Point(0x19, (0x23 + this.blockYSize) + 5); this.enemiesScrollArea.Size = new Size(0x2cb, (this.blockYSize - 40) - 10); this.enemiesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10)); this.mainBackgroundImage.addControl(this.enemiesScrollArea); this.mouseWheelOverlay2.Position = this.enemiesScrollArea.Position; this.mouseWheelOverlay2.Size = this.enemiesScrollArea.Size; this.mouseWheelOverlay2.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved2)); this.mainBackgroundImage.addControl(this.mouseWheelOverlay2); int num2 = this.enemiesScrollBar.Value; this.enemiesScrollBar.Position = new Point(0x2dd, (0x23 + this.blockYSize) + 5); this.enemiesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10); this.mainBackgroundImage.addControl(this.enemiesScrollBar); this.enemiesScrollBar.Value = 0; this.enemiesScrollBar.Max = 100; this.enemiesScrollBar.NumVisibleLines = 0x19; this.enemiesScrollBar.Create(null, null, null, (Image)GFXLibrary._24wide_thumb_top, (Image)GFXLibrary._24wide_thumb_middle, (Image)GFXLibrary._24wide_thumb_bottom); this.enemiesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.incomingWallScrollBarMoved)); if (!resized) { CustomSelfDrawPanel.FactionPanelSideBar.downloadCurrentFactionInfo(); } this.addPlayers(); }
public void init(bool resized) { int height = base.Height; this.blockYSize = height / 2; instance = this; base.clearControls(); this.sidebar.addSideBar(4, this); this.mainBackgroundImage.FillColor = Color.FromArgb(0x86, 0x99, 0xa5); this.mainBackgroundImage.Position = new Point(0, 0); this.mainBackgroundImage.Size = new Size(base.Width - 200, height); base.addControl(this.mainBackgroundImage); this.backgroundFade.Image = (Image) GFXLibrary.background_top; this.backgroundFade.Position = new Point(0, 0); this.backgroundFade.Size = new Size(base.Width - 200, this.backgroundFade.Image.Height); this.mainBackgroundImage.addControl(this.backgroundFade); this.headerLabelsImage.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 0x1c); this.headerLabelsImage.Position = new Point(0x19, 5); this.mainBackgroundImage.addControl(this.headerLabelsImage); this.headerLabelsImage.Create((Image) GFXLibrary.mail2_field_bar_mail_left, (Image) GFXLibrary.mail2_field_bar_mail_middle, (Image) GFXLibrary.mail2_field_bar_mail_right); this.headerLabelsImage2.Size = new Size(((base.Width - 0x19) - 0x17) - 200, 0x1c); this.headerLabelsImage2.Position = new Point(0x19, this.blockYSize + 5); this.mainBackgroundImage.addControl(this.headerLabelsImage2); this.headerLabelsImage2.Create((Image) GFXLibrary.mail2_field_bar_mail_left, (Image) GFXLibrary.mail2_field_bar_mail_middle, (Image) GFXLibrary.mail2_field_bar_mail_right); this.alliesLabel.Text = SK.Text("FactionDiplomacy_Allies", "Allies"); this.alliesLabel.Color = ARGBColors.Black; this.alliesLabel.Position = new Point(9, -2); this.alliesLabel.Size = new Size(0x143, this.headerLabelsImage.Height); this.alliesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.alliesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.alliesLabel); this.enemiesLabel.Text = SK.Text("FactionDiplomacy_Enemies", "Enemies"); this.enemiesLabel.Color = ARGBColors.Black; this.enemiesLabel.Position = new Point(9, -2); this.enemiesLabel.Size = new Size(0x143, this.headerLabelsImage.Height); this.enemiesLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.enemiesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage2.addControl(this.enemiesLabel); InterfaceMgr.Instance.setVillageHeading(SK.Text("AllArmiesPanel_Diplomacy", "Diplomacy")); this.alliesScrollArea.Position = new Point(0x19, 40); this.alliesScrollArea.Size = new Size(0x2cb, (this.blockYSize - 40) - 10); this.alliesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10)); this.mainBackgroundImage.addControl(this.alliesScrollArea); this.mouseWheelOverlay1.Position = this.alliesScrollArea.Position; this.mouseWheelOverlay1.Size = this.alliesScrollArea.Size; this.mouseWheelOverlay1.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved1)); this.mainBackgroundImage.addControl(this.mouseWheelOverlay1); int num1 = this.alliesScrollBar.Value; this.alliesScrollBar.Position = new Point(0x2dd, 40); this.alliesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10); this.mainBackgroundImage.addControl(this.alliesScrollBar); this.alliesScrollBar.Value = 0; this.alliesScrollBar.Max = 100; this.alliesScrollBar.NumVisibleLines = 0x19; this.alliesScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom); this.alliesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved)); this.enemiesScrollArea.Position = new Point(0x19, (0x23 + this.blockYSize) + 5); this.enemiesScrollArea.Size = new Size(0x2cb, (this.blockYSize - 40) - 10); this.enemiesScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10)); this.mainBackgroundImage.addControl(this.enemiesScrollArea); this.mouseWheelOverlay2.Position = this.enemiesScrollArea.Position; this.mouseWheelOverlay2.Size = this.enemiesScrollArea.Size; this.mouseWheelOverlay2.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved2)); this.mainBackgroundImage.addControl(this.mouseWheelOverlay2); int num2 = this.enemiesScrollBar.Value; this.enemiesScrollBar.Position = new Point(0x2dd, (0x23 + this.blockYSize) + 5); this.enemiesScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10); this.mainBackgroundImage.addControl(this.enemiesScrollBar); this.enemiesScrollBar.Value = 0; this.enemiesScrollBar.Max = 100; this.enemiesScrollBar.NumVisibleLines = 0x19; this.enemiesScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom); this.enemiesScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.incomingWallScrollBarMoved)); if (!resized) { CustomSelfDrawPanel.FactionPanelSideBar.downloadCurrentFactionInfo(); } this.addPlayers(); }