From 6118662b66e70d2873cb4ffc89c7314f43f89a72 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sun, 13 Oct 2013 10:55:14 -0400 Subject: [PATCH] Whoops, forgot to commit the particle slider file.... >.> --- qcsrc/menu/xonotic/slider_particles.c | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 qcsrc/menu/xonotic/slider_particles.c diff --git a/qcsrc/menu/xonotic/slider_particles.c b/qcsrc/menu/xonotic/slider_particles.c new file mode 100644 index 000000000..db29f556d --- /dev/null +++ b/qcsrc/menu/xonotic/slider_particles.c @@ -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 -- 2.39.2