Jump to content
Dekade

Action Scroll Menu Colors

Recommended Posts

I've been trying to add color to a custom action in the scroll menu but I can't seem to figure it out.


This is what I have;

_SM = SM_Officer addAction ["Recruit Squad", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

SM_Officer setUserActionText [_SM, "Recruit Squad", "", "<t color='#ff0000'>Recruit Squad</t>"];

The action text that is displayed on the center of the screen is colored the way I want but the item in the scroll menu still just shows as the default white color.
I tried adding the color tag to the addAction String but that doesn't seem to do the trick.

I've looked everywhere but can't seem to figure it out, it's probably trivial but if someone can point me in the right direction that would be great.

Thanks in advance!

 

Regards,

Dekade

 

Share this post


Link to post
Share on other sites
_SM = SM_Officer addAction ["<t color='#FF0000'>Recruit Squad</t>", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

OcSDsHf.jpg

 

 

Share this post


Link to post
Share on other sites
6 minutes ago, Harzach said:

_SM = SM_Officer addAction ["<t color='#FF0000'>Recruit Squad</t>", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

OcSDsHf.jpg

 

For some strange reason that is not working for me. Even when copy/pasting I don't get the same result.
Any clue why?

 

My code:

_SM = SM_Officer addAction ["<t color='#ff0000'>Recruit Squad</t>", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

SM_Officer setUserActionText [_SM, "Recruit Squad", "", "<t color='#ff0000'>Recruit Squad</t>"];

Thanks

Share this post


Link to post
Share on other sites

Mine:

13 minutes ago, Harzach said:

_SM = SM_Officer addAction ["<t color='#FF0000'>Recruit Squad</t>", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

 

 

Yours:

6 minutes ago, Dekade said:

_SM = SM_Officer addAction ["<t color='#ff0000'>Recruit Squad</t>", {
	[] spawn DEK_fnc_spawnPlayerSquad;
}];

SM_Officer setUserActionText [_SM, "Recruit Squad", "", "<t color='#ff0000'>Recruit Squad</t>"];

 

 

Not only is setUserActionText redundant here, it is actually undoing what we started with.

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, Harzach said:

Mine:

 

Yours:

 

Not only is setUserActionText redundant here, it is actually undoing what we started with.


Damn that was simple. #FeelsStupid

Thanks man! 

  • Haha 1

Share this post


Link to post
Share on other sites

setUserActionText is great for when you want to have different text in the text menu and text window. For example, here's a snippet I grabbed from someone a few years ago:

 

_GPS = this addAction ["Take GPS","player addItem 'ItemGPS';",nil,6,true,false,"","true",-1,false,"",""];
_map = this addAction ["Take Map","player addItem 'ItemMap';",nil,6,true,false,"","true",-1,false,"",""];
_radio = this addAction ["Take Radio","player addItem 'ItemRadio';",nil,6,true,false,"","true",-1,false,"",""];
_compass = this addAction ["Take Compass","player addItem 'ItemCompass';",nil,6,true,false,"","true",-1,false,"",""];
this setUserActionText [_gps,"Take GPS","Use Scroll Wheel<br/>to select item",""];
this setUserActionText [_map,"Take Map","Use Scroll Wheel<br/>to select item",""];
this setUserActionText [_compass,"Take Compass","Use Scroll Wheel<br/>to select item",""];
this setUserActionText [_radio,"Take Radio","Use Scroll Wheel<br/>to select item",""];

 

Place it in any object and you'll see that the window text never changes, so as to direct your attention to the choices you have in the menu:

 

STODeiY.png

  • Like 3

Share this post


Link to post
Share on other sites

setUserActionText can of course change the color too, you just need to add the color in the right place

SM_Officer setUserActionText [_SM, "<t color='#ff0000'>Recruit Squad</t>", "", "<t color='#ff0000'>Recruit Squad</t>"];

 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for the information guys! Very helpful.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×