From e2276f87f0d5a30f4187348509ec24582a1510ff Mon Sep 17 00:00:00 2001 From: Sahil Singhal Date: Sat, 12 Jun 2010 20:43:05 -0400 Subject: [PATCH] Dialog per panel a bit annoying. Default cvars almost done. TODO: Color sliders. Skinning system. Add misc cvars. --- qcsrc/menu/classes.c | 13 +++- qcsrc/menu/gamecommand.qc | 7 +-- qcsrc/menu/xonotic/dialog_hudpanel_chat.c | 30 ++++++++++ .../xonotic/dialog_hudpanel_healtharmor.c | 32 ++++++++++ .../menu/xonotic/dialog_hudpanel_inventory.c | 32 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_modicons.c | 30 ++++++++++ .../xonotic/dialog_hudpanel_notification.c | 32 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_options.c | 60 ------------------- qcsrc/menu/xonotic/dialog_hudpanel_powerups.c | 34 +++++++++++ .../xonotic/dialog_hudpanel_pressedkeys.c | 30 ++++++++++ .../menu/xonotic/dialog_hudpanel_racetimer.c | 30 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_radar.c | 30 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_score.c | 30 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_timer.c | 30 ++++++++++ qcsrc/menu/xonotic/dialog_hudpanel_vote.c | 30 ++++++++++ .../xonotic/dialog_hudpanel_weaponicons.c | 32 ++++++++++ qcsrc/menu/xonotic/mainwindow.c | 50 +++++++++++++++- 17 files changed, 464 insertions(+), 68 deletions(-) create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_chat.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_inventory.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_modicons.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_notification.c delete mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_options.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_powerups.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_radar.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_score.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_timer.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_vote.c create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index 913135706..93ae2501d 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -84,4 +84,15 @@ #include "xonotic/cvarlist.c" #include "xonotic/dialog_settings_misc_cvars.c" #include "xonotic/dialog_hudsetup_exit.c" -#include "xonotic/dialog_hudpanel_options.c" +#include "xonotic/dialog_hudpanel_notification.c" +#include "xonotic/dialog_hudpanel_inventory.c" +#include "xonotic/dialog_hudpanel_healtharmor.c" +#include "xonotic/dialog_hudpanel_powerups.c" +#include "xonotic/dialog_hudpanel_racetimer.c" +#include "xonotic/dialog_hudpanel_pressedkeys.c" +#include "xonotic/dialog_hudpanel_radar.c" +#include "xonotic/dialog_hudpanel_score.c" +#include "xonotic/dialog_hudpanel_timer.c" +#include "xonotic/dialog_hudpanel_vote.c" +#include "xonotic/dialog_hudpanel_modicons.c" +#include "xonotic/dialog_hudpanel_chat.c" diff --git a/qcsrc/menu/gamecommand.qc b/qcsrc/menu/gamecommand.qc index 971cfa243..4a89ab9ba 100644 --- a/qcsrc/menu/gamecommand.qc +++ b/qcsrc/menu/gamecommand.qc @@ -66,12 +66,7 @@ void GameCommand(string theCommand) { highlightedPanel = stof(argv(1)); // switch to a menu item - m_goto("HUDOptions"); - - // this is here to detect which id the HUDOptions dialog is, i could imagine you need a similar system for the per-panel dialogs... - entity panelvar; - panelvar = findstring(NULL, name, "HUDOptions"); - panelvar.change(panelvar); + m_goto(strcat("HUD", HUD_Panel_GetName(highlightedPanel))); return; } diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_chat.c b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c new file mode 100644 index 000000000..6a48fb645 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDChatDialog, fill, void(entity)) + ATTRIB(XonoticHUDChatDialog, title, string, "Chat Panel Setup") + ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDChatDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDChatDialog, rows, float, 15) + ATTRIB(XonoticHUDChatDialog, columns, float, 4) + ATTRIB(XonoticHUDChatDialog, name, string, "HUDchat") +ENDCLASS(XonoticHUDChatDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDChatDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_chat", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_chat_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_chat_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c new file mode 100644 index 000000000..18d31d262 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c @@ -0,0 +1,32 @@ +#ifdef INTERFACE +CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDHealthArmorDialog, fill, void(entity)) + ATTRIB(XonoticHUDHealthArmorDialog, title, string, "Health/Armor Panel Setup") + ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15) + ATTRIB(XonoticHUDHealthArmorDialog, columns, float, 4) + ATTRIB(XonoticHUDHealthArmorDialog, name, string, "HUDhealtharmor") +ENDCLASS(XonoticHUDHealthArmorDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDHealthArmorDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_healtharmor", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_healtharmor_bg_alpha")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_healtharmor_flip", "Flip")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c b/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c new file mode 100644 index 000000000..2234bfc15 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c @@ -0,0 +1,32 @@ +#ifdef INTERFACE +CLASS(XonoticHUDInventoryDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDInventoryDialog, fill, void(entity)) + ATTRIB(XonoticHUDInventoryDialog, title, string, "Inventory Panel Setup") + ATTRIB(XonoticHUDInventoryDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDInventoryDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDInventoryDialog, rows, float, 15) + ATTRIB(XonoticHUDInventoryDialog, columns, float, 4) + ATTRIB(XonoticHUDInventoryDialog, name, string, "HUDinventory") +ENDCLASS(XonoticHUDInventoryDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDInventoryDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_inventory", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_inventory_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_inventory_bg_alpha")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_inventory_onlycurrent", "Show Current Ammo Only")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c b/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c new file mode 100644 index 000000000..a03a325cb --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDModIconsDialog, fill, void(entity)) + ATTRIB(XonoticHUDModIconsDialog, title, string, "Mod Icons Panel Setup") + ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDModIconsDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDModIconsDialog, rows, float, 15) + ATTRIB(XonoticHUDModIconsDialog, columns, float, 4) + ATTRIB(XonoticHUDModIconsDialog, name, string, "HUDmodicons") +ENDCLASS(XonoticHUDModIconsDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDModIconsDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_modicons", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_modicons_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_modicons_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_notification.c b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c new file mode 100644 index 000000000..c18572f2e --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c @@ -0,0 +1,32 @@ +#ifdef INTERFACE +CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDNotificationDialog, fill, void(entity)) + ATTRIB(XonoticHUDNotificationDialog, title, string, "Notification Panel Setup") + ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDNotificationDialog, rows, float, 15) + ATTRIB(XonoticHUDNotificationDialog, columns, float, 4) + ATTRIB(XonoticHUDNotificationDialog, name, string, "HUDnotify") +ENDCLASS(XonoticHUDNotificationDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDNotificationDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_notify_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_notify_bg_alpha")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify_flip", "Flip")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_options.c b/qcsrc/menu/xonotic/dialog_hudpanel_options.c deleted file mode 100644 index 02dec282c..000000000 --- a/qcsrc/menu/xonotic/dialog_hudpanel_options.c +++ /dev/null @@ -1,60 +0,0 @@ -#ifdef INTERFACE -CLASS(XonoticHUDOptionsDialog) EXTENDS(XonoticRootDialog) - METHOD(XonoticHUDOptionsDialog, fill, void(entity)) - METHOD(XonoticHUDOptionsDialog, change, void(entity)) - ATTRIB(XonoticHUDOptionsDialog, title, string, "HUD Setup") - ATTRIB(XonoticHUDOptionsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) - ATTRIB(XonoticHUDOptionsDialog, intendedWidth, float, 0.4) - ATTRIB(XonoticHUDOptionsDialog, rows, float, 15) - ATTRIB(XonoticHUDOptionsDialog, columns, float, 4) - ATTRIB(XonoticHUDOptionsDialog, name, string, "HUDOptions") -ENDCLASS(XonoticHUDOptionsDialog) - -#endif - -#ifdef IMPLEMENTATION -void fillXonoticHUDOptionsDialog(entity me) -{ - entity e; - me.TR(me); -} - -/* nvm these, i guess they wont be used -void saveCvarsXonoticHUDOptionsDialog(entity me) -{ - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel)), ftos(me.currentEnabled)); - if(me.currentPanel == HUD_PANEL_WEAPONICONS) - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_number"), ftos(me.currentNumber)); - - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg"), ftos(me.currentBg)); - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_color"), me.currentBgColor); - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_color_team"), ftos(me.currentBgColorTeam)); - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_alpha"), ftos(me.currentBgAlpha)); - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_border"), ftos(me.currentBgBorder)); - cvar_set(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_padding"), ftos(me.currentBgPadding)); -} - -void loadCvarsXonoticHUDOptionsDialog(entity me) -{ - me.currentEnabled = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel))); - if(me.currentPanel == HUD_PANEL_WEAPONICONS) - me.currentNumber = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_number")); // only weaponicons panel - - me.currentBg = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg")); - me.currentBgColor = cvar_string(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_color")); - me.currentBgColorTeam = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_color_team")); - me.currentBgAlpha = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_alpha")); - me.currentBgBorder = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_border")); - me.currentBgPadding = cvar(strcat("hud_", HUD_Panel_GetName(me.currentPanel), "_bg_padding")); - - // wtf? - me.go(me, 0); // this will set the other vars for currentSkin and currentModel -} -*/ - -void changeXonoticHUDOptionsDialog(entity me) -{ - loadAllCvars(me); -} - -#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c b/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c new file mode 100644 index 000000000..e33c0c8ba --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c @@ -0,0 +1,34 @@ +#ifdef INTERFACE +CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDPowerupsDialog, fill, void(entity)) + ATTRIB(XonoticHUDPowerupsDialog, title, string, "Powerups Panel Setup") + ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDPowerupsDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15) + ATTRIB(XonoticHUDPowerupsDialog, columns, float, 4) + ATTRIB(XonoticHUDPowerupsDialog, name, string, "HUDpowerups") +ENDCLASS(XonoticHUDPowerupsDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDPowerupsDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_powerups_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_powerups_bg_alpha")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups_flip", "Flip")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_powerups_mirror", "Mirror")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c b/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c new file mode 100644 index 000000000..51b7c5749 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDPressedKeysDialog, fill, void(entity)) + ATTRIB(XonoticHUDPressedKeysDialog, title, string, "Pressed Keys Panel Setup") + ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDPressedKeysDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15) + ATTRIB(XonoticHUDPressedKeysDialog, columns, float, 4) + ATTRIB(XonoticHUDPressedKeysDialog, name, string, "HUDpressedkeys") +ENDCLASS(XonoticHUDPressedKeysDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDPressedKeysDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_pressedkeys", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_pressedkeys_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_pressedkeys_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c b/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c new file mode 100644 index 000000000..9b70a4339 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDRaceTimerDialog, fill, void(entity)) + ATTRIB(XonoticHUDRaceTimerDialog, title, string, "Race Timer Panel Setup") + ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDRaceTimerDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15) + ATTRIB(XonoticHUDRaceTimerDialog, columns, float, 4) + ATTRIB(XonoticHUDRaceTimerDialog, name, string, "HUDracetimer") +ENDCLASS(XonoticHUDRaceTimerDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDRaceTimerDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_racetimer", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_racetimer_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_racetimer_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_radar.c b/qcsrc/menu/xonotic/dialog_hudpanel_radar.c new file mode 100644 index 000000000..09ebabfb6 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_radar.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDRadarDialog, fill, void(entity)) + ATTRIB(XonoticHUDRadarDialog, title, string, "Radar Panel Setup") + ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDRadarDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDRadarDialog, rows, float, 15) + ATTRIB(XonoticHUDRadarDialog, columns, float, 4) + ATTRIB(XonoticHUDRadarDialog, name, string, "HUDradar") +ENDCLASS(XonoticHUDRadarDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDRadarDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_radar", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_radar_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_radar_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_score.c b/qcsrc/menu/xonotic/dialog_hudpanel_score.c new file mode 100644 index 000000000..b7d801895 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_score.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDScoreDialog, fill, void(entity)) + ATTRIB(XonoticHUDScoreDialog, title, string, "Score Panel Setup") + ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDScoreDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDScoreDialog, rows, float, 15) + ATTRIB(XonoticHUDScoreDialog, columns, float, 4) + ATTRIB(XonoticHUDScoreDialog, name, string, "HUDscore") +ENDCLASS(XonoticHUDScoreDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDScoreDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_score", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_score_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_score_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_timer.c b/qcsrc/menu/xonotic/dialog_hudpanel_timer.c new file mode 100644 index 000000000..5bf62a262 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_timer.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDTimerDialog, fill, void(entity)) + ATTRIB(XonoticHUDTimerDialog, title, string, "Timer Panel Setup") + ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDTimerDialog, rows, float, 15) + ATTRIB(XonoticHUDTimerDialog, columns, float, 4) + ATTRIB(XonoticHUDTimerDialog, name, string, "HUDtimer") +ENDCLASS(XonoticHUDTimerDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDTimerDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_timer", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_timer_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_timer_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_vote.c b/qcsrc/menu/xonotic/dialog_hudpanel_vote.c new file mode 100644 index 000000000..df50e039e --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_vote.c @@ -0,0 +1,30 @@ +#ifdef INTERFACE +CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDVoteDialog, fill, void(entity)) + ATTRIB(XonoticHUDVoteDialog, title, string, "Vote Panel Setup") + ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDVoteDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDVoteDialog, rows, float, 15) + ATTRIB(XonoticHUDVoteDialog, columns, float, 4) + ATTRIB(XonoticHUDVoteDialog, name, string, "HUDvote") +ENDCLASS(XonoticHUDVoteDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDVoteDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_vote", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_vote_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_vote_bg_alpha")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c new file mode 100644 index 000000000..7e1be44dd --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c @@ -0,0 +1,32 @@ +#ifdef INTERFACE +CLASS(XonoticHUDWeaponIconsDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDWeaponIconsDialog, fill, void(entity)) + ATTRIB(XonoticHUDWeaponIconsDialog, title, string, "Weapon Icons Panel Setup") + ATTRIB(XonoticHUDWeaponIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDWeaponIconsDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDWeaponIconsDialog, rows, float, 15) + ATTRIB(XonoticHUDWeaponIconsDialog, columns, float, 4) + ATTRIB(XonoticHUDWeaponIconsDialog, name, string, "HUDweaponicons") +ENDCLASS(XonoticHUDWeaponIconsDialog) +#endif + +#ifdef IMPLEMENTATION +void fillXonoticHUDWeaponIconsDialog(entity me) +{ + entity e; + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_weaponicons", "On/Off")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Team Color:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_weaponicons_bg_color_team")); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:")); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_weaponicons_bg_alpha")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "hud_weaponicons_number", "Show Weapon Number")); + me.TR(me); + //me.gotoRC(me, me.rows - 1, 0); + //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1)); +} +#endif diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index 627a58020..00da54b59 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -37,7 +37,55 @@ void configureMainWindowMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - i = spawnXonoticHUDOptionsDialog(); + i = spawnXonoticHUDNotificationDialog(); + i.configureDialog(i); + me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + + i = spawnXonoticHUDInventoryDialog(); + i.configureDialog(i); + me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + + 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 = spawnXonoticHUDWeaponIconsDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); -- 2.39.2