Example #1
0
        public WindowMainMenu()
        {
            bmpMenu = new VCBitmap(this, 0, 0, Program.formMain.bmpMainMenu);
            Width   = bmpMenu.Width;
            Height  = bmpMenu.Height;

            btnTournament        = new VCButton(bmpMenu, 80, 88, "Турнир");
            btnTournament.Width  = Width - 80 - 80;
            btnTournament.Click += BtnTournament_Click;

            btnExit        = new VCButton(bmpMenu, 80, bmpMenu.Height - 96, "Выход");
            btnExit.Width  = Width - 80 - 80;
            btnExit.Click += BtnExit_Click;

            btnABoutProgram        = new VCButton(bmpMenu, 80, btnExit.ShiftY - 48, "О программе");
            btnABoutProgram.Width  = Width - 80 - 80;
            btnABoutProgram.Click += BtnAboutProgram_Click;

            btnPreferences        = new VCButton(bmpMenu, 80, btnABoutProgram.ShiftY - 48, "Настройки");
            btnPreferences.Width  = Width - 80 - 80;
            btnPreferences.Click += BtnPreferences_Click;

            btnPlayers        = new VCButton(bmpMenu, 80, btnPreferences.ShiftY - 48, "Игроки");
            btnPlayers.Width  = Width - 80 - 80;
            btnPlayers.Click += BtnPlayers_Click;

            CancelButton = btnExit;
        }
Example #2
0
        public WindowMenuInGame()
        {
            bmpMenu = new VCBitmap(this, 0, 0, Program.formMain.bmpMenuInGame);
            Width   = bmpMenu.Width;
            Height  = bmpMenu.Height;

            btnBackToGame        = new VCButton(bmpMenu, 80, 72, "Вернуться к игре");
            btnBackToGame.Width  = Width - 80 - 80;
            btnBackToGame.Click += BtnBackToGame_Click;

            btnNewGame        = new VCButton(bmpMenu, 80, btnBackToGame.NextTop(), "Новая игра");
            btnNewGame.Width  = Width - 80 - 80;
            btnNewGame.Click += BtnNewGame_Click;

            btnExitToWindows        = new VCButton(bmpMenu, 80, bmpMenu.Height - 96, "Выход в Windows");
            btnExitToWindows.Width  = Width - 80 - 80;
            btnExitToWindows.Click += BtnExitToWindows_Click;

            btnSettings        = new VCButton(bmpMenu, 80, btnExitToWindows.ShiftY - 48, "Настройки");
            btnSettings.Width  = Width - 80 - 80;
            btnSettings.Click += BtnSettings_Click;

            CancelButton = btnBackToGame;
        }
        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;
             *  }
             * }*/
        }