Merge branch 'nyov/samual/combined_updates' into nyov/combined_updates/effects
authornyov <nyov@nexnode.net>
Wed, 26 Nov 2014 05:40:17 +0000 (05:40 +0000)
committernyov <nyov@nexnode.net>
Wed, 26 Nov 2014 05:44:33 +0000 (05:44 +0000)
effects-high.cfg
effects-low.cfg
effects-med.cfg
effects-normal.cfg
effects-omg.cfg
effects-ultimate.cfg
effects-ultra.cfg
qcsrc/menu/classes.c
qcsrc/menu/xonotic/dialog_settings_effects.c
qcsrc/menu/xonotic/slider_particles.c [new file with mode: 0644]

index 4560615..a514ce5 100644 (file)
@@ -1,10 +1,11 @@
 cl_decals 1
 cl_decals_models 0
 cl_decals_fadetime 4
-cl_particles_quality 1
+cl_particles 1
+cl_particles_quality 1.0
 cl_damageeffect 1
 cl_spawn_point_particles 1
-cl_playerdetailreduction 4
+cl_playerdetailreduction 4.0
 gl_flashblend 0
 gl_picmip -1
 mod_q3bsp_nolightmaps 0
@@ -15,7 +16,7 @@ hud_postprocessing_maxbluralpha 0.5
 hud_powerup 0
 r_depthfirst 2
 r_drawdecals_drawdistance 500
-r_drawparticles_drawdistance 2000
+r_drawparticles_drawdistance 1500
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
index d98ba52..b7e9a98 100644 (file)
@@ -1,6 +1,7 @@
 cl_decals 1
 cl_decals_models 0
 cl_decals_fadetime 2
+cl_particles 1
 cl_particles_quality 0.4
 cl_damageeffect 0
 cl_spawn_point_particles 0
index 58191f2..66eed5a 100644 (file)
@@ -1,7 +1,8 @@
 cl_decals 1
 cl_decals_models 0
 cl_decals_fadetime 2
-cl_particles_quality 1
+cl_particles 1
+cl_particles_quality 0.8
 cl_damageeffect 0
 cl_spawn_point_particles 0
 cl_playerdetailreduction 4
@@ -15,7 +16,7 @@ hud_postprocessing_maxbluralpha 0
 hud_powerup 0
 r_depthfirst 0
 r_drawdecals_drawdistance 300
-r_drawparticles_drawdistance 1000
+r_drawparticles_drawdistance 750
 r_glsl_deluxemapping 0
 r_glsl_offsetmapping 0
 r_glsl_offsetmapping_reliefmapping 0
index dd8cce9..63dcd13 100644 (file)
@@ -1,7 +1,8 @@
 cl_decals 1
 cl_decals_models 0
 cl_decals_fadetime 2
-cl_particles_quality 1
+cl_particles 1
+cl_particles_quality 1.0
 cl_damageeffect 1
 cl_spawn_point_particles 1
 cl_playerdetailreduction 4
index 7c39fbb..9018ee2 100644 (file)
@@ -1,6 +1,7 @@
 cl_decals 0
 cl_decals_models 0
 cl_decals_fadetime 2
+cl_particles 1
 cl_particles_quality 0.4
 cl_damageeffect 0
 cl_spawn_point_particles 0
index 6897ccc..0cf3a89 100644 (file)
@@ -1,7 +1,8 @@
 cl_decals 1
 cl_decals_models 1
 cl_decals_fadetime 10
-cl_particles_quality 1
+cl_particles 1
+cl_particles_quality 1.0
 cl_damageeffect 2
 cl_spawn_point_particles 1
 cl_playerdetailreduction 0
@@ -15,7 +16,7 @@ hud_postprocessing_maxbluralpha 0.5
 hud_powerup 0.5
 r_depthfirst 2
 r_drawdecals_drawdistance 500
-r_drawparticles_drawdistance 2000
+r_drawparticles_drawdistance 3000
 r_glsl_deluxemapping 1
 r_glsl_offsetmapping 1
 r_glsl_offsetmapping_reliefmapping 1
index d530f03..5909f3b 100644 (file)
@@ -1,10 +1,11 @@
 cl_decals 1
 cl_decals_models 0
 cl_decals_fadetime 10
-cl_particles_quality 1
-cl_damageeffect 1
+cl_particles 1
+cl_particles_quality 1.0
+cl_damageeffect 2
 cl_spawn_point_particles 1
-cl_playerdetailreduction 2
+cl_playerdetailreduction 0
 gl_flashblend 0
 gl_picmip -1
 mod_q3bsp_nolightmaps 0
index ee1ce5d..46d0c02 100644 (file)
 #include "xonotic/dialog_hudpanel_centerprint.c"
 #include "xonotic/dialog_hudpanel_buffs.c"
 #include "xonotic/slider_picmip.c"
+#include "xonotic/slider_particles.c"
index e3b562e..c56d972 100644 (file)
@@ -47,8 +47,7 @@ void XonoticEffectsSettingsTab_fill(entity me)
                if(cvar("developer"))
                        me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
 
-       me.TR(me);
-       me.TR(me);
+       me.gotoRC(me, 1.25, 0);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("r_subdivisions_tolerance"));
                        e.addValue(e, ZCTX(_("DET^Lowest")), "16");
@@ -60,7 +59,13 @@ void XonoticEffectsSettingsTab_fill(entity me)
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(4, 0, -0.1, "cl_playerdetailreduction"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction"));
+                       e.addValue(e, ZCTX(_("PDET^Low")), "4");
+                       e.addValue(e, ZCTX(_("PDET^Medium")), "3");
+                       e.addValue(e, ZCTX(_("PDET^Normal")), "2");
+                       e.addValue(e, ZCTX(_("PDET^Good")), "1");
+                       e.addValue(e, ZCTX(_("PDET^Best")), "0");
+                       e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
                        setDependent(e, "r_showsurfaces", 0, 0);
@@ -126,23 +131,23 @@ void XonoticEffectsSettingsTab_fill(entity me)
                        setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles quality:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
-       me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles distance:")));
-               me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
+                       setDependent(e, "cl_decals", 1, 1);
        me.TR(me);
-       me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage effects:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
-                       e.addValue(e, ZCTX(_("DMGPRTCLS^Disabled")), "0");
-                       e.addValue(e, ZCTX(_("DMGPRTCLS^Skeletal")), "1");
-                       e.addValue(e, ZCTX(_("DMGPRTCLS^All")), "2");
-                       e.configureXonoticTextSliderValues(e);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
+                       setDependent(e, "cl_decals", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
+                       setDependent(e, "cl_decals", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_spawn_point_particles", _("Particle effects for spawnpoints")));
-               makeMulti(e, "cl_spawn_event_particles");
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
+                       setDependent(e, "cl_decals", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_fadetime"));
+                       setDependent(e, "cl_decals", 1, 1);
 
-       me.gotoRC(me, 2, 3.2); me.setFirstColumn(me, me.currentColumn);
+       me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn);
                me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "r_coronas", "0", _("No dynamic lighting")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Fake corona lighting")));
@@ -180,21 +185,28 @@ void XonoticEffectsSettingsTab_fill(entity me)
                me.TD(me, 1, 2, s);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
-                       setDependent(e, "cl_decals", 1, 1);
+               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")));
+                       makeMulti(e, "cl_spawn_event_particles");
+                       setDependent(e, "cl_particles", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Quality:")));
+                       setDependent(e, "cl_particles", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticParticlesSlider());
+                       setDependent(e, "cl_particles", 1, 1);
+               me.TR(me);
+               me.TDempty(me, 0.2);
                me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
                        setDependent(e, "cl_decals", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
                        setDependent(e, "cl_decals", 1, 1);
-       me.TR(me);
+               me.TR(me);
                me.TDempty(me, 0.2);
-           me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
-               setDependent(e, "cl_decals", 1, 1);
-           me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_fadetime"));
-               setDependent(e, "cl_decals", 1, 1);
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
+                       setDependent(e, "cl_decals", 1, 1);
+               me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_fadetime"));
+                       setDependent(e, "cl_decals", 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));
diff --git a/qcsrc/menu/xonotic/slider_particles.c b/qcsrc/menu/xonotic/slider_particles.c
new file mode 100644 (file)
index 0000000..db29f55
--- /dev/null
@@ -0,0 +1,48 @@
+#ifdef INTERFACE
+CLASS(XonoticParticlesSlider) EXTENDS(XonoticTextSlider)
+       METHOD(XonoticParticlesSlider, configureXonoticParticlesSlider, void(entity))
+       METHOD(XonoticParticlesSlider, loadCvars, void(entity))
+       METHOD(XonoticParticlesSlider, saveCvars, void(entity))
+ENDCLASS(XonoticParticlesSlider)
+entity makeXonoticParticlesSlider();
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeXonoticParticlesSlider()
+{
+       entity me;
+       me = spawnXonoticParticlesSlider();
+       me.configureXonoticParticlesSlider(me);
+       return me;
+}
+void XonoticParticlesSlider_configureXonoticParticlesSlider(entity me)
+{
+       me.configureXonoticTextSlider(me, "cl_particles_quality");
+       if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^OMG")),      "0.4 250 0"); }
+       me.addValue(me,                         ZCTX(_("PART^Low")),      "0.4 500 0");
+       me.addValue(me,                         ZCTX(_("PART^Medium")),   "0.8 750 0");
+       me.addValue(me,                         ZCTX(_("PART^Normal")),   "1.0 1000 1");
+       me.addValue(me,                         ZCTX(_("PART^High")),     "1.0 1500 1");
+       me.addValue(me,                         ZCTX(_("PART^Ultra")),    "1.0 2000 2");
+       if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^Ultimate")), "1.0 3000 2"); }
+       me.configureXonoticTextSliderValues(me);
+}
+void XonoticParticlesSlider_loadCvars(entity me)
+{
+       me.setValueFromIdentifier(me, sprintf("%s %s %s",
+               cvar_string("cl_particles_quality"),
+               cvar_string("r_drawparticles_drawdistance"),
+               cvar_string("cl_damageeffect")
+       ));
+}
+void XonoticParticlesSlider_saveCvars(entity me)
+{
+       if(me.value >= 0 || me.value < me.nValues)
+       {
+               tokenize_console(me.getIdentifier(me));
+               cvar_set("cl_particles_quality", argv(0));
+               cvar_set("r_drawparticles_drawdistance", argv(1));
+               cvar_set("cl_damageeffect", argv(2)); 
+       }
+}
+#endif