X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fmainwindow.c;h=feec5a9b92595baa6cbbdc808ae926a3ea3a2793;hb=fc3e13dd48a3e16c4173617475adc240ace548fe;hp=f1cbfffc7555f42d1eedacc0b500811cc5d3b926;hpb=902b6412e307e9208c0bf70dc4f8f20697180b8c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index f1cbfffc7..feec5a9b9 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -1,6 +1,8 @@ #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) @@ -12,23 +14,38 @@ CLASS(MainWindow) EXTENDS(ModalController) ATTRIB(MainWindow, cvarsDialog, 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); @@ -41,7 +58,7 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - i = spawnXonoticHUDInventoryDialog(); + i = spawnXonoticHUDAmmoDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); @@ -85,7 +102,19 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - i = spawnXonoticHUDWeaponIconsDialog(); + 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); @@ -165,6 +194,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