[gui] change particle color

[gui] change particle color

Postby Unnamed » 08 Oct 2013, 15:11

After reading it up in the source code I found out the formula for particle color:
2^16 * red + 2^8 * green + blue (red, green, blue = 0..255)
I tested it. Correct me if it is wrong.
But it's annoying to type the whole stuff in cubescript every time so I made a gui now to change the particle color.
Add "exec partcolor.cfg" to autoexec.cfg, select a particle entity and write /changeparticlecolor (You should editbind it if you want to use it often. For me KP_ENTER was not used.)
You can select a color from the list and change the color with three sliders. I also added a "bright" checkbox like at the newlight gui.
The right entity attribute will be changed (I also considered that the progress versus particle has two colors). If an ent wich is not a particle is selected the "change color" button will do nothing.

changelog:
-added preview field for the colour and changed the sliders
-added the option to take the player colour and the particle colour or reset to 0
-added an option to save (and delete) colours. Up to 19 colours can be shown. They can't be named, but the text has the saved colour.
-added scrollbox for saved colours
-buttons instead of guiradio
-reduced the number of displayed colours to 9
-added the option to give colours a name before saving them. you can save the same colour multiple times if it has a different name (disable it?)
Attachments
partcolor.cfg
(4.53 KiB) Downloaded 350 times
screenshot.0242.jpg
Last edited by Unnamed on 12 Oct 2013, 09:49, edited 5 times in total.
Unnamed
 
Posts: 189
Joined: 05 May 2013, 18:16

Re: [gui] change particle color

Postby qreeves » 09 Oct 2013, 03:24

It's the same format as used by the player profile colour selection (24bit: 0xRRGGBB), maybe that will help you and give you some ideas on how to preview the selected colour ;)
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: [gui] change particle color

Postby Unnamed » 09 Oct 2013, 14:19

Writing 0xRRGGBB into the /entattr command works. I didn't knew that :(
I haven't thought about a preview. This is added to the new version.
You can also save colours to use them later. It could also be usefull for lights and texture colour / glow colour.
Unnamed
 
Posts: 189
Joined: 05 May 2013, 18:16

Re: [gui] change particle color

Postby bonifarz » 11 Oct 2013, 23:13

Unnamed {l Wrote}:Writing 0xRRGGBB into the /entattr command works. I didn't knew that :(

Heheh, same here. I did use exactly the same type of decimal conversion until someone gave me a clue about entering integers as hex numbers using 0x. :)
Actually, I think S.E.S. has found a very nice solution for these things in his agui, where all sorts of entity colors can be entered as both decimal rgb-triplets and in 0xrrggbb format. Also there are previews and options to grab colors. Well, I keep posting the same link, but it is just too useful to have people miss it ;)
User avatar
bonifarz
 
Posts: 379
Joined: 09 Apr 2012, 12:16
Location: switzerland

Re: [gui] change particle color

Postby Unnamed » 12 Oct 2013, 10:00

Well, I don't like guis, but I often forget wich colours I used for lights or textures.
It was interesting to make a small gui. It would be awesome if the hud could be made in a simmilar way as guis are.
Unnamed
 
Posts: 189
Joined: 05 May 2013, 18:16

Who is online

Users browsing this forum: No registered users and 1 guest