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 posibility to use (color) color constants in chat:send messages #19

Closed
misterff1 opened this issue May 31, 2015 · 7 comments
Closed

Comments

@misterff1
Copy link
Contributor

right now when this is used, the (color) part is removed and it throws an error(luckily not the type that shuts down the script). 't would be very useful to actually be able to use multiple colors in Chat:Send, Chat:Print. Chat:Broadcast and player:SendChatMessage. An example for such usage would be coloured tags, a Chat AI and stuff like that.

@alecxvs
Copy link
Owner

alecxvs commented May 31, 2015

While only available on the client, UTChat::PostMessage allows for using color tags, as well as using programmatically built UText objects. The latter would be preferred if you are posting messages from code because programming the formats may be more reliable than using a chat handler like color tags.

Adding a server-side method for this will be tricky because I am gearing towards having multiple instances of UTChat, so the problem is which one to use. Perhaps if the server does not specify a specific chat (which is how I would implement it, and add a function for specific chats later), it sends it to a 'global' chat which appears in all UTChats.

So the plan will be to add a 'global' UTChat to the client and add a PostMessage function to the server to post to this global UTChat.

Also, color tags should already be able to handle multiple tags, does it not?

@alecxvs alecxvs added this to the 1.0.5-alpha milestone May 31, 2015
@alecxvs alecxvs self-assigned this May 31, 2015
@misterff1
Copy link
Contributor Author

Yeah they support multiple taga, but I meant as in [VIP] with VIP and name having a one color and the message another. Like what is done right now in, for example, admin scripts where it overrides the message and sends one in a red color. Problem is those can only use on color thanks to limitations in color usage.

But I am glad to hear you want multiple chat instances in the future. Was going to work on that myself once #17 was solved, but if you do it I think it will be more advanced and stable. How does one use utchat::postmessage btw? Same as chat print? (i.e. UTChat::PostMessage( )) and if so, how do you add more colors in one message?

@alecxvs
Copy link
Owner

alecxvs commented May 31, 2015

You use PostMessage by passing a UText object. It does the rest of the work and puts it in the chat. Unfortunately I don't have any examples on-hand, you'll have to look at the documentation in the code for UText and the available formats. When building you UText object, you can apply any of the formats found in the formats folder and give it a start and end position in the text string. That's how you can apply multiple colors.

@misterff1
Copy link
Contributor Author

Yeah I'll take a look at that then

@alecxvs
Copy link
Owner

alecxvs commented Jun 2, 2015

After looking at it, Chat:Send should definitely be able to use color tags. The slightly broken utcIntegration code might be to blame for that. I'm working on getting that fixed, but you should still try to use programmatic UText objects when you're writing code specifically for UTChat.

@alecxvs
Copy link
Owner

alecxvs commented Jun 2, 2015

Apparently it wasn't just a utcIntegration problem, there was a console warning associated with this as well. Anyways, here's proof that this issue is definitely fixed:

@alecxvs alecxvs closed this as completed in 8143495 Jun 2, 2015
@alecxvs alecxvs modified the milestones: 1.0.4-alpha, 1.0.5-alpha Jun 2, 2015
@misterff1
Copy link
Contributor Author

Awesome. I'll get back to using your integrator then instead of the autorun file I had in use.

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

No branches or pull requests

2 participants