]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/mainwindow.c
Merge branch 'master' into Mario/quickmenu_merge
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / mainwindow.c
index 5a4168f5421caf203bfac9b1fac3fb47af2b32f6..0be883d0e1a1b12e8552edc3f72a5020f876cda3 100644 (file)
 #ifdef INTERFACE
 CLASS(MainWindow) EXTENDS(ModalController)
        METHOD(MainWindow, configureMainWindow, void(entity))
+       METHOD(MainWindow, draw, void(entity))
+       ATTRIB(MainWindow, firstRunDialog, entity, NULL)
        ATTRIB(MainWindow, advancedDialog, entity, NULL)
        ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
        ATTRIB(MainWindow, weaponsDialog, entity, NULL)
        ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
        ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
        ATTRIB(MainWindow, winnerDialog, entity, NULL)
-       ATTRIB(MainWindow, waypointDialog, entity, NULL)
        ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
        ATTRIB(MainWindow, cvarsDialog, entity, NULL)
+       ATTRIB(MainWindow, viewDialog, entity, NULL)
+       ATTRIB(MainWindow, modelDialog, entity, NULL)
+       ATTRIB(MainWindow, crosshairDialog, entity, NULL)
+       ATTRIB(MainWindow, hudDialog, entity, NULL)
+       ATTRIB(MainWindow, hudconfirmDialog, entity, NULL)
        ATTRIB(MainWindow, mainNexposee, entity, NULL)
        ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
+       ATTRIB(MainWindow, dialogToShow, entity, NULL)
 ENDCLASS(MainWindow)
 #endif
 
 #ifdef IMPLEMENTATION
+void MainWindow_draw(entity me)
+{
+       SUPER(MainWindow).draw(me);
+
+       if(me.dialogToShow)
+       {
+               DialogOpenButton_Click_withCoords(world, me.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
+               me.dialogToShow = NULL;
+       }
+}
 
 void DemoButton_Click(entity me, entity other)
 {
-       if(me.text == "Do not press this button again!")
+       if(me.text == _("Do not press this button again!"))
                DialogOpenButton_Click(me, other);
        else
-               me.setText(me, "Do not press this button again!");
+               me.setText(me, _("Do not press this button again!"));
 }
 
-void configureMainWindowMainWindow(entity me)
+void MainWindow_configureMainWindow(entity me)
 {
        entity n, i;
 
-       i = spawnXonoticTeamSelectDialog();
+       // dialog run upon startup
+       me.firstRunDialog = i = spawnXonoticFirstRunDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-       
+
+
+       // hud_configure dialogs
        i = spawnXonoticHUDExitDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.advancedDialog = i = spawnXonoticAdvancedDialog();
+       i = spawnXonoticHUDNotificationDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
+       i = spawnXonoticHUDAmmoDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
+       i = spawnXonoticHUDHealthArmorDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDChatDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDModIconsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDPowerupsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDPressedKeysDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDRaceTimerDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDRadarDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDScoreDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDTimerDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDVoteDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDWeaponsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDEngineInfoDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDInfoMessagesDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDPhysicsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDCenterprintDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       i = spawnXonoticHUDQuickMenuDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+
+       // dialogs used by settings
        me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+       me.cvarsDialog = i = spawnXonoticCvarsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+
+       // dialog used by singleplayer
        me.winnerDialog = i = spawnXonoticWinnerDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.weaponsDialog = i = spawnXonoticWeaponsDialog();
+
+       // dialog used by multiplayer/join
+       me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+
+       // dialogs used by multiplayer/create
+       me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
-       me.waypointDialog = i = spawnXonoticWaypointDialog();
+       me.advancedDialog = i = spawnXonoticAdvancedDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-       
-       me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
+
+       me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-       
-       me.cvarsDialog = i = spawnXonoticCvarsDialog();
+
+
+       // dialogs used by multiplayer/player setup
+       me.crosshairDialog = i = spawnXonoticCrosshairDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       me.hudDialog = i = spawnXonoticHUDDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-       
+
+       me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       me.modelDialog = i = spawnXonoticModelDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       me.viewDialog = i = spawnXonoticViewDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+       me.weaponsDialog = i = spawnXonoticWeaponsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+
+       // mutator dialogs
+       i = spawnXonoticSandboxToolsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
+
+
+       // miscellaneous dialogs
+       i = spawnXonoticTeamSelectDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+
+       // main dialogs/windows
        me.mainNexposee = n = spawnXonoticNexposee();
        /*
                if(checkextension("DP_GECKO_SUPPORT"))
@@ -87,7 +219,7 @@ void configureMainWindowMainWindow(entity me)
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
-               
+
                i = spawnXonoticMultiplayerDialog();
                i.configureDialog(i);
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
@@ -109,10 +241,14 @@ void configureMainWindowMainWindow(entity me)
                n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
                n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
                n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
+
        me.addItem(me, n, '0 0 0', '1 1 0', SKINALPHAS_MAINMENU_z);
        me.moveItemAfter(me, n, NULL);
 
        me.initializeDialog(me, n);
+
+       if(cvar_string("_cl_name") == "Player")
+               me.dialogToShow = me.firstRunDialog;
 }
 #endif