-
Notifications
You must be signed in to change notification settings - Fork 444
Strip Minecraft Color Codes (§) in BasicIO mode #995
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
Conversation
Strip minecraft color codes and formatting (§) if in BasicIO mode. Makes logs much more readable
ORelio
left a comment
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.
Thanks for this pull request. For compatibility with GUI and other scripts, I'd prefer this setting to be a command-line option to make sure color codes are enabled when intended by the program interfaced with MCC.
MinecraftClient/ConsoleIO.cs
Outdated
| foreach (char c in colorcodes) | ||
| { | ||
| str = str.Replace("§"+c, string.Empty); | ||
| } |
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.
Instead of rewriting this, you can use the existing method GetVerbatim from the ChatBot class here after switching it to Public visibility.
MinecraftClient/Settings.cs
Outdated
| + "scriptcache=true # Cache compiled scripts for faster load on low-end devices\r\n" | ||
| + "timestamps=false # Prepend timestamps to chat messages\r\n" | ||
| + "autorespawn=false # Toggle auto respawn if client player was dead (make sure your spawn point is safe)\r\n" | ||
| + "consoleiocolors=true # Strips the color codes from output when in BasicIO mode\r\n" |
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.
Using a setting may pose an issue with programs and scripts calling MCC and expecting color codes to be present. I'd suggest to use a command-line argument (e.g. BasicIO-NoColors) instead and set the setting directly inside the ConsoleIO class 🙂
|
I believe this is all the changes that would be required, BasicIO-NoColor is now a command line option, that will enable BasicIO mode aswell, but remove color code using the GetVerbatim method. Also I added dotfiles to gitignore. It was annoying needing to deselect dotfiles every time I commit 😄 Also this is my first PR so I don't really know what I am doing or if I am doing it right. Am I supposed to re-request review now? |
|
I don't mind ignoring hidden files, seems OK for me. Once you push new commits to your repository, I get notified and can review them again. Of course, you can also manually request a review to explicitly tell me that your PR is now good to be reviewed again 😉 |
Strip Minecraft Color Codes (§) in BasicIO-NoColor mode (MCCTeam#995)
Adds a configuration setting in MinecraftClient.ini to strip all color codes and formatting from output when in BasicIO mode. Makes chat logs much more readable.
I use Docker to run Mono, so I need to use BasicIO mode to be able to run, stripping color and formatting codes makes it easier to interact with players.