public VCWindowCaption(VisualControl parent, int shiftX, int shiftY) : base(parent, shiftX, shiftY) { labelCaption = new VCLabelM2(this, WidthCap(), 1, Program.formMain.fontBigCaption, Color.MediumAquamarine, Program.formMain.fontBigCaption.MaxHeightSymbol, ""); labelCaption.StringFormat.Alignment = StringAlignment.Center; labelCaption.StringFormat.LineAlignment = StringAlignment.Near; labelCaption.ManualDraw = true; }
public VCImage(VisualControl parent, int shiftX, int shiftY, BitmapList bitmapList, int imageIndex) : base(parent, shiftX, shiftY) { BitmapList = bitmapList; ImageIndex = imageIndex; labelCost = new VCLabelM2(this, 0, Height - 12, Program.formMain.fontSmallC, FormMain.Config.CommonCost, 16, ""); labelCost.StringFormat.LineAlignment = StringAlignment.Far; labelCost.Visible = false;// Текст перекрывается иконкой. Поэтому рисуем вручную labelCost.ManualDraw = true; shiftlabelLevel = bitmapList.Size >= 128 ? FormMain.Config.GridSize : 6; labelLevel = new VCLabelM2(this, 0, shiftlabelLevel - 2, Program.formMain.fontMedCaptionC, FormMain.Config.CommonLevel, 16, ""); labelLevel.StringFormat.LineAlignment = StringAlignment.Near; labelLevel.StringFormat.Alignment = StringAlignment.Far; labelLevel.Visible = false; labelLevel.ManualDraw = true; labelQuantity = new VCLabelM2(this, 0, FormMain.Config.GridSize, Program.formMain.fontMedCaptionC, FormMain.Config.CommonQuantity, 16, ""); labelQuantity.StringFormat.LineAlignment = StringAlignment.Far; labelQuantity.StringFormat.Alignment = StringAlignment.Far; labelQuantity.Visible = false; labelQuantity.ManualDraw = true; labelPopupQuantity = new VCLabelM2(this, 0, 0, Program.formMain.fontSmall, FormMain.Config.CommonPopupQuantity, sizePopupBackground, ""); labelPopupQuantity.StringFormat.LineAlignment = StringAlignment.Center; labelPopupQuantity.StringFormat.Alignment = StringAlignment.Center; labelPopupQuantity.Width = sizePopupBackground; labelPopupQuantity.Visible = false; labelPopupQuantity.ManualDraw = true; brushPopupQuantity = new SolidBrush(FormMain.Config.CommonPopupQuantityBack); ValidateSize(); }
public VCTabControl(VisualControl parent, int shiftX, int shiftY, BitmapList bitmapList) : base(parent, shiftX, shiftY) { BitmapList = bitmapList; ActivePage = -1; lblCaptionPage = new VCLabelM2(this, 0, BitmapList.Size + FormMain.Config.GridSize, Program.formMain.fontSmallBC, FormMain.Config.CommonCaptionPage, 24, ""); lblCaptionPage.StringFormat.LineAlignment = StringAlignment.Center; lblCaptionPage.ShowBorder = true; lblCaptionPage.Color = Color.LightGreen; }
public VCButton(VisualControl parent, int shiftX, int shiftY, string caption) : base(parent, shiftX, shiftY) { Caption = caption; Width = 160; labelCaption = new VCLabelM2(this, WidthCap(), 1, Program.formMain.fontSmallC, Color.White, GetBitmap().Height, ""); labelCaption.StringFormat.Alignment = StringAlignment.Center; labelCaption.StringFormat.LineAlignment = StringAlignment.Center; labelCaption.Visible = false; labelCaption.ManualDraw = true; }
public WindowPreferences() : base() { windowCaption.Caption = "Настройки"; vcPanelGame = new VisualControl(ClientControl, 0, 0); vcPanelGame.ShowBorder = true; lblCaptionPanelGame = new VCLabelM2(vcPanelGame, FormMain.Config.GridSize, 8, Program.formMain.fontMedCaption, Color.PaleTurquoise, 24, "Общие настройки:"); lblCaptionPanelGame.StringFormat.Alignment = StringAlignment.Near; chkbShowSplashVideo = new VCCheckBox(vcPanelGame, FormMain.Config.GridSize, lblCaptionPanelGame.NextTop(), "Показывать видео-заставку"); chkbShowSplashVideo.Width = 320; chkbWindowMode = new VCCheckBox(vcPanelGame, FormMain.Config.GridSize, chkbShowSplashVideo.NextTop(), "Оконный режим"); chkbWindowMode.Width = 320; chkbCheckUpdates = new VCCheckBox(vcPanelGame, FormMain.Config.GridSize, chkbWindowMode.NextTop(), "Проверять обновления при запуске"); chkbCheckUpdates.Width = 320; vcPanelGame.ApplyMaxSize(); vcPanelGame.Height += 8; lblCaptionPanelGame.Width = vcPanelGame.Width - (FormMain.Config.GridSize * 2); vcPanelBatttlefield = new VisualControl(ClientControl, 0, vcPanelGame.NextTop()); vcPanelBatttlefield.ShowBorder = true; lblCaptionPanelBattlefield = new VCLabelM2(vcPanelBatttlefield, FormMain.Config.GridSize, 8, Program.formMain.fontMedCaption, Color.PaleTurquoise, 24, "Настройки битвы:"); lblCaptionPanelBattlefield.StringFormat.Alignment = StringAlignment.Near; chkbShowPath = new VCCheckBox(vcPanelBatttlefield, FormMain.Config.GridSize, lblCaptionPanelBattlefield.NextTop(), "Показывать путь юнитов"); chkbShowPath.Width = 320; chkbShowGrid = new VCCheckBox(vcPanelBatttlefield, FormMain.Config.GridSize, chkbShowPath.NextTop(), "Показывать сетку"); chkbShowGrid.Width = 320; vcPanelBatttlefield.ApplyMaxSize(); vcPanelBatttlefield.Height += 8; lblCaptionPanelBattlefield.Width = vcPanelBatttlefield.Width - (FormMain.Config.GridSize * 2); btnAccept = new VCButton(ClientControl, 0, vcPanelBatttlefield.NextTop() + (FormMain.Config.GridSize * 2), "Принять"); btnAccept.Width = 160; btnAccept.Click += BtnAccept_Click; btnDefault = new VCButton(ClientControl, btnAccept.NextLeft(), btnAccept.ShiftY, "Базовые"); btnDefault.Width = 160; btnDefault.Click += BtnDefault_Click; btnCancel = new VCButton(ClientControl, btnDefault.NextLeft(), btnAccept.ShiftY, "Отмена"); btnCancel.Width = 160; btnCancel.Click += BtnCancel_Click; AcceptButton = btnAccept; CancelButton = btnCancel; ClientControl.Width = btnCancel.ShiftX + btnCancel.Width + btnCancel.Left; ClientControl.Height = btnCancel.NextTop(); vcPanelGame.Width = ClientControl.Width - (vcPanelGame.ShiftX * 2); vcPanelBatttlefield.Width = ClientControl.Width - (vcPanelBatttlefield.ShiftX * 2); }
public PanelMapObject(VisualControl parent, int shiftX, int shiftY) : base(parent, shiftX, shiftY) { ShowBorder = true; lblNameMapObject = new VCLabelM2(this, FormMain.Config.GridSize, FormMain.Config.GridSize - 3, Program.formMain.fontMedCaptionC, Color.Transparent, FormMain.Config.GridSize * 3, ""); lblNameMapObject.StringFormat.Alignment = StringAlignment.Center; lblNameMapObject.ShowBorder = true; lblNameMapObject.Click += ImgLair_Click; imgMapObject = new VCImageBig(this, lblNameMapObject.NextTop()); imgMapObject.HighlightUnderMouse = true; imgMapObject.Click += ImgLair_Click; imgMapObject.ShowHint += ImgLair_ShowHint; Click += ImgLair_Click; }
public PanelBaseInfo(VisualControl parent, int shiftX, int shiftY) : base(parent, shiftX, shiftY) { Visible = false; ShowBorder = true; lblName = new VCLabelM2(this, FormMain.Config.GridSize, FormMain.Config.GridSize - 3, Program.formMain.fontMedCaptionC, FormMain.Config.BattlefieldPlayerName, FormMain.Config.GridSize * 3, ""); lblName.StringFormat.Alignment = StringAlignment.Center; lblName.Color = Color.MediumAquamarine; lblName.ShowBorder = true; imgIcon = new VCImageBig(this, lblName.NextTop()); imgIcon.ShowHint += ImgIcon_ShowHint; separator = new VCSeparator(this, FormMain.Config.GridSize, TopForControls()); pageControl = new VCTabControl(this, FormMain.Config.GridSize, separator.NextTop(), Program.formMain.ilGui) { //Parent = this, Width = Width - FormMain.Config.GridSize * 2, Height = Height - separator.NextTop() - FormMain.Config.GridSize }; }
public PanelCreatureInfo(VisualControl parent, int shiftX, int shiftY) : base(parent, shiftX, shiftY) { panelAbilitiesAndSecSkills = new VisualControl(); panelInventory = new PanelWithPanelEntity(4); panelAbilities = new PanelWithPanelEntity(4); panelSecondarySkills = new PanelWithPanelEntity(4); lblKindHero = new VCLabelM2(this, FormMain.Config.GridSize, TopForControls(), Program.formMain.fontMedCaptionC, FormMain.Config.CommonCaptionPage, 16, ""); lblKindHero.StringFormat.Alignment = StringAlignment.Near; bmpStateBackground = new VCBitmap(this, FormMain.Config.GridSize, lblKindHero.NextTop(), Program.formMain.bmpBandStateCreature); bmpStateBackground.ShowHint += BmpState_ShowHint; bmpState = new VCBitmap(bmpStateBackground, 6, 5, Program.formMain.ilStateHero.GetImage(0, true, false)); bmpState.ShowHintParent = true; labelNameState = new VCLabelM2(bmpStateBackground, 36, 8, Program.formMain.fontSmallC, Color.White, 16, ""); labelNameState.StringFormat.Alignment = StringAlignment.Near; labelNameState.StringFormat.LineAlignment = StringAlignment.Center; labelNameState.ShowHintParent = true; panelSpecialization = new VCCell(this, imgIcon.NextLeft(), imgIcon.ShiftY); panelWeapon = new VCCell(this, FormMain.Config.GridSize, bmpStateBackground.NextTop()); panelArmour = new VCCell(this, panelWeapon.NextLeft(), panelWeapon.ShiftY); lvGold = new VCLabelValue(this, FormMain.Config.GridSize, panelWeapon.NextTop(), Color.White); lvGold.ImageIndex = FormMain.GUI_16_GOLD; separator.ShiftY = lvGold.NextTop(); pageControl.ShiftY = separator.NextTop(); pageControl.AddTab("Статистика", FormMain.GUI_SCROLL, null); pageControl.AddTab("Инвентарь", FormMain.GUI_INVENTORY, panelInventory); pageControl.AddTab("Способности и навыки", FormMain.GUI_TARGET, panelAbilitiesAndSecSkills); pageControl.AddTab("История", FormMain.GUI_BOOK, null); panelAbilitiesAndSecSkills.AddControl(panelAbilities); panelAbilitiesAndSecSkills.AddControl(panelSecondarySkills); panelSecondarySkills.ShiftY = panelAbilities.NextTop();// Это для расчета минимальной высоты panelAbilitiesAndSecSkills.ArrangeControl(panelSecondarySkills); pageControl.ApplyMinSize(); Width = pageControl.Width + FormMain.Config.GridSize * 2; Height = pageControl.NextTop(); lblKindHero.Width = Width - lblKindHero.ShiftX - FormMain.Config.GridSize; return; /*lblLevel = GuiUtils.CreateLabel(this, Config.GRID_SIZE, TopForControls()); * lblHealth = GuiUtils.CreateLabel(this, Config.GRID_SIZE, lblLevel.Top + lblLevel.Height + Config.GRID_SIZE); * lblMana = GuiUtils.CreateLabel(this, Config.GRID_SIZE, lblHealth.Top + lblHealth.Height + Config.GRID_SIZE); * * lblStrength = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblMana.Top + lblMana.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_STRENGTH); * lblDexterity = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblStrength.Top + lblStrength.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_DEXTERITY); * lblMagic = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblDexterity.Top + lblDexterity.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_MAGIC); * lblVitality = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblMagic.Top + lblMagic.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_VITALITY); * lblSpeed = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblVitality.Top + lblVitality.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_SPEED_ATTACK); * * // lblStamina = GuiUtils.CreateLabelParameter(this, Config.GRID_SIZE, lblWisdom.Top + lblWisdom.Height + Config.GRID_SIZE, FormMain.GUI_PARAMETER_STAMINA); * lblAttackMelee = GuiUtils.CreateLabelParameter(this, lblStrength.Left + lblStrength.Width + Config.GRID_SIZE, lblStrength.Top, FormMain.GUI_PARAMETER_ATTACK_MELEE); * lblAttackRange = GuiUtils.CreateLabelParameter(this, lblDexterity.Left + lblDexterity.Width + Config.GRID_SIZE, lblDexterity.Top, FormMain.GUI_PARAMETER_ATTACK_RANGE); * lblAttackMagic = GuiUtils.CreateLabelParameter(this, lblMagic.Left + lblMagic.Width + Config.GRID_SIZE, lblMagic.Top, FormMain.GUI_PARAMETER_ATTACK_MAGIC); * * lblDefenseMelee = GuiUtils.CreateLabelParameter(this, lblAttackMelee.Left + lblAttackMelee.Width + Config.GRID_SIZE, lblAttackMelee.Top, FormMain.GUI_PARAMETER_DEFENSE_MELEE); * lblDefenseRange = GuiUtils.CreateLabelParameter(this, lblAttackRange.Left + lblAttackRange.Width + Config.GRID_SIZE, lblAttackRange.Top, FormMain.GUI_PARAMETER_DEFENSE_RANGE); * lblDefenseMagic = GuiUtils.CreateLabelParameter(this, lblAttackMagic.Left + lblAttackMagic.Width + Config.GRID_SIZE, lblAttackMagic.Top, FormMain.GUI_PARAMETER_DEFENSE_MAGIC); * * // Слоты инвентаря * PanelEntity pb; * for (int y = 0; y < FormMain.SLOTS_LINES; y++) * { * for (int x = 0; x < FormMain.SLOTS_IN_LINE; x++) * { * pb = new PanelEntity(); * pb.Parent = this; * pb.Left = Config.GRID_SIZE + ((pb.Width + Config.GRID_SIZE) * x); * pb.Top = GuiUtils.NextTop(lblSpeed) + ((pb.Height + Config.GRID_SIZE) * y); * * slots[x + y * FormMain.SLOTS_IN_LINE] = pb; * } * }*/ }