// CONSTUCTOR public FightMenu(Character selectedMember, Fight fight, MainForm context, List <PanelCharacter> PanelCharacter) { _selectedMember = selectedMember; _fight = fight; InitializeComponent(); _context = context; _panelCharacterList = PanelCharacter; // Display the name of the character labelCharName.Text = selectedMember.Name; // Set the X and Y location of the fight menu Location = new Point(0, 440 - Height); // By default an arrow is displayd near the toolstrip, here we hide the arrows toolStripSkills.ShowDropDownArrow = false; // We set the value of the HP BAR progressBarHP.Maximum = selectedMember.MaxHealthPoint; progressBarHP.Value = selectedMember.HealthPoint; // We set the value of the STAMINA BAR progressBarStamina.Maximum = selectedMember.MaxStaminaPoint; progressBarStamina.Value = selectedMember.StaminaPoint; ModifyProgressBarColor.SetState(progressBarStamina, 2); // 1 = green, 2 = yellow, 3 = red // We add a left click event on the basic attack button toolStripAttack.Click += new EventHandler(BasicAttack); // We add a left click event on the defense attack button toolStripDefense.Click += new EventHandler(Defense); // We add a left click event on the run away button ButtonRunAway.Click += new EventHandler(RunAway); }
public CharacterBar(Character c, MainForm contextForm, TeamManagement context) { _c = c; _contextForm = contextForm; _context = context; InitializeComponent(); ToolTip toolTip = new ToolTip(); toolTip.InitialDelay = 250; toolTip.ReshowDelay = 500; toolTip.ShowAlways = true; toolTip.AutoPopDelay = 32000; string infoItem = c.HealthPoint + "/" + c.MaxHealthPoint; toolTip.SetToolTip(PBHealth, infoItem); infoItem = c.StaminaPoint + "/" + c.MaxStaminaPoint; toolTip.SetToolTip(PBStamina, infoItem); LName.Text = c.Name; LLevel.Text = "Niveau " + c.Level; PBHealth.Maximum = c.MaxHealthPoint; PBHealth.Value = c.HealthPoint; PBStamina.Maximum = c.MaxStaminaPoint; PBStamina.Value = c.StaminaPoint; BInfos.Tag = c; BPosition.Tag = c; ModifyProgressBarColor.SetState(PBHealth, 2); // 1 = green, 2 = yellow, 3 = red ModifyProgressBarColor.SetState(PBStamina, 3); // 1 = green, 2 = yellow, 3 = red if (c.FrontPosition) { BPosition.Text = "CaC"; } else { BPosition.Text = "PO"; } }