]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/mainwindow.qc
Add "Quit campaign" / "Quit current game" button to the Quit dialogue, bind f11 to...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / mainwindow.qc
index 89a61fb0d89d2fff669177c4245b5c738d0aad4c..22853c9baa1664610fc5ac3092a0d9eb534e80aa 100644 (file)
 #include "dialog_credits.qh"
 #include "dialog_quit.qh"
 
-#include "dialog_disconnect.qh"
-
-
-
 void MainWindow_draw(entity me)
 {
        SUPER(MainWindow).draw(me);
@@ -63,33 +59,6 @@ void MainWindow_draw(entity me)
                DialogOpenButton_Click_withCoords(NULL, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
                me.dialogToShow = NULL;
        }
-
-       //-------------------------------------
-       // Part of Disconnect Dialog button:
-       // In case of this function is recalling every time, need to use condition of visibility 
-       
-       if (me.disconnectDialogVisibility && !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED))) 
-       {
-               // If gamestate is not "ingame" (and it is a first "frame" of drawing (or dialog is visible)), 
-               // disconnect button is unnecessary, remove it
-               me.removeItem(me.mainNexposee, me.disconnectDialog);
-               me.disconnectDialogVisibility = 0;
-
-       } else if(!me.disconnectDialogVisibility && (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))) {
-               
-               // If gamestate is "ingame" (and dialog is not visible), 
-               // make disconnect button visible
-               entity n, i;
-               n = me.mainNexposee;
-               i = me.disconnectDialog;
-               n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-               n.setNexposee(n, i, '0.5 1.2 0.0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
-               me.disconnectDialogVisibility = 1;
-       }
-
-       // I haven't found the best solution for making button visible. 
-       // Alpha channel is the worst thing, because dialog with alpha is also clickable
-       //-------------------------------------
 }
 
 void DemoButton_Click(entity me, entity other)
@@ -281,7 +250,7 @@ void MainWindow_configureMainWindow(entity me)
 
        // main dialogs/windows
        me.mainNexposee = n = NEW(XonoticNexposee);
-       
+
        /*
                if(checkextension("DP_GECKO_SUPPORT"))
                {
@@ -291,7 +260,7 @@ void MainWindow_configureMainWindow(entity me)
                        n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
                }
        */
-       
+
                i = NEW(XonoticSingleplayerDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
@@ -313,14 +282,6 @@ void MainWindow_configureMainWindow(entity me)
                n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
                n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
 
-               //Disconnect dialog at center of screen (between credits and quit)
-               i = NEW(XonoticDisconnectDialog);
-               i.configureDialog(i);
-               n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-               n.setNexposee(n, i, '0.5 1.2 0.0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
-               n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
-               me.disconnectDialog = i;
-       
                i = NEW(XonoticQuitDialog);
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
@@ -331,7 +292,6 @@ void MainWindow_configureMainWindow(entity me)
        me.moveItemAfter(me, n, NULL);
 
        me.initializeDialog(me, n);
-       me.disconnectDialogVisibility = 1;
 
        if(cvar_string("_cl_name") == cvar_defstring("_cl_name"))
                me.dialogToShow = me.firstRunDialog;