project-navigation
Personal tools

Author Topic: How to color strings in menus  (Read 2679 times)

Hoehrer

  • Guest
How to color strings in menus
« on: March 30, 2006, 11:23:13 am »
I do know that you can color the strings with a function in ufo-file itself.
e.g the white color of the selected-items in buy/research-menu:
Code: [Select]
confunc researchselect0  { research_clear *txt_item0  color "1 1 1 1" }

But is there a method to do this from c-code? Similar to setting the name with
Code: [Select]
Cvar_Set("mn_researchitem0",  "New Name" );

Code: [Select]
string txt_item0
{
string "*cvar mn_researchitem0"
pos "50 40"
color "0 .78 0 1"
size "275 16"
click { cmd "research_select 0" }
}


i mean, i could set this with a code like ...
Code: [Select]
color "*cvar mn_researchitem_color0"
and
Code: [Select]
Cvar_Set("mn_researchitem_color0",  "1 0 0 1" );
...but wouldn't that overwrite the color-permanently? so "researchselect0" doesn't work anymore?

I need this info because i want to color the research-item according to it's status.

I'll test this out as soon as i can, but i could save myself precious time if s/b knows that something like this is possible (and probably done elsewhere already).

Werner