Page 1 of 1

Translation Colors

Posted: Tue Sep 15, 2015 11:05 am
by BackRaw
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!

Posted: Tue Sep 15, 2015 1:01 pm
by satoon101
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

Posted: Tue Sep 15, 2015 7:53 pm
by BackRaw
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!