Change text color

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Change text color

Post by gsagostinho »

Hi all,

I started tweaking the current HUD but I can't find out how do I change the color of certain text messages, such as the "weapons offline" (always green), or the communication or messages log (always yellow). Is it possible to tweak those or are these color values hard coded? And if the latter, is there any plans to support this in the next releases?

Cheers!
Gilberto
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Change text color

Post by phkb »

You can change the colour of some of these elements:
For "Weapons offline":

Code: Select all

		{// WEAPONS SYSTEM ONLINE STATUS
			selector ="drawWeaponsOfflineText:";
			alert_conditions = 14;
			height = 11.0;
			width = 11.0;
			x = 5.0;
			y = 2.0;
			y_origin = -1;
			x_origin = -1;
			color = "0 0.58 1.0 1"; // this line will adjust the color
		},
The comms and msg log colours appear to be hard-coded, though.
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Change text color

Post by gsagostinho »

@phkb thank you so much for the reply, but unfortunately the code above does nothing to me, the weapons' text is still always green. And that is also the case when I used an unaltered version of the Xenon HUD, even though your code does try to override the colour of that text it was also always green. I think I will drop a feature request to the devs at the GitHub page, perhaps it wouldn't be too much trouble making all these text colours changeable.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6685
Joined: Wed Feb 28, 2007 7:54 am

Re: Change text color

Post by another_commander »

Weapons offline text, as well as some other stuff (FPS counter, messages etc) are all hardcoded.

I will commit the color selection functionality for the first two shortly. Messages will be a bit trickier though. Check out the next nightly. To make it work, you will have to add the line

Code: Select all

rgb_color = "orangeColor"; // or whatever color definition you prefer
in hud.plist, for the sections regarding the weapons and fps counter texts.

Edit: Done. Example screenie:
Image
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Change text color

Post by phkb »

gsagostinho wrote:
the code above does nothing to me, the weapons' text is still always green
Well, that serves me right for not testing something before posting! :oops:
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Change text color

Post by gsagostinho »

@another_commander Many, many thanks!
@phkb Not a problem at all :D
User avatar
gsagostinho
---- E L I T E ----
---- E L I T E ----
Posts: 573
Joined: Sun Jul 19, 2015 1:09 pm

Re: Change text color

Post by gsagostinho »

In case someone comes across this in the future: as of the current version 1.85 from git, it is possible to change the colours of the weapons offline and FPS texts, the message text colour, as well as the target reticle colour. Thanks another_commander for implementing all these!
Post Reply