]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Hide the menu when closing the Quit dialog while connected 376/head
authorterencehill <piuntn@gmail.com>
Fri, 14 Oct 2016 18:17:42 +0000 (20:17 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 14 Oct 2016 18:17:42 +0000 (20:17 +0200)
qcsrc/menu/item/dialog.qc
qcsrc/menu/item/dialog.qh
qcsrc/menu/menu.qc

index f0aebabc2ee42196281e5ed7db578f0a390d33c8..9e0ea95ebad6dc9555357c310f01a0c9ac9ad793 100644 (file)
 
        void Dialog_close(entity me)
        {
-               if (me.parent.instanceOfNexposee) ExposeeCloseButton_Click(me, me.parent);
-               else if (me.parent.instanceOfModalController) DialogCloseButton_Click(me, me);
+               if (me.parent.instanceOfNexposee)
+               {
+                       ExposeeCloseButton_Click(me, me.parent);
+                       if(me.hideMenuOnClose)
+                       {
+                               me.hideMenuOnClose = false;
+                               m_hide();
+                       }
+               }
+               else if (me.parent.instanceOfModalController)
+                       DialogCloseButton_Click(me, me);
        }
 
        float Dialog_keyDown(entity me, float key, float ascii, float shift)
index 6099fea22d77f28de06cad990d54b597717f45e3..6fa9b26ab38038fe9c271b495c8ff4cbd9a4052e 100644 (file)
@@ -66,6 +66,8 @@ CLASS(Dialog, InputContainer)
        ATTRIB(Dialog, borderLines, float, 1);
        ATTRIB(Dialog, closeButtonImage, string);
 
+       ATTRIB(Dialog, hideMenuOnClose, bool, false);
+
        ATTRIB(Dialog, frame, entity);
 ENDCLASS(Dialog)
 
index aaa33b137b8ecdcd14fc61d86ec85c7a30c0253b..f0e6646ca93d7115063ea9d36018565271229ad3 100644 (file)
@@ -977,6 +977,8 @@ void m_goto(string itemname)
 
                if ((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))))
                {
+                       if(!Menu_Active)
+                               e.hideMenuOnClose = true;
                        m_hide();
                        m_activate_window(e);
                        m_setpointerfocus(e);