Vice City: Multiplayer

VC:MP Discussion => Support => Bugs and Crashes => Topic started by: Razor. on March 23rd, 2021, 05:57 PM

Title: [Bug] GUILabel().Text color not changing.
Post by: Razor. on March 23rd, 2021, 05:57 PM
Description:
GUILabel().Text color not updating/reseting after text change.

Reproducible:
Always.

How to reproduce:

Code: [Select]
Label <- GUILabel();
Label.TextColour = Colour(255, 255, 255, 255);
Label.AddFlags(GUI_FLAG_TEXT_TAGS);
Label.FontFlags = GUI_FFLAG_BOLD;
Label.Text = "[#ff00ff]purple colored text";
//Example 2: "purple colored [#ff00ff]text";

After this, change the GUILabel().Text value:
Code: [Select]
Label.Text = "purple colored text";
or
Code: [Select]
Label.Text = "purple colored[#ffffff0] text";
Even putting a color or not, the text color will not change or will not change correctly.

I realized the test using a client-side /execc.
Title: Re: [Bug] GUILabel().Text color not changing.
Post by: Mohamed Boubekri on March 23rd, 2021, 06:33 PM
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.
Title: Re: [Bug] GUILabel().Text color not changing.
Post by: AdTec_224 on March 23rd, 2021, 07:00 PM
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:

Code: [Select]
Label.Text = "[#ff00ff]purple colored text[#d]";

then when you change the text, you can just do:

Code: [Select]
Label.Text = "non-purple colored text";

and the line will be the default colour.

Hope this helps.