From 4d0d5a158549f02cd0f38e11cf37cca259a444b3 Mon Sep 17 00:00:00 2001 From: Samual Date: Mon, 16 Jan 2012 23:26:13 -0500 Subject: [PATCH] Create hud settings dialog, and reorganize the setup in mainwindow.c with comments and such so it's easier to work with --- qcsrc/menu/classes.c | 3 +- qcsrc/menu/skin-customizables.inc | 1 + .../xonotic/dialog_multiplayer_playersetup.c | 16 +---- ...dialog_multiplayer_playersetup_crosshair.c | 2 +- .../dialog_multiplayer_playersetup_model.c | 2 +- .../dialog_multiplayer_playersetup_view.c | 2 +- qcsrc/menu/xonotic/mainwindow.c | 72 ++++++++++++------- 7 files changed, 56 insertions(+), 42 deletions(-) diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index 87769c806e..41532801d8 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -79,10 +79,11 @@ #include "xonotic/dialog_singleplayer_winner.c" #include "xonotic/dialog_credits.c" #include "xonotic/credits.c" +#include "xonotic/dialog_multiplayer_playersetup_crosshair.c" +#include "xonotic/dialog_multiplayer_playersetup_hud.c" #include "xonotic/dialog_multiplayer_playersetup_hudconfirm.c" #include "xonotic/dialog_multiplayer_playersetup_model.c" #include "xonotic/dialog_multiplayer_playersetup_view.c" -#include "xonotic/dialog_multiplayer_playersetup_crosshair.c" #include "xonotic/dialog_multiplayer_playersetup_weapons.c" #include "xonotic/weaponslist.c" #include "xonotic/dialog_multiplayer_demo.c" diff --git a/qcsrc/menu/skin-customizables.inc b/qcsrc/menu/skin-customizables.inc index d9f32efd50..2c3ba80c57 100644 --- a/qcsrc/menu/skin-customizables.inc +++ b/qcsrc/menu/skin-customizables.inc @@ -67,6 +67,7 @@ SKINBEGIN SKINVECTOR(COLOR_DIALOG_VIEW, '1 0.7 0.7'); SKINVECTOR(COLOR_DIALOG_MODEL, '1 0.7 0.7'); SKINVECTOR(COLOR_DIALOG_CROSSHAIR, '1 0.7 0.7'); + SKINVECTOR(COLOR_DIALOG_HUD, '1 0.7 0.7'); SKINVECTOR(COLOR_DIALOG_SERVERINFO, '0.7 0.7 1'); SKINVECTOR(COLOR_DIALOG_CVARS, '1 0 0'); SKINVECTOR(COLOR_DIALOG_HUDCONFIRM, '1 0 0'); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c index 85060dca9a..daf20fc140 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c @@ -10,21 +10,9 @@ CLASS(XonoticPlayerSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticPlayerSettingsTab, playerNameLabelAlpha, float, 0) ENDCLASS(XonoticPlayerSettingsTab) entity makeXonoticPlayerSettingsTab(); -void HUDSetup_Start(entity me, entity btn); #endif #ifdef IMPLEMENTATION -void HUDSetup_Check_Gamestatus(entity me, entity btn) -{ - if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, ask the player if they want to start one anyway - { - DialogOpenButton_Click(me, main.hudconfirmDialog); - } - else // already in a match, lets just cut to the point and open up the hud editor directly - { - HUDSetup_Start(me, btn); - } -} entity makeXonoticPlayerSettingsTab() { entity me; @@ -179,8 +167,8 @@ void XonoticPlayerSettingsTab_fill(entity me) me.TR(me); me.TDempty(me, 0.5); me.TD(me, 1, 2, e = makeXonoticButton(_("HUD settings"), '0 0 0')); - e.onClick = HUDSetup_Check_Gamestatus; - e.onClickEntity = me; + e.onClick = DialogOpenButton_Click; + e.onClickEntity = main.hudDialog; // TODO: show hud config name with text here me.gotoRC(me, me.rows - 1, 0); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c index 0b10ff171f..7ca7d9622f 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_crosshair.c @@ -18,7 +18,7 @@ void XonoticCrosshairDialog_showNotify(entity me) } string XonoticCrosshairDialog_toString(entity me) { - return "hi"; //me.weaponsList.toString(me.weaponsList); + return "hi"; // TODO: show status of crosshair dot and hittest and pickups and such here with text } void XonoticCrosshairDialog_fill(entity me) { diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c index a31d147945..71c7134544 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_model.c @@ -18,7 +18,7 @@ void XonoticModelDialog_showNotify(entity me) } string XonoticModelDialog_toString(entity me) { - return "hi"; //me.weaponsList.toString(me.weaponsList); + return "hi"; // TODO: show csqc model settings like forcemyplayer and deglowing/ghosting bodies with text here } void XonoticModelDialog_fill(entity me) { diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c index 935aa74847..a5a49368e1 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_view.c @@ -18,7 +18,7 @@ void XonoticViewDialog_showNotify(entity me) } string XonoticViewDialog_toString(entity me) { - return "hi"; //me.weaponsList.toString(me.weaponsList); + return "hi"; // TODO: show fov and other settings with text here } void XonoticViewDialog_fill(entity me) { diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index 291e02338b..2adb9343e4 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -14,6 +14,7 @@ CLASS(MainWindow) EXTENDS(ModalController) 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) @@ -45,18 +46,13 @@ void MainWindow_configureMainWindow(entity me) { entity n, i; + // dialog run upon startup 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); - - i = spawnXonoticSandboxToolsDialog(); - 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); @@ -128,55 +124,83 @@ void MainWindow_configureMainWindow(entity me) i = spawnXonoticHUDCenterprintDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog(); + + + // 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.advancedDialog = i = spawnXonoticAdvancedDialog(); + + me.cvarsDialog = i = spawnXonoticCvarsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - me.mutatorsDialog = i = spawnXonoticMutatorsDialog(); + + + // dialog used by singleplayer + me.winnerDialog = i = spawnXonoticWinnerDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - + + + // 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.userbindEditDialog = i = spawnXonoticUserbindEditDialog(); + + me.advancedDialog = i = spawnXonoticAdvancedDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - me.winnerDialog = i = spawnXonoticWinnerDialog(); + me.mutatorsDialog = i = spawnXonoticMutatorsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + - me.weaponsDialog = i = spawnXonoticWeaponsDialog(); + // 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.serverInfoDialog = i = spawnXonoticServerInfoDialog(); + 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.cvarsDialog = i = spawnXonoticCvarsDialog(); + 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.modelDialog = i = spawnXonoticModelDialog(); + me.weaponsDialog = i = spawnXonoticWeaponsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + - me.crosshairDialog = i = spawnXonoticCrosshairDialog(); + // mutator dialogs + i = spawnXonoticSandboxToolsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + + // 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")) -- 2.39.2