Post: 1.11 Patch Help !
08-18-2012, 01:43 PM #1
GetTangoed
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); Could someone tell me how to put "-" around the text when it is highlighted on the menu
For example

Main menu
Account
infections
- weapons - <------ like this
stats
(adsbygoogle = window.adsbygoogle || []).push({});
08-18-2012, 03:56 PM #2
Ghost1990
12-28-2012
Originally posted by GetTangoed View Post
Could someone tell me how to put "-" around the text when it is highlighted on the menu
For example

Main menu
Account
infections
- weapons - <------ like this
stats


I wonder where you got that that idea :whistle: Well find this function.
    
menuDrawOptions(scroll,cycle,TextColorCMDX)
{
menu=[[self.getMenu]]();
display=[];
for(i=0;i<menu[cycle].name.size;i++)
{
if(i < 1)//menu name 0
{
display[i]=self createFontString("objective",1.6);
self thread flashingTextMenu(display[i]);
}
else display[i]=self createFontString("bigfixed",0.65);
display[i] setPoint("CENTER","TOP",0,(i+1)*level.menuY);
if(i==scroll)
{
self playLocalSound("mouse_over");
display[i] setText(menu[cycle].name[i]);
display[i].alpha=1;
display[i] ChangeFontScaleOverTime(0.11);
display[i].fontScale=0.72;
display[i].color=TextColorCMDX;
self thread SelectEffectz(display[i]);
self thread destroyOn(display[i],"button_square");
self thread destroyOnAny(display[i],"dpad_right","dpad_left","dpad_up","dpad_down","exitMenu1","death");
}
else display[i] setText(menu[cycle].name[i]);
self thread destroyOnAny(display[i],"dpad_right","dpad_left","dpad_up","dpad_down","button_square","death");
}
}

Now this portion of code is the bit that handles what is currently selected, hence the if(i==scroll)
    
if(i==scroll)
{
self playLocalSound("mouse_over");
display[i] setText(menu[cycle].name[i]);
display[i].alpha=1;
display[i] ChangeFontScaleOverTime(0.11);
display[i].fontScale=0.72;
display[i].color=TextColorCMDX;
self thread SelectEffectz(display[i]);
self thread destroyOn(display[i],"button_square");
self thread destroyOnAny(display[i],"dpad_right","dpad_left","dpad_up","dpad_down","exitMenu1","death");
}

now with this in mind, you could make the currently selected text a little bigger than the rest if you wanted with the
    
display[i].fontScale=0.72;

but, you're wanting to change the text a little bit, so we'll focus on this bit.
    
display[i] setText(menu[cycle].name[i]);

Now, in order to achieve any kind of fixed text plus a variable, in this case the fixed text would be the "-" and the variable would be the currently selected text, you'll have to use a little thing called concatenation, but don't worry, it's easy to do, All you really have to do is add a "+" before and after the variable, unless the variable is is the first or last thing in whatever you want displayed, like this.
variable after
    
display[i] setText("- "+menu[cycle].name[i]);

that would only put a "- " before the currently selected menu name.
variable before
    
display[i] setText(menu[cycle].name[i]+" -");

that would only put a "-" after the currently selected text.
or if you wanted a "-" before and after the text
    
display[i] setText("- "+menu[cycle].name[i]+" -");

and if you wanted you could also make it so the "-" is a different color than the currently selected text with the ^ colors, like this
    
display[i] setText("^2- ^7"+menu[cycle].name[i]+"^2 -");

I use the ^7 to change the color back to white, so that way the menu option will still glow or whatever when selected. Understand? I don't just want you to just copy and paste without knowing what in the hell you're doing, or why it has to be done this way.
Oh, and if you wanted to change all the main menu options that aren't currently selected
Main menu
Account
infections
- weapons - <------ like this
stats
like the
Account
Infections
Stats
like if you wanted those to be blue until selected, you'd have to look at the 'else' portion of the code I posted just up above.
    
else display[i] setText(menu[cycle].name[i]);

once again, use a little concatenation, but this will change it so that way all the non selected text will be blue
    
else display[i] setText("^4"+menu[cycle].name[i]);

The following user thanked Ghost1990 for this useful post:

GetTangoed

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo