Skip to content

Commit 5433e9b

Browse files
committedApr 18, 2017
Don't make TAB exit game if bound to inventory.
I play with the TAB key bound to the inventory. However, the code here assumes that TAB means "close formspec" in all contexts, including the main menu. This causes my game to exit when I attempt to TAB in between USERNAME and PASSWORD fields. We know when m_client != NULL that the game is a client game and not in the main menu, and then it's OK to use the INVENTORY bound key to exit the formspec, since it's not the main menu.
1 parent 6120251 commit 5433e9b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎src/guiFormSpecMenu.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3296,8 +3296,9 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
32963296
{
32973297
if (event.EventType==EET_KEY_INPUT_EVENT) {
32983298
KeyPress kp(event.KeyInput);
3299-
if (event.KeyInput.PressedDown && ( (kp == EscapeKey) ||
3300-
(kp == getKeySetting("keymap_inventory")) || (kp == CancelKey))) {
3299+
if (event.KeyInput.PressedDown && (
3300+
(kp == EscapeKey) || (kp == CancelKey) ||
3301+
((m_client != NULL) && (kp == getKeySetting("keymap_inventory"))))) {
33013302
tryClose();
33023303
return true;
33033304
} else if (m_client != NULL && event.KeyInput.PressedDown &&

0 commit comments

Comments
 (0)
Please sign in to comment.