From 5bc5e1ce321e4810a042950eb31cbc01ca22f373 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 2 Jul 2016 15:42:42 +0200 Subject: [PATCH] Fix non-closable dialogs being closable when connected --- qcsrc/menu/item/dialog.qc | 5 ++++- qcsrc/menu/item/inputcontainer.qc | 3 ++- qcsrc/menu/menu.qc | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/item/dialog.qc b/qcsrc/menu/item/dialog.qc index c4a78fa56..f0aebabc2 100644 --- a/qcsrc/menu/item/dialog.qc +++ b/qcsrc/menu/item/dialog.qc @@ -118,5 +118,8 @@ return 1; } } - return SUPER(Dialog).keyDown(me, key, ascii, shift); + float r = SUPER(Dialog).keyDown(me, key, ascii, shift); + if (!me.closable && key == K_ESCAPE) + return 1; + return r; } diff --git a/qcsrc/menu/item/inputcontainer.qc b/qcsrc/menu/item/inputcontainer.qc index 3840721e3..37c46240f 100644 --- a/qcsrc/menu/item/inputcontainer.qc +++ b/qcsrc/menu/item/inputcontainer.qc @@ -20,7 +20,8 @@ float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { entity f, ff; - if (SUPER(InputContainer).keyDown(me, scan, ascii, shift)) return 1; + if (SUPER(InputContainer).keyDown(me, scan, ascii, shift)) + return 1; if (scan == K_ESCAPE) { f = me.focusedChild; diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 96d98b9c5..9b617ab8a 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -270,7 +270,8 @@ void m_keydown(float key, float ascii) else { draw_reset_cropped(); - if (!mouseButtonsPressed && key >= K_MOUSE1 && key <= K_MOUSE3) main.mousePress(main, menuMousePos); + if (!mouseButtonsPressed && key >= K_MOUSE1 && key <= K_MOUSE3) + main.mousePress(main, menuMousePos); if (!main.keyDown(main, key, ascii, menuShiftState)) { // disable menu on unhandled ESC -- 2.39.2