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
Codechange: Rearrange (code) of AI/GS debug window. #11483
Conversation
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 padding around the company and script buttons looks strange to me -- it's all very busy and crammed up against the bar below containing the script name, the settings button, and the reload button. I wonder if increasing (or maybe eliminating) said padding would help with the visual confusion.
I know that's out of scope, but since you're there anyway... (Feel free to say "another PR" or "do it yourself" 😛)
I did adjust it from uneven padding where it overlaps or touches borders, so the style used on the Detailed Performance Rating window. The only other place with this style of list is the Cargo Flow Legend window, which still has touching borders (because I've not touched it yet) so... dunno. Maybe the button row below could go above the company buttons, or at the bottom with the other buttons. Hmm. |
Main issue in this window is the number of "tabs" Maybe the 2 rows of 8 companies (with the empty space because there are only 15) could be replaced with 3 rows of 5. Another option to keep the tab style is to put tabs in a single column on the left. It's very hard for this window to look "nice". |
cd14648
to
1e9e41b
Compare
…te/draw pattern. The AI/GS window updated its state as it was drawn, and would redraw again if some state had changed. Instead, update state either during OnInvalidateData or before any drawing commences.
1e9e41b
to
c00a2d9
Compare
All layout changes have been undone, as it seems people would rather have a full redesign than a minor tweak. |
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.
Sorry, I wasn't trying to argue that your layout change wasn't an improvement. 😦
This might need a new commit title when merging, because it's now a codechange rather than a change. Maybe Codechange: Refactor AI/GS debug window
.
Motivation / Problem
The AI/GS debug window updated its state as it was drawn, and would redraw again if some state had changed.
Many widgets were drawn in OnPaint() instead of DrawWidget(), and the company icon was drawn incorrect based on unscaled hardcoded pixel dimensions.
Description
Instead, update state either during OnInvalidateData or before any drawing commences, and draw everything through DrawWidget() handler, via smaller class methods to break it up.
Additionally the "Game Script" button is moved next to the Company/AI selector which makes it more obvious that it is part of the same exclusive toggle.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.