internal void AddTab(string nameTab, int imageIndex, VisualControl controlForPage)
        {
            if (controlForPage != null)
            {
                controlForPage.Visible = false;
            }

            VCTabButton btnTab = new VCTabButton(this, leftForNextPage, 0, BitmapList, imageIndex)
            {
                NameTab     = nameTab,
                IndexPage   = btnTabs.Count,
                ContextPage = controlForPage
            };

            btnTabs.Add(btnTab);

            if (controlForPage != null)
            {
                AddControl(controlForPage);
                controlForPage.ShiftX = 0;
                controlForPage.ShiftY = lblCaptionPage.NextTop();
            }

            leftForNextPage += btnTab.Width + FormMain.Config.GridSizeHalf;

            if (ActivePage == -1)
            {
                ActivatePage(0);
            }
        }
        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;
        }
Пример #3
0
        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;
             *  }
             * }*/
        }
Пример #5
0
        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);
        }