-
-
Notifications
You must be signed in to change notification settings - Fork 843
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
Feature: Add alternative setting for right-click close window option to exclude pinned windows #10204
Feature: Add alternative setting for right-click close window option to exclude pinned windows #10204
Conversation
Player #623071 review: For my way of navigating the game interface, this would be a redundant option, although I do occasionally close a window I wanted to keep open. As the new behavior would be an added option, not a replacement, I have nothing against. Ok, just one thing: the red/green button is more visible, but I'm not convinced that's very important. However, I would have two suggestions.
|
I don't really have any authority to change default behavior, I'm just adding another option to help with accessibility. I could add a modifier key to close the window, but I feel like at that point it's just as easy to unpin the window and close it. Adding a modifier key also increases the complexity of documenting this, would I hardcore the modifier, or would I use an existing keybind? I'd like to receive some more input before trying to learn how user keyboard and keybind input works. But thank you for the feedback! |
I have addressed the changes requested. I moved the enum out of it's own file, and below the other few setting enum types in settings_type.h. I appended |
I've changed the enum type. Is the setting type warning something that needs fixed/mitigated? |
I think so, yes. Most players don't know that the warning is harmless, and being greeted by a warning immediately upon opening a newly-updated game release is bound to result in bug reports, complaints, and a bad taste in the mouth of some players. How to actually fix that, I don't know. 🤷 |
I am looking into changing the setting type to How do I fix the last commit name? The coding style guide doesn't mention a commit name for catching up to master. |
Merge commits shouldn't be included. You'll need to rebase and force push. |
@MasonGulu: Still interested in working on this? I would suggest asking in the |
I am still interested, thank you for the recommendation! |
8de5ee1
to
aeac616
Compare
I have resolved the warning on first launch issue by renaming the option to |
Try an interactive rebase ( |
f196e6e
to
f7718cf
Compare
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 to me. Thanks for the contribution!
(Since you haven't done this before: from here it waits for another developer to look it over and either request changes, or agree that it's suitable for inclusion in OpenTTD and hit the Merge button 🙂.)
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 think @2TallTyler jumped the gun here. A few more things to pick up here :)
f7718cf
to
c61afe7
Compare
c61afe7
to
d910b07
Compare
d910b07
to
cf66d0d
Compare
cf66d0d
to
1bbe29c
Compare
…to exclude pinned windows
1bbe29c
to
ee311b5
Compare
That should be all my references to "pinned" swapped out for "sticky", rebased on the latest master branch, and with the config loading code provided |
Tnx again for your work on this, and your patience while we figured out what we actually wanted :) |
Motivation / Problem
The right-click to close windows option is a great gameplay improvement, however it makes it very easy and common to close windows you don't intend to.
Description
My solution to this issue is to change the right-click to close windows setting to be a dropdown rather than a simple toggle, with a third option to exclude pinned windows. When set to this third mode, simply pin a window and right-click will no longer close the window.
Limitations
Since I changed the type of the config option from a
bool
to auint8
the game will give you a warning upon launching if you last saved settings from a version that did not make this change. This window can be easily dismissed and as far as I can tell there are no negative effects from this.I've been looking into solutions for this, but modifying the setting loading code to smoothly change this format to the new type is not a satisfactory solution.
I'm also not very satisfied with my if condition in
window.cpp
, it's quite long, but I'm not sure of a better way to split it.Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.