Raised This Month: $319 Target: $400
 79%   Almost there!

[INC] ColorLib


Post New Thread Reply   
 
Thread Tools Display Modes
c0rp3n
Junior Member
Join Date: Jan 2019
Location: Derbyshire, UK
Old 02-09-2020 , 07:55   Re: [INC] ColorLib
Reply With Quote #11

Quote:
Originally Posted by Ilusion9 View Post
It seems there's an error with CSayText2 function:

PHP Code:
Exception reportedInvalid field "params" for message "CCSUsrMsg_SayText2" 
You should use: UserMessageToProtobuf() function (see multicolors) instead of view_as<Protobuf>

Thanks for the report, this is now fixed on the git, as well as another issue from Bara where the 'z' flag wasnt working for CPrintToChatAdmins, there is also an example GitHub workflow for building the color_map.inc in your actions.
__________________
Plugin Developer for CLWO.eu, ex Mythical Gaming and Traitors Cave.

Last edited by c0rp3n; 02-09-2020 at 07:56.
c0rp3n is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-10-2020 , 14:43   Re: [INC] ColorLib
Reply With Quote #12

If you write %t to include translations it won't work, it only works with %T, I hope you add support for %t if plausible.
__________________
TheDS1337 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-11-2020 , 11:21   Re: [INC] ColorLib
Reply With Quote #13

Quote:
Originally Posted by TheDS1337 View Post
If you write %t to include translations it won't work, it only works with %T, I hope you add support for %t if plausible.
What function? CPrintToChat?
I see there's SetGlobalTransTarget, that should do it for %t.
__________________
Ilusion9 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-20-2020 , 13:21   Re: [INC] ColorLib
Reply With Quote #14

CRemoveTags doesn't work well for me. If there's no tags, the first index is removed (ex: for my name "Ilusion" appears "lusion"). Maybe use a buffer and construct again the message like in CFormat function?
__________________
Ilusion9 is offline
c0rp3n
Junior Member
Join Date: Jan 2019
Location: Derbyshire, UK
Old 02-21-2020 , 05:04   Re: [INC] ColorLib
Reply With Quote #15

Yeah I've gone though and fixed the issue, was to do with me checking if the index's are the same and skipping copying values, this has now been sorted along with adding a new function to remove color escape codes from a message `CRemoveColors`.
Also there was an additional bug fix for CSayText2 where I was calling SetString on the proto buffer instead of AddString for the params. This was why you had the error before, didnt notice it as rarely use CPrintToChatEx in code, I have gone back to using view_as<ProtoBuff> for now as the check done by UserMessageToProtobuf is already done in _CL_SupportsProtoBuf.
__________________
Plugin Developer for CLWO.eu, ex Mythical Gaming and Traitors Cave.

Last edited by c0rp3n; 02-21-2020 at 05:08.
c0rp3n is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-21-2020 , 06:51   Re: [INC] ColorLib
Reply With Quote #16

Have you thought about checking if the color is valid? If not, keep the tag.
Something like:

PHP Code:
bool _CL_ColorMap(char color[16], char &hexColor)
{


__________________
Ilusion9 is offline
c0rp3n
Junior Member
Join Date: Jan 2019
Location: Derbyshire, UK
Old 02-22-2020 , 08:30   Re: [INC] ColorLib
Reply With Quote #17

Made the change to keep bad / incorrect color tags, but just using 0 or well null, `CPrintToChat(client, "{bad tag here}Hello {green}World");` will remove green but `bad tag here` would stay.
__________________
Plugin Developer for CLWO.eu, ex Mythical Gaming and Traitors Cave.
c0rp3n is offline
Reply


Thread Tools
Display Modes

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 18:14.


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