Raised This Month: $ Target: $400
 0% 

Colors in Transition v2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
seekenz
Member
Join Date: Mar 2015
Location: Poland
Old 03-27-2015 , 07:06   Colors in Transition v2
Reply With Quote #1

Why colors in transitional don't work properly?

I've got something like
Code:
"Commercial"
{
	"#format"	"{1:s}"
	"pl"		"Bla bla \x04BLAAA\x01! BLA LA: \x04{1}"
}
But it just prints "\x4", "\x1" instead of changing colors.

I've found a topic https://forums.alliedmods.net/showthread.php?t=121330 but there is no answer. They suggest to use additional library, but I don't need extra colors. I want to do it without extra libraries.

So how to do it?

Last edited by seekenz; 03-27-2015 at 07:11.
seekenz is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-27-2015 , 09:54   Re: Colors in Transition v2
Reply With Quote #2

I'd assume escape sequences are only evaluated in string literals at compile-time. You'll either need to replace them yourself (e.g. formatting the translation to a string and doing ReplaceString on it) or manually add 04 and 01 bytes to the text file.
Miu is offline
seekenz
Member
Join Date: Mar 2015
Location: Poland
Old 03-29-2015 , 14:25   Re: Colors in Transition v2
Reply With Quote #3

Quote:
Originally Posted by Miu View Post
I'd assume escape sequences are only evaluated in string literals at compile-time. You'll either need to replace them yourself (e.g. formatting the translation to a string and doing ReplaceString on it) or manually add 04 and 01 bytes to the text file.
How can I add manually 04 and 01 bytes to a text file?
seekenz is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 03-29-2015 , 15:46   Re: Colors in Transition v2
Reply With Quote #4

Quote:
Originally Posted by seekenz View Post
How can I add manually 04 and 01 bytes to a text file?
With a hex editor.

It's a lot easier to just use that library though.
Miu is offline
seekenz
Member
Join Date: Mar 2015
Location: Poland
Old 03-30-2015 , 07:26   Re: Colors in Transition v2
Reply With Quote #5

OK, finally I used simple string replace Thanks for help.
seekenz is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-30-2015 , 09:17   Re: Colors in Transition v2
Reply With Quote #6

I did it with notepad++
KissLick is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode