Translation Colors

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Translation Colors

Postby BackRaw » Tue Sep 15, 2015 11:05 am

Hi,

can you elaborate a bit on how I can use a color directly in the plugin's translation file?
I mean the \x03 and \x02 or \x01 values - what is each's exact color representation?

Thanks!
My Github repositories:

Source.Python: https://github.com/backraw
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Sep 15, 2015 1:01 pm

That depends on the game. For CS:GO:
http://forums.sourcepython.com/showthread.php?586&p=3062&viewfull=1#post3062

\x03 is the team color for the given index argument in every game I have ever used SayText2.

Also, for games that support it (as far as I know, only OrangeBox games), you can also use colors from the colors module (or custom Color objects). Just str() them, and it returns the hex representation of the color:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/colors/colors_wrap.cpp#L80
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/colors/colors.h#L47
Image
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Tue Sep 15, 2015 7:53 pm

satoon101 wrote:That depends on the game. For CS:GO:
http://forums.sourcepython.com/showthread.php?586&p=3062&viewfull=1#post3062

\x03 is the team color for the given index argument in every game I have ever used SayText2.

Also, for games that support it (as far as I know, only OrangeBox games), you can also use colors from the colors module (or custom Color objects). Just str() them, and it returns the hex representation of the color:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/colors/colors_wrap.cpp#L80
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/colors/colors.h#L47


Good to know, great. Thanks!
My Github repositories:

Source.Python: https://github.com/backraw

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 133 guests