Vice City: Multiplayer
VC:MP Discussion => Support => Bugs and Crashes => Topic started by: Razor. on March 23rd, 2021, 05:57 PM
GUILabel().Text color not updating/reseting after text change.
How to reproduce:
Label <- GUILabel();
Label.TextColour = Colour(255, 255, 255, 255);
Label.FontFlags = GUI_FFLAG_BOLD;
Label.Text = "[#ff00ff]purple colored text";
//Example 2: "purple colored [#ff00ff]text";
After this, change the GUILabel().Text value:
Label.Text = "purple colored text";
Even putting a color or not, the text color will not change or will not change correctly.
Label.Text = "purple colored[#ffffff0] text";
I realized the test using a client-side /execc.
Actually, you can avoid that, like :-
Set the label null //// hide the label
label.label = null; //// like that
And after you set it null create it again and change the color.
It's not really a bug per se, MGUIs intended behaviour is to continue with the defined colour until you close the colour tag using '[#d]'. So to conform to what MGUI is looking for, it should be:
Label.Text = "[#ff00ff]purple colored text[#d]";
then when you change the text, you can just do:
Label.Text = "non-purple colored text";
and the line will be the default colour.
Hope this helps.