Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve Console Output Flexibility
Description
After speaking with @LexiconCode about some upcoming changes, I suggested that he could avoid adding lots of UI code to _caster.py by making printer.py a bit more flexible. This PR is the implementation of that suggestion.
I put the above chunk of code in settings.py, but it could be moved to anywhere (anywhere that it's called only once) and it would work the same. (You don't have to worry about
printer.out
being called first, or import order or anything.) Switching output to the HUD would be as simple as replacingSimplePrintMessageHandler
with some other implementation ofBaseMessageHandler
which does HUD stuff. Absolutely do not put said implementation in printer.py.If the HUD
BaseMessageHandler
implementation is broken or throws errors when handlingprinter.out
messages, those messages will be printed to the console by a defaultSimplePrintMessageHandler
instead.Incidentally, you can throw as many
printer.out
handlers at this thing as you want. It can use more than one.Related Issue
Hud PR #773
Motivation and Context
See description.
How Has This Been Tested
Additional unit tests + manual testing to make sure nothing was broken.
Types of changes
Checklist
Maintainer/Reviewer Checklist