From: terencehill Date: Fri, 14 Oct 2016 18:17:42 +0000 (+0200) Subject: Hide the menu when closing the Quit dialog while connected X-Git-Tag: xonotic-v0.8.2~506^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F376%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Hide the menu when closing the Quit dialog while connected --- diff --git a/qcsrc/menu/item/dialog.qc b/qcsrc/menu/item/dialog.qc index f0aebabc2..9e0ea95eb 100644 --- a/qcsrc/menu/item/dialog.qc +++ b/qcsrc/menu/item/dialog.qc @@ -103,8 +103,17 @@ 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) diff --git a/qcsrc/menu/item/dialog.qh b/qcsrc/menu/item/dialog.qh index 6099fea22..6fa9b26ab 100644 --- a/qcsrc/menu/item/dialog.qh +++ b/qcsrc/menu/item/dialog.qh @@ -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) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index aaa33b137..f0e6646ca 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -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);