public void closeFormationPopup() { if (!this.formationPopupClosing) { this.formationPopupClosing = true; if (this.isPopupWindowOpenAndClose(this.m_formationPopup)) { GameEngine.Instance.EnableMouseClicks(); this.closeGreyOut(); } this.m_formationPopup = null; this.formationPopupClosing = false; } }
public void init(FormationPopup parent) { this.m_parent = parent; base.Size = this.m_parent.Size; this.BackColor = ARGBColors.Transparent; CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage { Alpha = 0.1f, Image = (Image)GFXLibrary.formations_img, Scale = 5.0, Position = new Point(0, 0), Size = base.Size }; base.addControl(control); this.manageLabel.Text = SK.Text("Formations_Manage_Box", "Manage Formations"); this.manageLabel.Color = ARGBColors.White; this.manageLabel.DropShadowColor = ARGBColors.Black; this.manageLabel.Position = new Point(base.Width / 3, 5); this.manageLabel.Size = new Size(base.Width / 3, 0x18); this.manageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.manageLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); base.addControl(this.manageLabel); this.storedLabel.Text = SK.Text("Formations_Stored", "Stored Formations"); this.storedLabel.Color = ARGBColors.White; this.storedLabel.DropShadowColor = ARGBColors.Black; this.storedLabel.Position = new Point(base.Width / 3, 0x19); this.storedLabel.Size = new Size(base.Width / 3, 0x18); this.storedLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.storedLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); base.addControl(this.storedLabel); this.storedList.Size = new Size(190, 0xd8); this.storedList.Position = new Point((base.Width / 2) - (this.storedList.Width / 2), 0x2d); base.addControl(this.storedList); this.storedList.Create(12, 0x12); this.storedList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listClick)); this.storedList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listDoubleClick)); this.loadButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.loadButton.ImageOver = (Image)GFXLibrary.button_132_over; this.loadButton.ImageClick = (Image)GFXLibrary.button_132_in; this.loadButton.setSizeToImage(); this.loadButton.Position = new Point((base.Width / 2) - (this.loadButton.Width / 2), this.storedList.Rectangle.Bottom + 5); this.loadButton.Text.Text = SK.Text("Formations_Load", "Load Formation"); this.loadButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.loadButton.TextYOffset = -2; this.loadButton.Text.Color = ARGBColors.Black; this.loadButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.loadClick), "Formation_Load"); this.loadButton.Enabled = true; base.addControl(this.loadButton); this.deleteButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.deleteButton.ImageOver = (Image)GFXLibrary.button_132_over; this.deleteButton.ImageClick = (Image)GFXLibrary.button_132_in; this.deleteButton.setSizeToImage(); this.deleteButton.Position = new Point(this.loadButton.Position.X, this.loadButton.Rectangle.Bottom + 5); this.deleteButton.Text.Text = SK.Text("Formations_Delete", "Delete Formation"); this.deleteButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.deleteButton.TextYOffset = -2; this.deleteButton.Text.Color = ARGBColors.Black; this.deleteButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClick), "Formation_Delete"); this.deleteButton.Enabled = true; base.addControl(this.deleteButton); this.renameButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.renameButton.ImageOver = (Image)GFXLibrary.button_132_over; this.renameButton.ImageClick = (Image)GFXLibrary.button_132_in; this.renameButton.setSizeToImage(); this.renameButton.Position = new Point(this.loadButton.Position.X, this.deleteButton.Rectangle.Bottom + 30); this.renameButton.Text.Text = SK.Text("Formations_Rename", "Rename Formation"); this.renameButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.renameButton.TextYOffset = -2; this.renameButton.Text.Color = ARGBColors.Black; this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.renameClick), "Formation_Rename"); this.renameButton.Enabled = true; base.addControl(this.renameButton); this.clearButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.clearButton.ImageOver = (Image)GFXLibrary.button_132_over; this.clearButton.ImageClick = (Image)GFXLibrary.button_132_in; this.clearButton.setSizeToImage(); this.clearButton.Position = new Point(((5 * base.Width) / 6) - (this.clearButton.Width / 2), this.renameButton.Y); this.clearButton.Text.Text = SK.Text("Formations_Clear", "Clear Deployment"); this.clearButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.clearButton.TextYOffset = -2; this.clearButton.Text.Color = ARGBColors.Black; this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearClick), "Formation_Clear"); this.clearButton.Enabled = true; base.addControl(this.clearButton); this.totalsButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.totalsButton.ImageOver = (Image)GFXLibrary.button_132_over; this.totalsButton.ImageClick = (Image)GFXLibrary.button_132_in; this.totalsButton.setSizeToImage(); this.totalsButton.Position = new Point(((5 * base.Width) / 6) - (this.totalsButton.Width / 2), this.deleteButton.Y); this.totalsButton.Text.Text = SK.Text("Formations_CurrentTotals", "Current Totals"); this.totalsButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.totalsButton.TextYOffset = -2; this.totalsButton.Text.Color = ARGBColors.Black; this.totalsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.totalsClick), "Formation_CurrentTotals"); this.totalsButton.Enabled = true; base.addControl(this.totalsButton); this.formationImage.Image = (Image)GFXLibrary.formations_img; this.formationImage.setSizeToImage(); this.formationImage.Position = new Point((base.Width / 6) - (this.formationImage.Width / 2), (this.storedList.Y + (this.storedList.Height / 2)) - (this.formationImage.Height / 2)); base.addControl(this.formationImage); this.createLabel.Text = SK.Text("Formations_New_Box", "Create New Formation"); this.createLabel.Color = ARGBColors.White; this.createLabel.DropShadowColor = ARGBColors.Black; this.createLabel.Position = new Point(0, this.deleteButton.Y); this.createLabel.Size = new Size(base.Width / 3, this.deleteButton.Height); this.createLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER; this.createLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); base.addControl(this.createLabel); this.createNameLabel.Text = SK.Text("Formations_Name", "Formation Name"); this.createNameLabel.Color = ARGBColors.White; this.createNameLabel.DropShadowColor = ARGBColors.Black; this.createNameLabel.Position = new Point(0, this.deleteButton.Y); this.createNameLabel.Size = new Size(base.Width / 3, this.deleteButton.Height); this.createNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER; this.createNameLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); this.createButton.ImageNorm = (Image)GFXLibrary.button_132_normal; this.createButton.ImageOver = (Image)GFXLibrary.button_132_over; this.createButton.ImageClick = (Image)GFXLibrary.button_132_in; this.createButton.setSizeToImage(); this.createButton.Position = new Point((base.Width / 6) - (this.createButton.Width / 2), this.renameButton.Y); this.createButton.Text.Text = SK.Text("Formations_Save", "Save Formation"); this.createButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.createButton.TextYOffset = -2; this.createButton.Text.Color = ARGBColors.Black; this.createButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.createClick), "Formation_Create"); this.createButton.Enabled = true; base.addControl(this.createButton); this.castlePlacePeasantButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_peasent; this.castlePlacePeasantButton.ImageOver = (Image)GFXLibrary.r_building_miltary_peasent; this.castlePlacePeasantButton.setSizeToImage(); this.castlePlacePeasantButton.Position = new Point((((5 * base.Width) / 6) - this.castlePlacePeasantButton.Width) - 10, this.storedLabel.Y); this.castlePlacePeasantButton.Data = 90; this.castlePlacePeasantButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlacePeasantInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlacePeasantInset.Position = new Point(0x37, 0x37); this.castlePlacePeasantLabel.Text = "0"; this.castlePlacePeasantLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlacePeasantLabel.Position = new Point(0, -1); this.castlePlacePeasantLabel.Size = this.castlePlacePeasantInset.Size; this.castlePlacePeasantLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlacePeasantButton); this.castlePlacePeasantInset.addControl(this.castlePlacePeasantLabel); this.castlePlacePeasantButton.addControl(this.castlePlacePeasantInset); this.castlePlacePeasantButton.Active = false; this.castlePlaceArcherButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_archer; this.castlePlaceArcherButton.ImageOver = (Image)GFXLibrary.r_building_miltary_archer; this.castlePlaceArcherButton.setSizeToImage(); this.castlePlaceArcherButton.Position = new Point(this.castlePlacePeasantButton.Rectangle.Right - 10, this.castlePlacePeasantButton.Position.Y); this.castlePlaceArcherButton.Data = 0x5c; this.castlePlaceArcherButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceArcherInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlaceArcherInset.Position = new Point(0x37, 0x37); this.castlePlaceArcherLabel.Text = "0"; this.castlePlaceArcherLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceArcherLabel.Position = new Point(0, -1); this.castlePlaceArcherLabel.Size = this.castlePlaceArcherInset.Size; this.castlePlaceArcherLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceArcherButton); this.castlePlaceArcherInset.addControl(this.castlePlaceArcherLabel); this.castlePlaceArcherButton.addControl(this.castlePlaceArcherInset); this.castlePlaceArcherButton.Active = false; this.castlePlacePikemanButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_pikemen; this.castlePlacePikemanButton.ImageOver = (Image)GFXLibrary.r_building_miltary_pikemen; this.castlePlacePikemanButton.setSizeToImage(); this.castlePlacePikemanButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePeasantButton.Rectangle.Bottom - 0x22); this.castlePlacePikemanButton.Data = 0x5d; this.castlePlacePikemanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlacePikemanInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlacePikemanInset.Position = new Point(0x37, 0x37); this.castlePlacePikemanLabel.Text = "0"; this.castlePlacePikemanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlacePikemanLabel.Position = new Point(0, -1); this.castlePlacePikemanLabel.Size = this.castlePlacePikemanInset.Size; this.castlePlacePikemanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlacePikemanButton); this.castlePlacePikemanInset.addControl(this.castlePlacePikemanLabel); this.castlePlacePikemanButton.addControl(this.castlePlacePikemanInset); this.castlePlacePikemanButton.Active = false; this.castlePlaceSwordsmanButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_swordsman; this.castlePlaceSwordsmanButton.ImageOver = (Image)GFXLibrary.r_building_miltary_swordsman; this.castlePlaceSwordsmanButton.setSizeToImage(); this.castlePlaceSwordsmanButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlacePikemanButton.Y); this.castlePlaceSwordsmanButton.Data = 0x5b; this.castlePlaceSwordsmanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceSwordsmanInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlaceSwordsmanInset.Position = new Point(0x37, 0x37); this.castlePlaceSwordsmanLabel.Text = "0"; this.castlePlaceSwordsmanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceSwordsmanLabel.Position = new Point(0, -1); this.castlePlaceSwordsmanLabel.Size = this.castlePlaceSwordsmanInset.Size; this.castlePlaceSwordsmanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceSwordsmanButton); this.castlePlaceSwordsmanInset.addControl(this.castlePlaceSwordsmanLabel); this.castlePlaceSwordsmanButton.addControl(this.castlePlaceSwordsmanInset); this.castlePlaceSwordsmanButton.Active = false; this.castlePlaceCatapultButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_catapult; this.castlePlaceCatapultButton.ImageOver = (Image)GFXLibrary.r_building_miltary_catapult; this.castlePlaceCatapultButton.setSizeToImage(); this.castlePlaceCatapultButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePikemanButton.Rectangle.Bottom - 0x22); this.castlePlaceCatapultButton.Data = 0x5e; this.castlePlaceCatapultButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceCatapultInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlaceCatapultInset.Position = new Point(0x37, 0x41); this.castlePlaceCatapultLabel.Text = "0"; this.castlePlaceCatapultLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceCatapultLabel.Position = new Point(0, -1); this.castlePlaceCatapultLabel.Size = this.castlePlaceCatapultInset.Size; this.castlePlaceCatapultLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceCatapultButton); this.castlePlaceCatapultInset.addControl(this.castlePlaceCatapultLabel); this.castlePlaceCatapultButton.addControl(this.castlePlaceCatapultInset); this.castlePlaceCatapultButton.Active = false; this.castlePlaceCaptainButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_captain_normal; this.castlePlaceCaptainButton.ImageOver = (Image)GFXLibrary.r_building_miltary_captain_normal; this.castlePlaceCaptainButton.setSizeToImage(); this.castlePlaceCaptainButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlaceCatapultButton.Position.Y); this.castlePlaceCaptainButton.Data = 0x5e; this.castlePlaceCaptainButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceCaptainInset.Image = (Image)GFXLibrary.castlescreen_unit_capsule; this.castlePlaceCaptainInset.Position = new Point(0x37, 0x41); this.castlePlaceCaptainLabel.Text = "0"; this.castlePlaceCaptainLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceCaptainLabel.Position = new Point(0, -1); this.castlePlaceCaptainLabel.Size = this.castlePlaceCaptainInset.Size; this.castlePlaceCaptainLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceCaptainButton); this.castlePlaceCaptainInset.addControl(this.castlePlaceCaptainLabel); this.castlePlaceCaptainButton.addControl(this.castlePlaceCaptainInset); this.castlePlaceCaptainButton.Active = false; this.selectedTitleLabel.Text = ""; this.selectedTitleLabel.Color = ARGBColors.White; this.selectedTitleLabel.DropShadowColor = ARGBColors.Black; this.selectedTitleLabel.Position = new Point((2 * base.Width) / 3, this.manageLabel.Y); this.selectedTitleLabel.Size = new Size(base.Width / 3, 0x18); this.selectedTitleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.selectedTitleLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); base.addControl(this.selectedTitleLabel); this.selectedTroopCountLabel.Text = ""; this.selectedTroopCountLabel.Color = ARGBColors.White; this.selectedTroopCountLabel.DropShadowColor = ARGBColors.Black; this.selectedTroopCountLabel.Position = new Point((2 * base.Width) / 3, this.storedLabel.Y); this.selectedTroopCountLabel.Size = new Size(base.Width / 3, 0x18); this.selectedTroopCountLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.selectedTroopCountLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); base.addControl(this.selectedTroopCountLabel); if (!Program.mySettings.AttackSetupsUpdated) { GameEngine.Instance.CastleAttackerSetup.cleanUpAttackSaveNames(); Program.mySettings.AttackSetupsUpdated = true; } this.loadNames(); this.initTotals(); }
public FormationPopup openFormationPopup() { this.openGreyOutWindow(false); this.closePopupWindow(this.m_formationPopup); this.m_formationPopup = new FormationPopup(); this.positionWindow(this.m_formationPopup, false, false); this.m_formationPopup.Show(this.getGreyOutWindow()); GameEngine.Instance.DisableMouseClicks(); return this.m_formationPopup; }
public void init(FormationPopup parent) { this.m_parent = parent; base.Size = this.m_parent.Size; this.BackColor = ARGBColors.Transparent; CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage { Alpha = 0.1f, Image = (Image) GFXLibrary.formations_img, Scale = 5.0, Position = new Point(0, 0), Size = base.Size }; base.addControl(control); this.manageLabel.Text = SK.Text("Formations_Manage_Box", "Manage Formations"); this.manageLabel.Color = ARGBColors.White; this.manageLabel.DropShadowColor = ARGBColors.Black; this.manageLabel.Position = new Point(base.Width / 3, 5); this.manageLabel.Size = new Size(base.Width / 3, 0x18); this.manageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.manageLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); base.addControl(this.manageLabel); this.storedLabel.Text = SK.Text("Formations_Stored", "Stored Formations"); this.storedLabel.Color = ARGBColors.White; this.storedLabel.DropShadowColor = ARGBColors.Black; this.storedLabel.Position = new Point(base.Width / 3, 0x19); this.storedLabel.Size = new Size(base.Width / 3, 0x18); this.storedLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.storedLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); base.addControl(this.storedLabel); this.storedList.Size = new Size(190, 0xd8); this.storedList.Position = new Point((base.Width / 2) - (this.storedList.Width / 2), 0x2d); base.addControl(this.storedList); this.storedList.Create(12, 0x12); this.storedList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listClick)); this.storedList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listDoubleClick)); this.loadButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.loadButton.ImageOver = (Image) GFXLibrary.button_132_over; this.loadButton.ImageClick = (Image) GFXLibrary.button_132_in; this.loadButton.setSizeToImage(); this.loadButton.Position = new Point((base.Width / 2) - (this.loadButton.Width / 2), this.storedList.Rectangle.Bottom + 5); this.loadButton.Text.Text = SK.Text("Formations_Load", "Load Formation"); this.loadButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.loadButton.TextYOffset = -2; this.loadButton.Text.Color = ARGBColors.Black; this.loadButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.loadClick), "Formation_Load"); this.loadButton.Enabled = true; base.addControl(this.loadButton); this.deleteButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.deleteButton.ImageOver = (Image) GFXLibrary.button_132_over; this.deleteButton.ImageClick = (Image) GFXLibrary.button_132_in; this.deleteButton.setSizeToImage(); this.deleteButton.Position = new Point(this.loadButton.Position.X, this.loadButton.Rectangle.Bottom + 5); this.deleteButton.Text.Text = SK.Text("Formations_Delete", "Delete Formation"); this.deleteButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.deleteButton.TextYOffset = -2; this.deleteButton.Text.Color = ARGBColors.Black; this.deleteButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClick), "Formation_Delete"); this.deleteButton.Enabled = true; base.addControl(this.deleteButton); this.renameButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.renameButton.ImageOver = (Image) GFXLibrary.button_132_over; this.renameButton.ImageClick = (Image) GFXLibrary.button_132_in; this.renameButton.setSizeToImage(); this.renameButton.Position = new Point(this.loadButton.Position.X, this.deleteButton.Rectangle.Bottom + 30); this.renameButton.Text.Text = SK.Text("Formations_Rename", "Rename Formation"); this.renameButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.renameButton.TextYOffset = -2; this.renameButton.Text.Color = ARGBColors.Black; this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.renameClick), "Formation_Rename"); this.renameButton.Enabled = true; base.addControl(this.renameButton); this.clearButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.clearButton.ImageOver = (Image) GFXLibrary.button_132_over; this.clearButton.ImageClick = (Image) GFXLibrary.button_132_in; this.clearButton.setSizeToImage(); this.clearButton.Position = new Point(((5 * base.Width) / 6) - (this.clearButton.Width / 2), this.renameButton.Y); this.clearButton.Text.Text = SK.Text("Formations_Clear", "Clear Deployment"); this.clearButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.clearButton.TextYOffset = -2; this.clearButton.Text.Color = ARGBColors.Black; this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearClick), "Formation_Clear"); this.clearButton.Enabled = true; base.addControl(this.clearButton); this.totalsButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.totalsButton.ImageOver = (Image) GFXLibrary.button_132_over; this.totalsButton.ImageClick = (Image) GFXLibrary.button_132_in; this.totalsButton.setSizeToImage(); this.totalsButton.Position = new Point(((5 * base.Width) / 6) - (this.totalsButton.Width / 2), this.deleteButton.Y); this.totalsButton.Text.Text = SK.Text("Formations_CurrentTotals", "Current Totals"); this.totalsButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.totalsButton.TextYOffset = -2; this.totalsButton.Text.Color = ARGBColors.Black; this.totalsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.totalsClick), "Formation_CurrentTotals"); this.totalsButton.Enabled = true; base.addControl(this.totalsButton); this.formationImage.Image = (Image) GFXLibrary.formations_img; this.formationImage.setSizeToImage(); this.formationImage.Position = new Point((base.Width / 6) - (this.formationImage.Width / 2), (this.storedList.Y + (this.storedList.Height / 2)) - (this.formationImage.Height / 2)); base.addControl(this.formationImage); this.createLabel.Text = SK.Text("Formations_New_Box", "Create New Formation"); this.createLabel.Color = ARGBColors.White; this.createLabel.DropShadowColor = ARGBColors.Black; this.createLabel.Position = new Point(0, this.deleteButton.Y); this.createLabel.Size = new Size(base.Width / 3, this.deleteButton.Height); this.createLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER; this.createLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); base.addControl(this.createLabel); this.createNameLabel.Text = SK.Text("Formations_Name", "Formation Name"); this.createNameLabel.Color = ARGBColors.White; this.createNameLabel.DropShadowColor = ARGBColors.Black; this.createNameLabel.Position = new Point(0, this.deleteButton.Y); this.createNameLabel.Size = new Size(base.Width / 3, this.deleteButton.Height); this.createNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER; this.createNameLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); this.createButton.ImageNorm = (Image) GFXLibrary.button_132_normal; this.createButton.ImageOver = (Image) GFXLibrary.button_132_over; this.createButton.ImageClick = (Image) GFXLibrary.button_132_in; this.createButton.setSizeToImage(); this.createButton.Position = new Point((base.Width / 6) - (this.createButton.Width / 2), this.renameButton.Y); this.createButton.Text.Text = SK.Text("Formations_Save", "Save Formation"); this.createButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular); this.createButton.TextYOffset = -2; this.createButton.Text.Color = ARGBColors.Black; this.createButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.createClick), "Formation_Create"); this.createButton.Enabled = true; base.addControl(this.createButton); this.castlePlacePeasantButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_peasent; this.castlePlacePeasantButton.ImageOver = (Image) GFXLibrary.r_building_miltary_peasent; this.castlePlacePeasantButton.setSizeToImage(); this.castlePlacePeasantButton.Position = new Point((((5 * base.Width) / 6) - this.castlePlacePeasantButton.Width) - 10, this.storedLabel.Y); this.castlePlacePeasantButton.Data = 90; this.castlePlacePeasantButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlacePeasantInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlacePeasantInset.Position = new Point(0x37, 0x37); this.castlePlacePeasantLabel.Text = "0"; this.castlePlacePeasantLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlacePeasantLabel.Position = new Point(0, -1); this.castlePlacePeasantLabel.Size = this.castlePlacePeasantInset.Size; this.castlePlacePeasantLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlacePeasantButton); this.castlePlacePeasantInset.addControl(this.castlePlacePeasantLabel); this.castlePlacePeasantButton.addControl(this.castlePlacePeasantInset); this.castlePlacePeasantButton.Active = false; this.castlePlaceArcherButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_archer; this.castlePlaceArcherButton.ImageOver = (Image) GFXLibrary.r_building_miltary_archer; this.castlePlaceArcherButton.setSizeToImage(); this.castlePlaceArcherButton.Position = new Point(this.castlePlacePeasantButton.Rectangle.Right - 10, this.castlePlacePeasantButton.Position.Y); this.castlePlaceArcherButton.Data = 0x5c; this.castlePlaceArcherButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceArcherInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlaceArcherInset.Position = new Point(0x37, 0x37); this.castlePlaceArcherLabel.Text = "0"; this.castlePlaceArcherLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceArcherLabel.Position = new Point(0, -1); this.castlePlaceArcherLabel.Size = this.castlePlaceArcherInset.Size; this.castlePlaceArcherLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceArcherButton); this.castlePlaceArcherInset.addControl(this.castlePlaceArcherLabel); this.castlePlaceArcherButton.addControl(this.castlePlaceArcherInset); this.castlePlaceArcherButton.Active = false; this.castlePlacePikemanButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_pikemen; this.castlePlacePikemanButton.ImageOver = (Image) GFXLibrary.r_building_miltary_pikemen; this.castlePlacePikemanButton.setSizeToImage(); this.castlePlacePikemanButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePeasantButton.Rectangle.Bottom - 0x22); this.castlePlacePikemanButton.Data = 0x5d; this.castlePlacePikemanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlacePikemanInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlacePikemanInset.Position = new Point(0x37, 0x37); this.castlePlacePikemanLabel.Text = "0"; this.castlePlacePikemanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlacePikemanLabel.Position = new Point(0, -1); this.castlePlacePikemanLabel.Size = this.castlePlacePikemanInset.Size; this.castlePlacePikemanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlacePikemanButton); this.castlePlacePikemanInset.addControl(this.castlePlacePikemanLabel); this.castlePlacePikemanButton.addControl(this.castlePlacePikemanInset); this.castlePlacePikemanButton.Active = false; this.castlePlaceSwordsmanButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_swordsman; this.castlePlaceSwordsmanButton.ImageOver = (Image) GFXLibrary.r_building_miltary_swordsman; this.castlePlaceSwordsmanButton.setSizeToImage(); this.castlePlaceSwordsmanButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlacePikemanButton.Y); this.castlePlaceSwordsmanButton.Data = 0x5b; this.castlePlaceSwordsmanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceSwordsmanInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlaceSwordsmanInset.Position = new Point(0x37, 0x37); this.castlePlaceSwordsmanLabel.Text = "0"; this.castlePlaceSwordsmanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceSwordsmanLabel.Position = new Point(0, -1); this.castlePlaceSwordsmanLabel.Size = this.castlePlaceSwordsmanInset.Size; this.castlePlaceSwordsmanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceSwordsmanButton); this.castlePlaceSwordsmanInset.addControl(this.castlePlaceSwordsmanLabel); this.castlePlaceSwordsmanButton.addControl(this.castlePlaceSwordsmanInset); this.castlePlaceSwordsmanButton.Active = false; this.castlePlaceCatapultButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_catapult; this.castlePlaceCatapultButton.ImageOver = (Image) GFXLibrary.r_building_miltary_catapult; this.castlePlaceCatapultButton.setSizeToImage(); this.castlePlaceCatapultButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePikemanButton.Rectangle.Bottom - 0x22); this.castlePlaceCatapultButton.Data = 0x5e; this.castlePlaceCatapultButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceCatapultInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlaceCatapultInset.Position = new Point(0x37, 0x41); this.castlePlaceCatapultLabel.Text = "0"; this.castlePlaceCatapultLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceCatapultLabel.Position = new Point(0, -1); this.castlePlaceCatapultLabel.Size = this.castlePlaceCatapultInset.Size; this.castlePlaceCatapultLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceCatapultButton); this.castlePlaceCatapultInset.addControl(this.castlePlaceCatapultLabel); this.castlePlaceCatapultButton.addControl(this.castlePlaceCatapultInset); this.castlePlaceCatapultButton.Active = false; this.castlePlaceCaptainButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_captain_normal; this.castlePlaceCaptainButton.ImageOver = (Image) GFXLibrary.r_building_miltary_captain_normal; this.castlePlaceCaptainButton.setSizeToImage(); this.castlePlaceCaptainButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlaceCatapultButton.Position.Y); this.castlePlaceCaptainButton.Data = 0x5e; this.castlePlaceCaptainButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55); this.castlePlaceCaptainInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule; this.castlePlaceCaptainInset.Position = new Point(0x37, 0x41); this.castlePlaceCaptainLabel.Text = "0"; this.castlePlaceCaptainLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5); this.castlePlaceCaptainLabel.Position = new Point(0, -1); this.castlePlaceCaptainLabel.Size = this.castlePlaceCaptainInset.Size; this.castlePlaceCaptainLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; base.addControl(this.castlePlaceCaptainButton); this.castlePlaceCaptainInset.addControl(this.castlePlaceCaptainLabel); this.castlePlaceCaptainButton.addControl(this.castlePlaceCaptainInset); this.castlePlaceCaptainButton.Active = false; this.selectedTitleLabel.Text = ""; this.selectedTitleLabel.Color = ARGBColors.White; this.selectedTitleLabel.DropShadowColor = ARGBColors.Black; this.selectedTitleLabel.Position = new Point((2 * base.Width) / 3, this.manageLabel.Y); this.selectedTitleLabel.Size = new Size(base.Width / 3, 0x18); this.selectedTitleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.selectedTitleLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); base.addControl(this.selectedTitleLabel); this.selectedTroopCountLabel.Text = ""; this.selectedTroopCountLabel.Color = ARGBColors.White; this.selectedTroopCountLabel.DropShadowColor = ARGBColors.Black; this.selectedTroopCountLabel.Position = new Point((2 * base.Width) / 3, this.storedLabel.Y); this.selectedTroopCountLabel.Size = new Size(base.Width / 3, 0x18); this.selectedTroopCountLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.selectedTroopCountLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); base.addControl(this.selectedTroopCountLabel); if (!Program.mySettings.AttackSetupsUpdated) { GameEngine.Instance.CastleAttackerSetup.cleanUpAttackSaveNames(); Program.mySettings.AttackSetupsUpdated = true; } this.loadNames(); this.initTotals(); }