[INC] More Colors (1.9.1)
About:
Adds a whole bunch of colors (thanks asherkin!) for plugins to use in chat. Fully (I think) backwards-compatible with the original colors.inc. You can use multiple team colors in the same message! Only works in Source 2009 games, which include:
Important! In order for your plugins to load properly on older versions of SourceMod, you need to include this in your plugin: PHP Code:
PHP Code:
Just put the color name in curly braces (i.e. {cyan}) PHP Code:
You can see all the colors in action here. Plugin authors: feel free to link to this page in your plugin threads to show users what colors are available. Changelog:
Download morecolors.inc . |
Re: [INC] More Colors (1.0.0BETA)
Can use multiple team colors in the same message, multiple colors... woo very nice!
But could be done for CS:S ? or you think it would be possible? |
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Nice
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
That being said, please don't use this include in a published plugin yet. It's liable to explode. |
Re: [INC] More Colors (1.0.0BETA)
Hello, is it possible to add support for other games? now its look like that
https://forums.alliedmods.net/attach...6&d=1336890795 |
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
theres no CSGO support either, also it was talked about here on the forums. ive just tried
|
Re: [INC] More Colors (1.0.0BETA)
Equivalent of CRemoveTags?
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
McKay, any chance of adding support for {#FFFFFF} tags, as that one advertisements plugin already has? And even {##FFFFFFAA} for alpha as well using \x08?
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Thought this might come of use to some people:
PHP Code:
|
Re: [INC] More Colors (1.0.0BETA)
bl4nk, wouldn't it be easier to just use GetRandomInt(0, MAXSIZE) and set the alpha bits to 0xFF ?
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
sure, but you don't want to have random transparency, do you ? :P
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Ok, but my previous question was just pointed at bl4nk's code :3
|
Re: [INC] More Colors (1.0.0BETA)
I added in CRemoveTags. I didn't include bl4nk's random RGB, yet, though. I'm also slightly worried about the idea of having a trie and an array for each plugin using colors. While a bit strange, using a plugin to manage color stocks may be a bit better, though then plugins would have to share the same custom colors added via CAddColor... I dunno. And yes, it's probably just easier to use \x07CUSTOM instead of {#CUSTOM}, but I was concerned about if it was fine in translation files, so I made the suggestion anyways.
If you're planning on implementing \x08, for simplicity I'd suggest having everything use \x08, using FF for the alpha for the included colors that are using \x07 right now. ... https://forums.alliedmods.net/showpo...0&postcount=25 |
Re: [INC] More Colors (1.0.0BETA)
Quote:
I was slightly concerned about every plugin having its own trie, but whatever. I'd rather continue using \x07 for text with full alpha, since color codes take up part of the maximum chat message length. Each color would take up two additional characters. |
Re: [INC] More Colors (1.0.0BETA)
This is pretty much unusable [for me] because CPrintToChatAllEx never works
|
Re: [INC] More Colors (1.0.0BETA)
1 Attachment(s)
Technically, we don't need CPrintToChatAllEx anymore, it's only there for backwards compatibility with colors.inc-using plugins. Its only function was to specify a color based on a particular client via the {teamcolor} tag, but you can do that now in various other ways, so.... yeah. What's the issue you're having with it?
Ooh, found the bug. VFormat under CPrintToChatAllEx should have '3' as the last arg, not '2'. McKay, you've gotta be saying 'damn you copypaste' right about now. Change that and you should be good to go, noodle. McKay: your concerns over the extra 2 chars makes sense, considering some of the stuff people like to print to clients. EDIT: Here. |
Re: [INC] More Colors (1.0.0BETA)
Oops…
I'll try to update it today. That being said, this is still a beta and shouldn't be used in any released plugins… |
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
FlaminSarge: I'm not a huge fan of the way you're using both an array and a trie… uses up more memory and is a bit unnecessary. I prefer to parse the string to find tags then check if they match a color tag, but that's just me.
|
Re: [INC] More Colors (1.0.0BETA)
You'd still have to iterate through the trie's keys, and for that you need an array. Think about it:
1) Parse string, find { } tags. Save these locations somewhere. 2) At each location, check to see if the tag matches any color tags. You'll need to check every key in the trie, but you can't iterate through tries, so you'll need to go through some other thing that stores the keys. That's what the array's for (you could use the non-ADT array, but that won't have dynamic sizing so you'd have to have a MAX_COLORS define). 3) You replace those with empty space. You'd have to move all other pieces of the string down to where the tag is removed. I believe in either case, you'd need something like that. Using ReplaceString and iterating through the array is much easier than manually editing the string like that. If you're worried about space, you could make this a plugin, and then all plugins using it would share the same set of colors, and each time you added a color all plugins would get that color. That may or may not be a good thing. |
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Quote:
|
Re: [INC] More Colors (1.0.0BETA)
Alright, I've updated it to 1.1.0. It's still in beta, but it now has a CRemoveTags stock. I've also fixed the bug with CPrintToChatAllEx.
Here's a full changelog:
|
Re: [INC] More Colors (1.1.0BETA)
These may already be included in the list (since I don't know their hex values) but what would you think of adding item-type colors, such as Unusual, Strange, Genuine, Vintage etc. (swatch here) as well as the various single-tone paints in the game?
|
Re: [INC] More Colors (1.1.0BETA)
Quote:
|
Re: [INC] More Colors (1.1.0BETA)
From ClientScheme.res:
Code:
"QualityColorNormal" "178 178 178 255" There's a lot more colors defined in ClientScheme, so take a look. Of interesting note: Code:
//"Black" "0 0 0 255" |
Re: [INC] More Colors (1.1.0BETA)
Thanks for the ClientScheme.res tip, I was just going to use the colors from the wiki.
Quote:
|
Re: [INC] More Colors (1.1.0BETA)
Mostly in the documentation. Do a diff with the morecolors.inc I posted a few posts up, you'll see 'em.
|
Re: [INC] More Colors (1.1.0BETA)
I've added a lite version, morecolorslite.inc.
It only has one stock: PHP Code:
Note: If you include morecolors.inc and only use CGetTeamColor, it'll be basically the same since none of the other stocks will be compiled into the plugin, and the trie will never be initialized. |
Re: [INC] More Colors (1.1.0BETA)
very nice; I'm in love with this include *.*
|
Re: [INC] More Colors (1.1.0BETA)
Chat colors [PSD] v3.0 Bored of edit the color -> reloading -> edit again... Those days are over now! Get instant feedback in Adobe Photoshop. https://dl.dropbox.com/u/10877736/al.../06540651d.gif https://dl.dropbox.com/u/10877736/al...or_changer.gif Download the PSD file: - click here - Looking for color combinations ? https://kuler.adobe.com http://colourlovers.com/palettes/mos...ites/all-time/ |
All times are GMT -4. The time now is 13:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.