]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_settings_effects.qc
Merge branch 'master' into Mario/killsound
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_effects.qc
index 9089691590d6ccfaef63f852905c163ee6754040..b90507ee481d8528f7261c0c03df6e6993edd160 100644 (file)
@@ -1,16 +1,18 @@
-#ifndef DIALOG_SETTINGS_EFFECTS_H
-#define DIALOG_SETTINGS_EFFECTS_H
-#include "tab.qc"
-CLASS(XonoticEffectsSettingsTab, XonoticTab)
-       METHOD(XonoticEffectsSettingsTab, fill, void(entity));
-       ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
-       ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5)
-       ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
-ENDCLASS(XonoticEffectsSettingsTab)
-entity makeXonoticEffectsSettingsTab();
-#endif
+#include "dialog_settings_effects.qh"
+
+#include "slider_picmip.qh"
+#include "slider_particles.qh"
+#include "slider_sbfadetime.qh"
+#include "weaponslist.qh"
+#include "keybinder.qh"
+#include "commandbutton.qh"
+#include "textlabel.qh"
+#include "checkbox.qh"
+#include "textslider.qh"
+#include "slider.qh"
+#include "radiobutton.qh"
+#include "checkbox_slider_invalid.qh"
 
-#ifdef IMPLEMENTATION
 entity makeXonoticEffectsSettingsTab()
 {
        entity me;
@@ -33,19 +35,32 @@ float someShadowCvarIsEnabled(entity box)
 void XonoticEffectsSettingsTab_fill(entity me)
 {
        entity e, s;
+       entity effectsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY);
+       effectsApplyButton.disableOnClick = true;
        float n;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
-               n = 5 + 2 * !!cvar("developer");
+               n = 5 + 2 * boolean(cvar("developer"));
                if(cvar("developer"))
+               {
                        me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
+                               e.applyButton = effectsApplyButton;
+               }
                me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
+                       e.applyButton = effectsApplyButton;
                if(cvar("developer"))
+               {
                        me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
+                               e.applyButton = effectsApplyButton;
+               }
 
        me.gotoRC(me, 1.25, 0);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
@@ -58,6 +73,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
                        e.addValue(e, ZCTX(_("DET^Best")), "2");
                        e.addValue(e, ZCTX(_("DET^Insane")), "1");
                        e.configureXonoticTextSliderValues(e);
+                       e.applyButton = effectsApplyButton;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction"));
@@ -67,6 +83,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
                        e.addValue(e, ZCTX(_("PDET^Good")), "1");
                        e.addValue(e, ZCTX(_("PDET^Best")), "0");
                        e.configureXonoticTextSliderValues(e);
+                       e.applyButton = effectsApplyButton;
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
                        setDependent(e, "r_showsurfaces", 0, 0);
@@ -81,6 +98,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
                        e.addValue(e, ZCTX(_("RES^Best")), "-2");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "r_showsurfaces", 0, 0);
+                       e.applyButton = effectsApplyButton;
        me.TR(me);
                me.TDempty(me, 0.2);
                {
@@ -92,15 +110,18 @@ void XonoticEffectsSettingsTab_fill(entity me)
                                case 0:
                                        me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
                                                e.disabled = 1; // just show the checkbox anyway, but with no ability to control it
+                                               e.applyButton = effectsApplyButton;
                                        break;
                                case 1:
                                        me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
                                                setDependent(e, "r_showsurfaces", 0, 0);
+                                               e.applyButton = effectsApplyButton;
                                        break;
                                case 2:
                                        me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
                                                setDependent(e, "r_showsurfaces", 0, 0);
                                                makeMulti(e, "gl_texturecompression");
+                                               e.applyButton = effectsApplyButton;
                                        break;
                        }
                }
@@ -114,6 +135,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"),
                        _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)")));
+                       e.applyButton = effectsApplyButton;
                me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"),
                        _("Use per-pixel lighting effects (default: enabled)")));
                        setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
@@ -216,7 +238,8 @@ void XonoticEffectsSettingsTab_fill(entity me)
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_particles", _("Particles")));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_spawn_point_particles", _("Spawnpoint effects")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "cl_spawn_point_particles", _("Spawnpoint effects"),
+                       _("Particles effects at all spawn points and whenever a player spawns")));
                        makeMulti(e, "cl_spawn_event_particles");
                        setDependent(e, "cl_particles", 1, 1);
        me.TR(me);
@@ -229,11 +252,10 @@ void XonoticEffectsSettingsTab_fill(entity me)
                me.TDempty(me, 0.2);
                me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
                        setDependent(e, "cl_particles", 1, 1);
-               me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawparticles_drawdistance",
+               me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 3000, 200, "r_drawparticles_drawdistance",
                        _("Particles further away than this will not be drawn (default: 1000)")));
                        setDependent(e, "cl_particles", 1, 1);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, effectsApplyButton);
 }
-#endif