-
Notifications
You must be signed in to change notification settings - Fork 69
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
Added drawing style configuration #2816
Added drawing style configuration #2816
Conversation
[Automated message from GitHub Pull Request Builder] Answer "ok to test" to trigger testing of this PR. |
4c1d15c
to
5650d7e
Compare
return; | ||
} | ||
ConfigNode history_parameters = draw_styles.GetAtMostOneNode("history"); | ||
if (history_parameters != null) { |
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.
Remove these if statements, use history_parameters?.GetDrawMeow
instead (technically this might mean twice the null checks but I’d rather reduce boilerplate than optimize null checks in something that runs in OnAwake
.
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.
Wait no, ?.
worked with the out parameters, but not now that we return values.
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.
Upon reflection, I think I preferred the single function that loaded the entire style node.
Please merge
UnityEngine.Color GetDrawColour(this ConfigNode node)
and
GLLines.Style GetDrawStyle(this ConfigNode node)
into
void GetDrawStyle(this ConfigNode node, out UnityEngine.Color colour, out GLLines.Style style)
at which point the callsites can become
history_parameters?.GetDrawStyle(out history_colour, out history_style)
etc.
I can haz some documentation in the Wiki (there is a section about configuration files)? We cannot expect users to read the code to figure out how to play with the colours. |
Adds user configurable drawing styles for trajectories via an MM patch.
I think this addresses #869.