]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/mainwindow.c
Merge branch 'master' into terencehill/screenshot_viewer
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / mainwindow.c
index 55a5a078901b4e24dadc8d7a2937cb77ad716743..314d192bb9b39f8b69d96ffce17132099c3d3e52 100644 (file)
@@ -1,7 +1,8 @@
 #ifdef INTERFACE
 CLASS(MainWindow) EXTENDS(ModalController)
        METHOD(MainWindow, configureMainWindow, void(entity))
-       ATTRIB(MainWindow, screenshotViewerDialog, entity, NULL)
+       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)
@@ -11,25 +12,41 @@ CLASS(MainWindow) EXTENDS(ModalController)
        ATTRIB(MainWindow, waypointDialog, entity, NULL)
        ATTRIB(MainWindow, serverInfoDialog, entity, NULL)
        ATTRIB(MainWindow, cvarsDialog, entity, NULL)
+       ATTRIB(MainWindow, screenshotViewerDialog, 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 MainWindow_configureMainWindow(entity me)
 {
        entity n, i;
 
+       me.firstRunDialog = i = spawnXonoticFirstRunDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
        i = spawnXonoticTeamSelectDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
@@ -178,6 +195,9 @@ void MainWindow_configureMainWindow(entity me)
        me.moveItemAfter(me, n, NULL);
 
        me.initializeDialog(me, n);
+
+       if(cvar_string("_cl_name") == "Player")
+               me.dialogToShow = me.firstRunDialog;
 }
 #endif