]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
try to add a seperate file to handle notification menu settings
authorDebugger <pyngot@hotmail.com>
Thu, 1 Aug 2013 13:53:27 +0000 (15:53 +0200)
committerDebugger <pyngot@hotmail.com>
Thu, 1 Aug 2013 13:53:27 +0000 (15:53 +0200)
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c [new file with mode: 0644]
qcsrc/menu/xonotic/dialog_settings_game.c
qcsrc/menu/xonotic/mainwindow.c

diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_notification.c
new file mode 100644 (file)
index 0000000..a4e4902
--- /dev/null
@@ -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
index cbd230928f60de919bd2ccd6d875ee058d4ce90f..c026fb08ba02c51cdd95dcbac1a8589d84fd9023 100644 (file)
@@ -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'));
index f9d86c2dd229276aadb7272c9484f165bb1ad606..fd12f69e4250aa25c6b6d0c261e441b6efcef576 100644 (file)
@@ -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();