/// <summary> /// Update the labels and tooltips for the character's Attributes. /// </summary> /// <param name="objAttribute"></param> /// <param name="lblATTMetatype"></param> /// <param name="lblATTAug"></param> /// <param name="tipTooltip"></param> /// <param name="nudATT"></param> protected void UpdateCharacterAttribute(CharacterAttrib objAttribute, Label lblATTMetatype, Label lblATTAug, HtmlToolTip tipTooltip, [Optional] NumericUpDown nudATT, [Optional] NumericUpDown nudKATT) { if (nudATT != null) { nudATT.Minimum = objAttribute.TotalMinimum; nudATT.Maximum = objAttribute.TotalMaximum; nudATT.Value = Math.Max(objAttribute.Value - objAttribute.Karma, objAttribute.Base); } if (nudKATT != null) { nudKATT.Minimum = 0; nudKATT.Maximum = objAttribute.TotalMaximum; nudKATT.Value = objAttribute.Karma; } lblATTMetatype.Text = $"{objAttribute.TotalMinimum} / {objAttribute.TotalMaximum} ({objAttribute.TotalAugmentedMaximum})"; if (objAttribute.HasModifiers) { lblATTAug.Text = $"{objAttribute.Value} ({objAttribute.TotalValue})"; tipTooltip.SetToolTip(lblATTAug, objAttribute.ToolTip()); } else { lblATTAug.Text = $"{objAttribute.Value}"; tipTooltip.SetToolTip(lblATTAug, string.Empty); } }
/// <summary> /// Update the labels and tooltips for the character's Attributes. /// </summary> /// <param name="objAttribute"></param> /// <param name="lblATTMetatype"></param> /// <param name="lblATTAug"></param> /// <param name="tipTooltip"></param> /// <param name="nudATT"></param> protected void UpdateCharacterAttribute(CharacterAttrib objAttribute, Label lblATTMetatype, Label lblATTAug, ToolTip tipTooltip, [Optional] NumericUpDown nudATT, [Optional] NumericUpDown nudKATT) { if (nudATT != null) { nudATT.Minimum = objAttribute.TotalMinimum; nudATT.Maximum = objAttribute.TotalMaximum; nudATT.Value = Math.Max(objAttribute.Value - objAttribute.Karma, objAttribute.Base); } if (nudKATT != null) { nudKATT.Minimum = 0; nudKATT.Maximum = objAttribute.TotalMaximum; nudKATT.Value = objAttribute.Karma; } lblATTMetatype.Text = string.Format("{0} / {1} ({2})", objAttribute.TotalMinimum, objAttribute.TotalMaximum, objAttribute.TotalAugmentedMaximum); if (objAttribute.HasModifiers) { lblATTAug.Text = string.Format("{0} ({1})", objAttribute.Value, objAttribute.TotalValue); tipTooltip.SetToolTip(lblATTAug, objAttribute.ToolTip()); } else { lblATTAug.Text = string.Format("{0}", objAttribute.Value); tipTooltip.SetToolTip(lblATTAug, ""); } }