From 28c3e3da148086d29eb853ea2fb5fee04cc7f11e Mon Sep 17 00:00:00 2001 From: LordMidas <55047920+LordMidas@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:01:19 -0500 Subject: [PATCH] feat: add ability to use event colors to colorize text and values --- msu/utils/text.nut | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/msu/utils/text.nut b/msu/utils/text.nut index 583d5557..f386a65f 100644 --- a/msu/utils/text.nut +++ b/msu/utils/text.nut @@ -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 ) @@ -40,6 +40,7 @@ AddSign = false, CompareTo = 0, InvertColor = false, + UseEventColors = false, AddPercent = false }; @@ -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)