From eae99a40c8cd424391c9ee97f8106c4bb4c262a9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 25 Jun 2011 18:42:24 +0200 Subject: [PATCH] Menu dialog for the centerprint panel --- qcsrc/menu/classes.c | 1 + .../xonotic/dialog_hudpanel_centerprint.c | 40 +++++++++++++++++++ qcsrc/menu/xonotic/mainwindow.c | 4 ++ 3 files changed, 45 insertions(+) create mode 100644 qcsrc/menu/xonotic/dialog_hudpanel_centerprint.c diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index 61f5a4877..5b7331e37 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -104,4 +104,5 @@ #include "xonotic/dialog_hudpanel_infomessages.c" #include "xonotic/dialog_hudpanel_weapons.c" #include "xonotic/dialog_hudpanel_physics.c" +#include "xonotic/dialog_hudpanel_centerprint.c" #include "xonotic/slider_picmip.c" diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_centerprint.c b/qcsrc/menu/xonotic/dialog_hudpanel_centerprint.c new file mode 100644 index 000000000..c413786a6 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_hudpanel_centerprint.c @@ -0,0 +1,40 @@ +#ifdef INTERFACE +CLASS(XonoticHUDCenterprintDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticHUDCenterprintDialog, fill, void(entity)) + ATTRIB(XonoticHUDCenterprintDialog, title, string, _("Centerprint")) + ATTRIB(XonoticHUDCenterprintDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) + ATTRIB(XonoticHUDCenterprintDialog, intendedWidth, float, 0.4) + ATTRIB(XonoticHUDCenterprintDialog, rows, float, 15) + ATTRIB(XonoticHUDCenterprintDialog, columns, float, 4) + ATTRIB(XonoticHUDCenterprintDialog, name, string, "HUDcenterprint") +ENDCLASS(XonoticHUDCenterprintDialog) +#endif + +#ifdef IMPLEMENTATION +void XonoticHUDCenterprintDialog_fill(entity me) +{ + entity e; + string panelname = "centerprint"; + + DIALOG_HUDPANEL_COMMON(); + + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Message duration:"))); + me.TD(me, 1, 2.6, e = makeXonoticSlider(1, 10, 1, "hud_panel_centerprint_time")); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_centerprint_flip", _("Flip messages order"))); + me.TR(me); + me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Text alignment:"))); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_centerprint_align", "0", _("Left"))); + me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_centerprint_align", "0.5", _("Center"))); + me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_centerprint_align", "1", _("Right"))); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Font scale:"))); + me.TD(me, 1, 2.6, e = makeXonoticSlider(0.5, 2, 0.1, "hud_panel_centerprint_fontscale")); +} +#endif diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index feec5a9b9..55d496047 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -118,6 +118,10 @@ void MainWindow_configureMainWindow(entity me) 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); + me.advancedDialog = i = spawnXonoticAdvancedDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); -- 2.39.2