Skip to content
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

More dialogs to exit with READY hotkey #4443

Merged
merged 2 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
More dialogs to exit with READY hotkey
Hero, Castle and Kingdom dialogs have only one button: `EXIT`.  Especially
when playing with one hand holding the mouse (to the right of the keyboard) it
is more convenient to exit these screens by hitting the num-pad `ENTER`.

Otherwise one has to either use the mouse to click on the button or use one's
left hand to hit `ESC`.
  • Loading branch information
a1exsh committed Oct 17, 2021
commit 2ae11e8dd3cb11a49ccfb05e799d47e260651bc2
2 changes: 1 addition & 1 deletion src/fheroes2/castle/castle_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ int Castle::OpenDialog( bool readonly )
le.MousePressLeft( buttonExit.area() ) ? buttonExit.drawOnPress() : buttonExit.drawOnRelease();

// Check buttons for closing this castle's window.
if ( le.MouseClickLeft( buttonExit.area() ) || Game::HotKeyPressEvent( Game::EVENT_DEFAULT_EXIT ) ) {
if ( le.MouseClickLeft( buttonExit.area() ) || HotKeyCloseWindow ) {
result = Dialog::CANCEL;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/heroes/heroes_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ int Heroes::OpenDialog( bool readonly /* = false */, bool fade /* = false */, bo
}

// exit
if ( le.MouseClickLeft( buttonExit.area() ) || Game::HotKeyPressEvent( Game::EVENT_DEFAULT_EXIT ) )
if ( le.MouseClickLeft( buttonExit.area() ) || HotKeyCloseWindow )
return Dialog::CANCEL;

// heroes troops
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/kingdom/kingdom_overview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ void Kingdom::openOverviewDialog()
}

// Exit this dialog.
if ( le.MouseClickLeft( buttonExit.area() ) || Game::HotKeyPressEvent( Game::EVENT_DEFAULT_EXIT ) )
if ( le.MouseClickLeft( buttonExit.area() ) || HotKeyCloseWindow )
break;

// switch view: heroes/castle
Expand Down