Jump to content
Sign in to follow this  
A-SUICIDAL

Changing the color of a menu action

Recommended Posts

I've figured out how to change the color of a simple menu action, like this repair action that appears in red...

this addAction [("<t color=""#FF0000"">" + ("Repair Vehicle") + "</t>"),"vehicle\veh_repair.sqf",nil,+1,true,true,"","(!canMove _target or (damage _target>0 and damage _target<1)) and player distance _target<7"];

...but I am having trouble changing the color of an action that already uses "Format" in the action.

The action color that I wanted to change is the action "Weapon to Backpack", which normally appears as a light grey action on most servers that use the script.

I've managed to change the color of the action everyplace in the script except this very long line. The last part of the line has the "addAction that I want to change to a light grey color "EEEEEE".

_trigger setTriggerStatements["primaryWeapon player != prim_weap_player","prim_weap_player = primaryWeapon player;if (pbp_id != -1 && count player_backpack == 0) then {player removeAction pbp_id;pbp_id = -1;};if (pbp_id == -1 && count player_backpack == 0 && prim_weap_player != """") then {pbp_id = player addAction [format [""%1 to Backpack"", prim_weap_player], ""scripts\x_backpack.sqf"",[],-1,false];};",""];

so just the last part of that line that contains the action that I want to change -would be this:

pbp_id = player addAction [format [""%1 to Backpack"", prim_weap_player], ""scripts\x_backpack.sqf"",[],-1,false];

How would I change it to appear as light grey? I've tried many times to do it myself, but I kept getting errors, so obviously I am doing it wrong.

There are other actions in my mission that I would like to apply this to as well, so knowing how to do this would help alot.

Share this post


Link to post
Share on other sites

Not what you're looking for, but here's a good resource for hex color codes. :)

Should be able to just add the color code stuff to the format of that part, just like in the first example. Might get confusing with all the quotes, but should work.

Share this post


Link to post
Share on other sites

Yeah, I tried adding it before the format and after and also made sure to use the double quotes, but I still had no luck with it. If I could find a domin west mission download that uses the "Weapon to backpack" script, I could simply take a look at how they scripted it, but I can only find old domi missions that did not start using the script yet. The 18th Vanilla server uses it. They play "co64 DomiOA! West 2.68". I wish I new where I could download that mission.

Share this post


Link to post
Share on other sites

I got it working.

pbp_id = player addAction [(""<t color=""""#DDDDDD"""">"" + format [""%1 to Backpack"", prim_weap_player]  + ""</t>""), ""scripts\x_backpack.sqf"",[],-1,false];

I made a typo the first time I tried getting it to work.

Guessing that I might have made a typo the first time around - I then tried scripting it the same way again and suddenly it worked. It was probably missing a double quote someplace.

You gotta admit - that is one very unique addAction.

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
Sign in to follow this  

×