]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix non-closable dialogs being closable when connected
authorterencehill <piuntn@gmail.com>
Sat, 2 Jul 2016 13:42:42 +0000 (15:42 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 2 Jul 2016 13:42:42 +0000 (15:42 +0200)
qcsrc/menu/item/dialog.qc
qcsrc/menu/item/inputcontainer.qc
qcsrc/menu/menu.qc

index c4a78fa568802c305e763aedca9e96eb59bfb595..f0aebabc2ee42196281e5ed7db578f0a390d33c8 100644 (file)
                                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;
        }
index 3840721e35f9a032ab3f008471bb53e22a806802..37c46240f77fdcd8bf704b1b6d999aaa3de5e254 100644 (file)
@@ -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;
index 96d98b9c502149cfe54d18461cbc08ec9ff0c1e6..9b617ab8a16eaa421a050b3732bb7890801af3b6 100644 (file)
@@ -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