]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Dont delete this
authorMirio <opivy@hotmail.de>
Sun, 12 Mar 2017 16:05:54 +0000 (17:05 +0100)
committerMirio <opivy@hotmail.de>
Sun, 12 Mar 2017 16:05:54 +0000 (17:05 +0100)
qcsrc/menu/xonotic/slider_particles.qc [new file with mode: 0644]
qcsrc/menu/xonotic/slider_particles.qh [new file with mode: 0644]

diff --git a/qcsrc/menu/xonotic/slider_particles.qc b/qcsrc/menu/xonotic/slider_particles.qc
new file mode 100644 (file)
index 0000000..3a89b00
--- /dev/null
@@ -0,0 +1,40 @@
+#include "slider_particles.qh"
+
+entity makeXonoticParticlesSlider()
+{
+       entity me;
+       me = NEW(XonoticParticlesSlider);
+       me.configureXonoticParticlesSlider(me);
+       return me;
+}
+void XonoticParticlesSlider_configureXonoticParticlesSlider(entity me)
+{
+       me.configureXonoticTextSlider(me, "cl_particles_quality",
+               _("Multiplier for amount of particles. Less means less particles, which in turn gives for better performance (default: 1)"));
+       if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^OMG")),      "0.25 250 0"); }
+       me.addValue(me,                         ZCTX(_("PART^Low")),      "0.5 500 0");
+       me.addValue(me,                         ZCTX(_("PART^Medium")),   "0.75 750 0");
+       me.addValue(me,                         ZCTX(_("PART^Normal")),   "1.0 1000 1");
+       me.addValue(me,                         ZCTX(_("PART^High")),     "1.5 1500 1");
+       me.addValue(me,                         ZCTX(_("PART^Ultra")),    "2.0 2000 2");
+       if(cvar("developer")) { me.addValue(me, ZCTX(_("PART^Ultimate")), "3.0 3000 2"); }
+       me.configureXonoticTextSliderValues(me);
+}
+void XonoticParticlesSlider_loadCvars(entity me)
+{
+       me.setValueFromIdentifier_noAnim(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));
+       }
+}
diff --git a/qcsrc/menu/xonotic/slider_particles.qh b/qcsrc/menu/xonotic/slider_particles.qh
new file mode 100644 (file)
index 0000000..47c1bff
--- /dev/null
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "textslider.qh"
+CLASS(XonoticParticlesSlider, XonoticTextSlider)
+       METHOD(XonoticParticlesSlider, configureXonoticParticlesSlider, void(entity));
+       METHOD(XonoticParticlesSlider, loadCvars, void(entity));
+       METHOD(XonoticParticlesSlider, saveCvars, void(entity));
+ENDCLASS(XonoticParticlesSlider)
+entity makeXonoticParticlesSlider();