Ejemplo n.º 1
0
 public void RebuildControls()
 {
     BuildControls();
     LoadBuffsFromCharacter();
     UpdateEnabledStates();
     ScrollHook.hookRec(this);
 }
Ejemplo n.º 2
0
 //phobos and deimos in the air
 public BuffSelector()
 {
     InitializeComponent();
     if (!this.DesignMode)
     {
         // don't need to BuildControls here, they'll be created when we set the first character from RebuildControls
         //BuildControls();
         Calculations.ModelChanged += new EventHandler(Calculations_ModelChanged);
         Rawr.UserControls.Options.GeneralSettings.DisplayBuffChanged     += new EventHandler(GeneralSettings_DisplayBuffChanged);
         Rawr.UserControls.Options.GeneralSettings.HideProfessionsChanged += new EventHandler(GeneralSettings_HideProfessionsChanged);
         Character.RaceChanged += new EventHandler(Character_RaceChanged);
         ScrollHook.hookRec(this);
     }
 }
Ejemplo n.º 3
0
 void GeneralSettings_DisplayBuffChanged(object sender, EventArgs e)
 {
     foreach (CheckBox checkbox in CheckBoxes.Values)
     {
         Buff buff = checkbox.Tag as Buff;
         if (Rawr.Properties.GeneralSettings.Default.DisplayBuffSource && buff.Source != null)
         {
             checkbox.Text = buff.Name + " (" + buff.Source + ")";
         }
         else
         {
             checkbox.Text = buff.Name;
         }
     }
     ScrollHook.hookRec(this);
 }
Ejemplo n.º 4
0
        private void BuildControls()
        {
            this.Controls.Clear();
            this.GroupBoxes.Clear();
            this.CheckBoxes.Clear();
            this.SuspendLayout();
            foreach (Buff buff in Buff.RelevantBuffs)
            {
                if (!GroupBoxes.ContainsKey(buff.Group))
                {
                    GroupBox groupBox = new GroupBox();
                    groupBox.Text       = buff.Group;
                    groupBox.Tag        = buff.Group;
                    groupBox.Font       = new Font(this.Font.FontFamily, 7f);
                    groupBox.Anchor     = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                    groupBox.MouseMove += new MouseEventHandler(BuffSelector_MouseMove);
                    groupBox.Dock       = DockStyle.Top;
                    GroupBoxes.Add(buff.Group, groupBox);
                    this.Controls.Add(groupBox);
                    groupBox.BringToFront();
                }
            }

            List <Buff> buffs = Buff.RelevantBuffs;

            foreach (Buff buff in buffs)
            {
                if (Character == null || !Rawr.Properties.GeneralSettings.Default.HideProfEnchants || (buff.Professions != null && Character.HasProfession(buff.Professions)))
                {
                    ExtendedToolTipCheckBox checkBox = new ExtendedToolTipCheckBox();
                    checkBox.Tag = buff;
                    if (Rawr.Properties.GeneralSettings.Default.DisplayBuffSource && buff.Source != null)
                    {
                        checkBox.Text = buff.Name + " (" + buff.Source + ")";
                    }
                    else
                    {
                        checkBox.Text = buff.Name;
                    }
                    checkBox.AutoSize        = true;
                    checkBox.Font            = this.Font;
                    checkBox.Dock            = DockStyle.Top;
                    checkBox.ToolTipText     = buff.Stats.ToString();
                    checkBox.CheckedChanged += new EventHandler(checkBoxBuff_CheckedChanged);
                    GroupBoxes[buff.Group].Controls.Add(checkBox);
                    checkBox.BringToFront();
                    // only add Draenei Heroic Presence buff if Alliance

                    /*if (buff.Name.Equals("Heroic Presence") && FormMain.Instance.IsHandleCreated)
                     * {
                     *  if (FormMain.Instance.Character.Faction == CharacterFaction.Alliance)
                     *      CheckBoxes.Add(buff, checkBox);
                     *  else
                     *      checkBox.Enabled = false;
                     * }
                     * else
                     *  CheckBoxes.Add(buff, checkBox);*/
                    CheckBoxes.Add(buff, checkBox);

                    foreach (Buff improvement in buff.Improvements)
                    {
                        if (Character == null || !Rawr.Properties.GeneralSettings.Default.HideProfEnchants || Character.HasProfession(improvement.Professions))
                        {
                            ExtendedToolTipCheckBox checkBoxImprovement = new ExtendedToolTipCheckBox();
                            checkBoxImprovement.Tag = improvement;
                            if (Rawr.Properties.GeneralSettings.Default.DisplayBuffSource && improvement.Source != null)
                            {
                                checkBoxImprovement.Text = improvement.Name + " (" + improvement.Source + ")";
                            }
                            else
                            {
                                checkBoxImprovement.Text = improvement.Name;
                            }
                            checkBoxImprovement.Padding = new Padding(8 + checkBoxImprovement.Padding.Left,
                                                                      checkBoxImprovement.Padding.Top, checkBoxImprovement.Padding.Right, checkBoxImprovement.Padding.Bottom);
                            checkBoxImprovement.AutoSize        = true;
                            checkBoxImprovement.Font            = this.Font;
                            checkBoxImprovement.Dock            = DockStyle.Top;
                            checkBoxImprovement.ToolTipText     = improvement.Stats.ToString();
                            checkBoxImprovement.CheckedChanged += new EventHandler(checkBoxBuff_CheckedChanged);
                            GroupBoxes[buff.Group].Controls.Add(checkBoxImprovement);
                            checkBoxImprovement.BringToFront();
                            CheckBoxes.Add(improvement, checkBoxImprovement);
                        }
                    }
                }
            }

            foreach (GroupBox groupBox in GroupBoxes.Values)
            {
                // Make sure not to index an empty array
                if (groupBox.Controls.Count > 0)
                {
                    groupBox.Height = groupBox.Controls[0].Bottom + 2;
                }
                // Hide empty group boxes
                else
                {
                    groupBox.Hide();
                }
            }
            ScrollHook.hookRec(this);
            this.ResumeLayout();
        }
Ejemplo n.º 5
0
        private void BuildControls()
        {
            this.Controls.Clear();
            GroupBoxes.Clear();
            LabelLabels.Clear();
            ValueLabels.Clear();

            string[] displayLabelConfigurationStrings = null;
            if (Calculations.Instance != null)
            {
                displayLabelConfigurationStrings = Calculations.CharacterDisplayCalculationLabels;
            }
            else
            {
                displayLabelConfigurationStrings = new string[0];
            }
            this.SuspendLayout();
            foreach (string displayLabelConfigurationString in displayLabelConfigurationStrings)
            {
                string[] displayLabelConfigurationSplit = displayLabelConfigurationString.Split(':');
                string   group = displayLabelConfigurationSplit[0];
                if (!GroupBoxes.ContainsKey(group))
                {
                    GroupBox groupBox = new GroupBox();
                    groupBox.Text   = group;
                    groupBox.Tag    = group;
                    groupBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                    groupBox.Dock   = DockStyle.Top;
                    GroupBoxes.Add(group, groupBox);
                    this.Controls.Add(groupBox);
                    groupBox.BringToFront();
                }

                string   name      = displayLabelConfigurationSplit[1];
                string[] nameSplit = name.Split('*');
                name = nameSplit[0];

                ExtendedToolTipLabel labelLabel = new ExtendedToolTipLabel();
                labelLabel.Left     = 4;
                labelLabel.Text     = name + (nameSplit.Length > 1 ? ": *" : ":");
                labelLabel.AutoSize = true;
                GroupBoxes[group].Controls.Add(labelLabel);
                LabelLabels.Add(name, labelLabel);
                if (nameSplit.Length > 1)
                {
                    labelLabel.ToolTipText = nameSplit[1];
                }

                ExtendedToolTipLabel labelValue = new ExtendedToolTipLabel();
                labelValue.Left     = this.Width / 2;
                labelValue.AutoSize = true;
                GroupBoxes[group].Controls.Add(labelValue);
                ValueLabels.Add(name, labelValue);
            }

            int groupY = 3;

            foreach (GroupBox groupBox in GroupBoxes.Values)
            {
                int labelY = 19;
                foreach (ExtendedToolTipLabel label in groupBox.Controls)
                {
                    label.Top = labelY;
                    if (ValueLabels.ContainsValue(label))
                    {
                        labelY += 18;
                    }
                }
                groupBox.Bounds = new Rectangle(6, groupY, 202, labelY);
                groupY         += labelY + 6;
            }
            ScrollHook.hookRec(this);
            this.ResumeLayout();
        }
Ejemplo n.º 6
0
 void Calculations_ModelChanged(object sender, EventArgs e)
 {
     BuildControls();
     ScrollHook.hookRec(this);
 }