[Bug] GUILabel().Text color not changing.

Razor.

  • Jr. Member
  • Posts: 96
[Bug] GUILabel().Text color not changing.
«  »Last edited
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.

We3da

  • Sr. Member
  • Hello i'm we3da
  • Posts: 260
[Bug] Re: GUILabel().Text color not changing.
« Reply #1,  »Last edited
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.
After all this pain, peace will come.

AdTec_224

  • LU Developer
  • Posts: 30
[Bug] Re: GUILabel().Text color not changing.
« Reply #2,  »
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.