Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions msu/utils/text.nut
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
return this.color(this.Color.Red, _string);
}

function colorPositive( _string )
function colorPositive( _string, _useEventColors = false )
{
return this.color(::Const.UI.Color.PositiveValue, _string);
return this.color(_useEventColors ? ::Const.UI.Color.PositiveEventValue : ::Const.UI.Color.PositiveValue, _string);
}

function colorNegative( _string )
function colorNegative( _string, _useEventColors = false )
{
return this.color(::Const.UI.Color.NegativeValue, _string);
return this.color(_useEventColors ? ::Const.UI.Color.NegativeEventValue : ::Const.UI.Color.NegativeValue, _string);
}

function colorDamage( _string )
Expand All @@ -40,6 +40,7 @@
AddSign = false,
CompareTo = 0,
InvertColor = false,
UseEventColors = false,
AddPercent = false
};

Expand All @@ -56,14 +57,14 @@
{
if (!kwargs.AddSign && _value < 0) _value *= -1;
if (kwargs.AddPercent) _value = _value + "%";
return kwargs.InvertColor ? this.colorPositive(_value) : this.colorNegative(_value);
return kwargs.InvertColor ? this.colorPositive(_value, kwargs.UseEventColors) : this.colorNegative(_value, kwargs.UseEventColors);
}

if (_value > kwargs.CompareTo)
{
if (kwargs.AddSign && _value > 0) _value = "+" + _value;
if (kwargs.AddPercent) _value = _value + "%";
return kwargs.InvertColor ? this.colorNegative(_value) : this.colorPositive(_value);
return kwargs.InvertColor ? this.colorNegative(_value, kwargs.UseEventColors) : this.colorPositive(_value, kwargs.UseEventColors);
}

if (_value == kwargs.CompareTo)
Expand Down