public void init(int position, AllVassalsPanel parent, int yourVillageID, int villageID, double honourPerSecond, int numPeasants, int numArchers, int numPikemen, int numSwordsmen, int numCatapults, string username) { this.m_parent = parent; this.m_position = position; this.m_villageID = villageID; this.m_yourVillageID = yourVillageID; this.ClipVisible = true; this.clearControls(); if ((position & 1) == 0) { this.backgroundImage.Image = (Image)GFXLibrary.brown_lineitem_strip_02_light; } else { this.backgroundImage.Image = (Image)GFXLibrary.brown_lineitem_strip_02_dark; } this.backgroundImage.Position = new Point(0, 0); base.addControl(this.backgroundImage); this.Size = this.backgroundImage.Size; this.lblYourVillage.Text = GameEngine.Instance.World.getVillageNameOrType(this.m_yourVillageID); this.lblYourVillage.Color = ARGBColors.Black; this.lblYourVillage.RolloverColor = ARGBColors.White; this.lblYourVillage.Position = new Point(9, 0); this.lblYourVillage.Size = new Size(290, this.backgroundImage.Height); this.lblYourVillage.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblYourVillage.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.lblYourVillage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lblYourVillage_Click), "AllVassalsPanel_village"); this.backgroundImage.addControl(this.lblYourVillage); this.lblVillage.Text = GameEngine.Instance.World.getVillageNameOrType(villageID); if (username.Length > 0) { this.lblVillage.Text = this.lblVillage.Text + " (" + username + ")"; } this.lblVillage.Color = ARGBColors.Black; this.lblVillage.RolloverColor = ARGBColors.White; this.lblVillage.Position = new Point(0x117, 0); this.lblVillage.Size = new Size(290, this.backgroundImage.Height); this.lblVillage.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblVillage.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.lblVillage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lblVillage_Click), "AllVassalsPanel_other_village"); this.backgroundImage.addControl(this.lblVillage); this.lblPeasants.Text = numPeasants.ToString(); this.lblPeasants.Color = ARGBColors.Black; this.lblPeasants.RolloverColor = ARGBColors.White; this.lblPeasants.Position = new Point(0x249, 0); this.lblPeasants.Size = new Size(0x37, this.backgroundImage.Height); this.lblPeasants.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblPeasants.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.lblPeasants.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopClick), "AllVassalsPanel_troops"); this.backgroundImage.addControl(this.lblPeasants); this.lblArchers.Text = numArchers.ToString(); this.lblArchers.Color = ARGBColors.Black; this.lblArchers.RolloverColor = ARGBColors.White; this.lblArchers.Position = new Point(0x285, 0); this.lblArchers.Size = new Size(0x37, this.backgroundImage.Height); this.lblArchers.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblArchers.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.lblArchers.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopClick), "AllVassalsPanel_troops"); this.backgroundImage.addControl(this.lblArchers); this.lblPikemen.Text = numPikemen.ToString(); this.lblPikemen.Color = ARGBColors.Black; this.lblPikemen.RolloverColor = ARGBColors.White; this.lblPikemen.Position = new Point(0x2c1, 0); this.lblPikemen.Size = new Size(0x37, this.backgroundImage.Height); this.lblPikemen.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblPikemen.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.lblPikemen.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopClick), "AllVassalsPanel_troops"); this.backgroundImage.addControl(this.lblPikemen); this.lblSwordsmen.Text = numSwordsmen.ToString(); this.lblSwordsmen.Color = ARGBColors.Black; this.lblSwordsmen.RolloverColor = ARGBColors.White; this.lblSwordsmen.Position = new Point(0x2fd, 0); this.lblSwordsmen.Size = new Size(0x37, this.backgroundImage.Height); this.lblSwordsmen.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblSwordsmen.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.lblSwordsmen.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopClick), "AllVassalsPanel_troops"); this.backgroundImage.addControl(this.lblSwordsmen); this.lblCatapults.Text = numCatapults.ToString(); this.lblCatapults.Color = ARGBColors.Black; this.lblCatapults.RolloverColor = ARGBColors.White; this.lblCatapults.Position = new Point(0x339, 0); this.lblCatapults.Size = new Size(0x37, this.backgroundImage.Height); this.lblCatapults.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular); this.lblCatapults.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.lblCatapults.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopClick), "AllVassalsPanel_troops"); this.backgroundImage.addControl(this.lblCatapults); base.invalidate(); }
public void init(bool resized) { int height = base.Height; instance = this; base.clearControls(); this.backgroundImage.Image = (Image)GFXLibrary.body_background_002; this.backgroundImage.Size = new Size(base.Width, height - 40); this.backgroundImage.Tile = true; this.backgroundImage.Position = new Point(0, 40); base.addControl(this.backgroundImage); this.backgroundLeftEdge.Image = (Image)GFXLibrary.body_background_canvas_left_edge; this.backgroundLeftEdge.Position = new Point(0, 0); this.backgroundLeftEdge.Size = new Size(this.backgroundLeftEdge.Image.Width, height - 40); this.backgroundLeftEdge.Tile = true; this.backgroundImage.addControl(this.backgroundLeftEdge); this.headerImage.Size = new Size(base.Width, 40); this.headerImage.Position = new Point(0, 0); base.addControl(this.headerImage); this.headerImage.CreateX((Image)GFXLibrary.mail_top_drag_bar_left, (Image)GFXLibrary.mail_top_drag_bar_middle, (Image)GFXLibrary.mail_top_drag_bar_right, -2, 2); InterfaceMgr.Instance.getSelectedMenuVillage(); this.parishNameLabel.Text = SK.Text("Vassals_Overview", "Vassals Overview"); this.parishNameLabel.Color = ARGBColors.White; this.parishNameLabel.DropShadowColor = ARGBColors.Black; this.parishNameLabel.Position = new Point(20, 0); this.parishNameLabel.Size = new Size(base.Width - 40, 40); this.parishNameLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular); this.parishNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerImage.addControl(this.parishNameLabel); this.blockYSize = (height - 40) - 0x38; this.headerLabelsImage.Size = new Size((base.Width - 0x19) - 0x17, 0x1c); this.headerLabelsImage.Position = new Point(0x19, 5); this.backgroundImage.addControl(this.headerLabelsImage); this.headerLabelsImage.Create((Image)GFXLibrary.brown_mail2_field_bar_mail_left, (Image)GFXLibrary.brown_mail2_field_bar_mail_middle, (Image)GFXLibrary.brown_mail2_field_bar_mail_right); this.divider2Image.Image = (Image)GFXLibrary.brown_mail2_field_bar_mail_divider; this.divider2Image.Position = new Point(580, 0); this.headerLabelsImage.addControl(this.divider2Image); this.yourVassalsLabel.Text = SK.Text("VassalControlPanel_Your_Vassals", "Your Vassals"); this.yourVassalsLabel.Color = ARGBColors.Black; this.yourVassalsLabel.Position = new Point(12, -3); this.yourVassalsLabel.Size = new Size(0xdf, this.headerLabelsImage.Height); this.yourVassalsLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.yourVassalsLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; this.headerLabelsImage.addControl(this.yourVassalsLabel); this.vassalScrollArea.Position = new Point(0x19, 40); this.vassalScrollArea.Size = new Size(0x393, (this.blockYSize - 40) - 10); this.vassalScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(0x393, (this.blockYSize - 40) - 10)); this.backgroundImage.addControl(this.vassalScrollArea); int num2 = this.vassalScrollBar.Value; this.vassalScrollBar.Position = new Point(0x3af, 40); this.vassalScrollBar.Size = new Size(0x18, (this.blockYSize - 40) - 10); this.backgroundImage.addControl(this.vassalScrollBar); this.vassalScrollBar.Value = 0; this.vassalScrollBar.Max = 100; this.vassalScrollBar.NumVisibleLines = 0x19; this.vassalScrollBar.Create(null, null, null, (Image)GFXLibrary.brown_24wide_thumb_top, (Image)GFXLibrary.brown_24wide_thumb_middle, (Image)GFXLibrary.brown_24wide_thumb_bottom); this.vassalScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved)); this.smallPeasantImage.Image = (Image)GFXLibrary.armies_screen_troops; this.smallPeasantImage.Position = new Point(0x25b, -10); this.smallPeasantImage.ClipRect = new Rectangle(0, 0, (this.smallPeasantImage.Image.Width * 5) / 6, this.smallPeasantImage.Image.Height); this.headerLabelsImage.addControl(this.smallPeasantImage); if (resized) { this.vassalScrollBar.Value = num2; } this.btnClose.ImageNorm = (Image)GFXLibrary.brown_misc_button_blue_210wide_normal; this.btnClose.ImageOver = (Image)GFXLibrary.brown_misc_button_blue_210wide_over; this.btnClose.ImageClick = (Image)GFXLibrary.brown_misc_button_blue_210wide_pushed; this.btnClose.Position = new Point(base.Width - 230, ((height - 40) - 40) - 4); this.btnClose.Text.Text = SK.Text("GENERIC_Close", "Close"); this.btnClose.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.btnClose.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); this.btnClose.TextYOffset = -3; this.btnClose.Text.Color = ARGBColors.Black; this.btnClose.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "AllVassalsPanel_close"); this.backgroundImage.addControl(this.btnClose); this.cachedVassalInfo = null; RemoteServices.Instance.set_VassalInfo_UserCallBack(new RemoteServices.VassalInfo_UserCallBack(this.vassalInfoCallBack)); if (GameEngine.Instance.Village != null) { RemoteServices.Instance.VassalInfo(-1); } this.reAddVassals(); }