/// <summary> /// Correct highlight if selected cell is inaccessable. /// </summary> /// <param name="sender"></param> /// <param name="highlightValue"></param> private void pbBase_Highlighting(AttributeBarControl sender, ref int highlightValue) { // Adjust possible highlight using free points in pool if (highlightValue - sender.Value > pbUnassigned.Value) { highlightValue = sender.Value + pbUnassigned.Value; } }
/// <summary> /// Correct highlight if selected cell is inaccessable. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="AttributeHighlightingEventArgs"/> instance containing the event data.</param> private void pbRemappable_Highlighting(object sender, AttributeHighlightingEventArgs e) { AttributeBarControl control = (AttributeBarControl)sender; // Adjust possible highlight using free points in pool if (e.Value - control.Value > pbUnassigned.Value) { control.HighlightedValue = control.Value + pbUnassigned.Value; } }
/// <summary> /// Change of any attribute must be adjusted if there is no enough free points in the pool. /// </summary> /// <param name="sender"></param> /// <param name="deltaValue"></param> private void pbBase_ValueChanging(AttributeBarControl sender, ref int deltaValue) { // Adjust delta if there is no enough free points if (pbUnassigned.Value < deltaValue) { deltaValue = pbUnassigned.Value; } // Add/remove pionts from pool pbUnassigned.Value -= deltaValue; }
/// <summary> /// Change of any attribute must be adjusted if there is no enough free points in the pool. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="AttributeValueChangingEventArgs"/> instance containing the event data.</param> private void pbRemappable_ValueChanging(object sender, AttributeValueChangingEventArgs e) { AttributeBarControl control = (AttributeBarControl)sender; // Adjust delta if there is no enough free points if (pbUnassigned.Value < e.Value) { control.DeltaValue = pbUnassigned.Value; } // Add/remove points from pool pbUnassigned.Value -= control.DeltaValue; }
/// <summary> /// Updates bars and labels for specified attribute. /// </summary> /// <param name="remapping">Attribute remapping</param> /// <param name="attrib">Attribute that will be used to update controls</param> /// <param name="label">Label control</param> /// <param name="pbRemappable">Attribute bar for remappable value</param> /// <param name="pbImplants">Attribute bar for implants</param> private static void UpdateAttributeControls(RemappingResult remapping, EveAttribute attrib, Control label, AttributeBarControl pbRemappable, AttributeBarControl pbImplants) { // Compute base and effective attributes Int64 effectiveAttribute = remapping.BestScratchpad[attrib].EffectiveValue; Int64 oldBaseAttribute = remapping.BaseScratchpad[attrib].Base; Int64 remappableAttribute = remapping.BestScratchpad[attrib].Base; Int64 implantsBonus = remapping.BestScratchpad[attrib].ImplantBonus; // Update the label label.Text = $"{effectiveAttribute} (new : {remappableAttribute} ; old : {oldBaseAttribute})"; // Update the bars pbRemappable.Value = remappableAttribute - EveConstants.CharacterBaseAttributePoints; pbImplants.Value = implantsBonus; }
/// <summary> /// Updates bars and labels for specified attribute. /// </summary> /// <param name="character">Character information</param> /// <param name="remapping">Attribute remapping</param> /// <param name="attrib">Attribute that will be used to update controls</param> /// <param name="lb">Label control</param> /// <param name="pbRemappable">Attribute bar for remappable value</param> /// <param name="pbImplants">Attribute bar for implants</param> private void UpdateAttributeControls( BaseCharacter character, AttributesOptimizer.RemappingResult remapping, EveAttribute attrib, Label lb, AttributeBarControl pbRemappable, AttributeBarControl pbImplants) { // Compute base and effective attributes int effectiveAttribute = remapping.BestScratchpad[attrib].EffectiveValue; int oldBaseAttribute = remapping.BaseScratchpad[attrib].Base; int remappableAttribute = remapping.BestScratchpad[attrib].Base; int implantsBonus = remapping.BestScratchpad[attrib].ImplantBonus; // Update the label lb.Text = String.Format("{0} (new : {1} ; old : {2})", effectiveAttribute, remappableAttribute, oldBaseAttribute); // Update the bars pbRemappable.Value = remappableAttribute - EveConstants.CharacterBaseAttributePoints; pbImplants.Value = implantsBonus; }
/// <summary> /// Updates bars and labels for specified attribute. /// </summary> /// <param name="character">Character information</param> /// <param name="remapping">Attribute remapping</param> /// <param name="attrib">Attribute that will be used to update controls</param> /// <param name="lb">Label control</param> /// <param name="pbBase">Attribute bar for base value</param> /// <param name="pbImplants">Attribute bar for implants</param> /// <param name="pbSkills">Attribute bar for skills</param> private void UpdateAttributeControls( Character character, AttributesOptimizer.RemappingResult remapping, EveAttribute attrib, Label lb, AttributeBarControl pbBase, AttributeBarControl pbImplants, AttributeBarControl pbSkills) { // Compute base and effective attributes float effectiveAttribute = remapping.BestScratchpad[attrib].EffectiveValue; int oldBaseAttribute = remapping.BaseScratchpad[attrib].Base; int baseAttribute = remapping.BestScratchpad[attrib].Base; int implantsBonus = remapping.BestScratchpad[attrib].ImplantBonus; int skillsBonus = (int)effectiveAttribute - (baseAttribute + implantsBonus); // Update the label lb.Text = effectiveAttribute.ToString("##.##") + " (new : " + baseAttribute.ToString() + " ; old : " + oldBaseAttribute.ToString() + ")"; // Update the bars pbBase.Value = baseAttribute; pbImplants.Value = implantsBonus; pbSkills.Value = skillsBonus; }
/// <summary> /// Recalculate the time after change of an attribute. /// </summary> /// <param name="sender"></param> private void pb_ValueChanged(AttributeBarControl sender) { Recalculate(); }
/// <summary> /// Change of any attribute must be adjusted if there is no enough free points in the pool. /// </summary> /// <param name="sender"></param> /// <param name="deltaValue"></param> private void pbRemappable_ValueChanging(AttributeBarControl sender, ref int deltaValue) { // Adjust delta if there is no enough free points if (pbUnassigned.Value < deltaValue) deltaValue = pbUnassigned.Value; // Add/remove points from pool pbUnassigned.Value -= deltaValue; }
/// <summary> /// Correct highlight if selected cell is inaccessable. /// </summary> /// <param name="sender"></param> /// <param name="highlightValue"></param> private void pbRemappable_Highlighting(AttributeBarControl sender, ref int highlightValue) { // Adjust possible highlight using free points in pool if (highlightValue - sender.Value > pbUnassigned.Value) highlightValue = sender.Value + pbUnassigned.Value; }