Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color constants for announcement and mes #364

Closed
wants to merge 2 commits into from

Conversation

AnnieRuru
Copy link
Contributor

just declare a bunch in the constant file, then viola !
new bunch of color code can be use without refering to external sites for color effects
http://hercules.ws/board/topic/7024-add-color-constants-for-announce/

@MishimaHaruna might love this ?

just declare a bunch in the constant file, then viola !
new bunch of color code can be use without refering to external sites for color effects
http://hercules.ws/board/topic/7024-add-color-constants-for-announce/
follow up 0518032
ops ... hercules constants are case-sensitive
@shennetsind
Copy link
Member

ooo I had no idea the game client accepted non-hex values there

@MishimaHaruna
Copy link
Member

While this works with announcement (great idea there, by the way), does it really work with mes, at all? Has it been tested?

Here's what I expect to happen, if used with mes (I haven't tested it, I'm just guessing):

// C_RED is 0xFF0000 (in decimal, it translates to 16711680)
// C_BLACK is 0x000000 (in decimal, it translates to 0)
mes "Or you can use ^"+ C_RED +" C_ constants ^"+ C_BLACK +".";
// This does string concatenation. When we convert numbers to strings, we print them as decimal values. So it is equivalent to:
mes "Or you can use ^16711680 C_ constants ^0.";
// ^167116 is green. ^0 is an invalid color.
// it should print: in black, "Or you can use ", then in green: "80 C_ constants ^0."
// C_BLUE is 0x0000FF (in decimal, it translates to 255)
// C_BLACK is 0x000000 (in decimal, it translates to 0)
mes (.@i +1) + ". ^"+ C_BLUE + .@name$[.@i] + "^"+ C_BLACK;
// This does string concatenation. When we convert numbers to strings, we print them as decimal values. So it is equivalent to:
mes (.@i +1) + ". ^255" + .@name$[.@i] + "^0";
// ^255 and ^0 are both invalid is an invalid colors.
//If a party member name begins with valid hex digits, it'll be merged to the ^255, and might produce a valid color. Try with a character named "Fabrizio", to produce:
mes (.@i +1) + ". ^255Fabrizio^0";
// The color ^255FAB is light blue. It should print "rizio^0" in light blue.

@GmOcean
Copy link
Contributor

GmOcean commented Dec 1, 2014

@MishimaHaruna - While, I agree with what you're saying about it not working with mes command. Wouldn't it be far simpler to just manage this on the src side?
For instance, just detecting if the string being passed through the mes command contains a bit of text containing: ^C_
Then, if so just replace the code with the proper hex values? I mean to say, yes I know it makes this complicated on the src side, but this way we wouldn't need to type: ^"+C_BLUE+" and could just type: ^C_BLUE

Edit: Or rather this just occurred to me, why don't we just add support for string constants? This would effectively solve the problem would it not?

@shennetsind
Copy link
Member

I'm on maid mode. Closing this due to lack of feedback from the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants