From: Debugger Date: Thu, 1 Aug 2013 13:53:27 +0000 (+0200) Subject: try to add a seperate file to handle notification menu settings X-Git-Tag: xonotic-v0.8.0~139^2~1^2~154^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2c78d2ff9590bbf5031ccc75a61619f033573868;p=xonotic%2Fxonotic-data.pk3dir.git try to add a seperate file to handle notification menu settings --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c new file mode 100644 index 000000000..a4e49021e --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c @@ -0,0 +1,51 @@ +#ifdef INTERFACE +CLASS(XonoticNotificationDialog) EXTENDS(XonoticDialog) + METHOD(XonoticNotificationDialog, toString, string(entity)) + METHOD(XonoticNotificationDialog, fill, void(entity)) + METHOD(XonoticNotificationDialog, showNotify, void(entity)) + ATTRIB(XonoticNotificationDialog, title, string, _("Notification settings")) + ATTRIB(XonoticNotificationDialog, color, vector, SKINCOLOR_DIALOG_MODEL) + ATTRIB(XonoticNotificationDialog, intendedWidth, float, 0.5) + ATTRIB(XonoticNotificationDialog, rows, float, 7) + ATTRIB(XonoticNotificationDialog, columns, float, 3) +ENDCLASS(XonoticNotificationDialog) +#endif + +#ifdef IMPLEMENTATION +void XonoticNotificationDialog_showNotify(entity me) +{ + loadAllCvars(me); +} +string XonoticNotificationDialog_toString(entity me) +{ + return "hi"; // TODO: show csqc model settings like forcemyplayer and deglowing/ghosting bodies with text here +} +void XonoticNotificationDialog_fill(entity me) +{ + entity e; + + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Body fading:"))); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 2, 0.2, "cl_deathglow")); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gibs:"))); + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_nogibs")); + e.addValue(e, ZCTX(_("GIBS^None")), "1"); + e.addValue(e, ZCTX(_("GIBS^Few")), "0.75"); + e.addValue(e, ZCTX(_("GIBS^Many")), "0.5"); + e.addValue(e, ZCTX(_("GIBS^Lots")), "0"); + e.configureXonoticTextSliderValues(e); + setDependent(e, "cl_gentle", 0, 0); + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_forceplayermodels", _("Force player models to mine"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_forceplayercolors", _("Force player colors to mine"))); + me.TR(me); + + me.gotoRC(me, me.rows - 1, 0); + me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); + e.onClick = Dialog_Close; + e.onClickEntity = me; +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_settings_game.c b/qcsrc/menu/xonotic/dialog_settings_game.c index cbd230928..c026fb08b 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game.c +++ b/qcsrc/menu/xonotic/dialog_settings_game.c @@ -43,8 +43,8 @@ void XonoticGameSettingsTab_fill(entity me) me.TDempty(me, 0.5); me.TD(me, 1, 2, e = makeXonoticButton(_("Notification"), '0 0 0')); e.onClick = DialogOpenButton_Click; - e.onClickEntity = main.modelDialog; - // TODO: show csqc model settings like forcemyplayer and deglowing/ghosting bodies with text here + e.onClickEntity = main.notificationDialog; + // TODO: Show all the notification stuff here me.TR(me); me.TDempty(me, 0.5); me.TD(me, 1, 2, e = makeXonoticButton(_("Playermodel"), '0 0 0')); diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index f9d86c2dd..fd12f69e4 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -19,6 +19,7 @@ CLASS(MainWindow) EXTENDS(ModalController) ATTRIB(MainWindow, mainNexposee, entity, NULL) ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND) ATTRIB(MainWindow, dialogToShow, entity, NULL) + ATTRIB(MainWindow, notification, entity, NULL) ENDCLASS(MainWindow) #endif @@ -187,6 +188,9 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + me.notificationDialog = i spawnXonoticNotificationDialog(); + i.configureDialog(i); + me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); // mutator dialogs i = spawnXonoticSandboxToolsDialog();