-
-
Notifications
You must be signed in to change notification settings - Fork 639
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
rework of the color code with & and standard codes #5416
Conversation
I think I'm ready for review, I tried to replace every bit that uses style in the code with this new guideline there is only one part I'm not sure... Lines 1563 to 1568 in 3c75377
I'm not sure if ranks color are implemented and so how should I change that... I haven't seens any way of setting the color of a rank.... |
ce530e3
to
ed8e983
Compare
90fa86a
to
28c45c4
Compare
Is there any update on the review ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Server/Plugins/APIDump/APIDesc.lua
also needs to be updated - there's a cCompositeChat
description there. What about plugin compatibility, did you test any plugins actually using chat colors?
Also, what about cChatColor
, do we want to keep it? Is it up to date?
style changes
I did my best, english is a foreign language for me so I might not be clear in my way of explaining it... sorry :)
I didn't, I honestly didn't even tried plugin once since I'm in the cuberite project... So I don't really know which would break except for Core for whom I submitted a patch
I didn't even knew it was a thing, by the look of things this is used by Cuberite/Core... I think it's not a bad thing that both exist as this make an altenative way of coding plugins. either typing the color or going for the standardized minecraft color code |
I think we should check the plugins released with the cuberite github profile (check the Lua-Repos that are not archived) |
Just bumping @tonitch to check if the other plugins were checked. |
Sorry I didn't had much time, and will not have for the next two weeks... I will do that as soon as I can! |
I'm back! Here is a list of what I checked and what I did! checked
|
All seems good to me ^^ |
i'm sorry if i'm rude but will this be pulled someday ? ^^ |
I'm handing in my bachelor thesis on Wednesday. Then your time has come |
Super! I can wait more, I was just a bit in the dark here ^^ |
So in total, the changes look great. I have some minor comments. |
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't review this PR right now, but I can merge some of the plugin PRs once this PR is merged. A few questions:
|
Nothing will break (in the sense of the application crashing). Using the old color Codes will just result in a weird & character in messages. Since we provide a proper API to methods in cCompositeChat this might have been dodged. Since I am writing this on mobile, so I can't check if those methods will stop working (no formatting) because some indicators were changed Edit: since the codes for the bold, strike, italic,... are changed to other Charakters, this might break. @tonitch did you check this? |
All plugins using the API are fine ... The only thing that would break is if plugin writer have implemented color code in the form of "@x"... These character will just be untouched and might be weird but as asked, I checked every plugin in the cuberite's GitHub and I found really little amount of dev using @ char in their code... They almost all use api and so are fine |
I meant if a plugin uses 'AddChatPartStyle' but uses the old keys. Then there would be no formatting without a warning. |
Maybe we should add a switch/case case that triggers on the old formatting codes informing the admin that the cold is outdated |
If I remember correctly, I though about that but I'm pretty sure there is conflict... Maybe I can do that only for those that are no more. Should i do anything else for the conflict ? |
I don't think so. The new character should be noticed fast :D |
I'll do warnings then, but there should be a way of handling deprecation in cuberite... Like when a function is deprecated after x commit/version/month, this warning can be left out. I think this would avoid long portion of code that would literally do nothing 🙂 |
Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
Yeah the deprecation handling is quite inconsistent and since we don't do releases, no dates are set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last one. Then I'll approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting a day for any vetos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine generally, I will not veto. I'm not totally confident with your refactor to the chat parsing logic, you seem to have made more changes than strictly necessary here and it's some complicated spaghettti with intrinsically unsafe data structures.
In an ideal world that whole mess would be refactored with modern C++ and use some safe primitives. But that's a bigger job, this is fine to get finally merged in.
This is a draft for the rework of the chat, as explain in #5287 (no response so I assume this should be fine)
I want to make it as close as common server as possible so I want to follow this image and so using the
&
symbol