-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix PgUp/PgDown not changing structure palette #1445
Fix PgUp/PgDown not changing structure palette #1445
Conversation
Oh interesting, and unexpected. I edited the lead comment to link to the issue. Using the lead message with |
Refactor (+1 squashed commits) Squashed commits: [972b4f76] Remove second default parameter in favor of calculating new depth in button press event handler.
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 good. One minor spacing inconsistency I noticed.
I'll push the branch to the repo so the tests run.
Aha, I've discovered how to fetch the changes without having to first add a new remote for the fork. Seems there are some GitHub refs that can be used, which don't normally appear in branch lists. For example:
That's quite a bit more convenient than adding a new remote. Anyway, tests are running. The Windows build can take somewhere from 5-15 minutes. I won't be sticking around though. Maybe the whitespace thing will be fixed before I revisit. |
When testing this locally I noticed one oddity, which I haven't really looked into yet. The hotkeys all work with these changes, but the mouse buttons no longer switch the construction menu. Checking against It's curious because there were no obvious changes to the mouse button handling code. Maybe there were extra calls to handle the level change side effects which are no longer getting called due to the z-level change detection? I know a few places in the game checked certain conditions every frame drawn, not simply when a state change was made. |
In const auto oldDepth = mMapView->currentDepth();
mNavControl->onClick(MOUSE_COORDS);
if (oldDepth != mMapView->currentDepth())
{
changeViewDepth(mMapView->currentDepth());
} |
…secondary effects. Fix whitespace typo.
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.
Excellent. I just ran a manual test and this fixes the mouse button issue I mentioned earlier.
The number keys called a local function that handled changing the structure picker. This change adds a 2nd parameter (defaulting to null) to that local function, allowing the event handlers for PageUp/Down to call the same function, rather than call directly to the mMapView object. If the 2nd parameter have a value, then the 1st parameter is ignored and the 2nd is used to change the mMapView z level.
Edit:
Closes #1364