From ef02b4caf3995e75451387251d9e4ac522dda005 Mon Sep 17 00:00:00 2001 From: Mirio Date: Sun, 12 Mar 2017 16:54:04 +0100 Subject: [PATCH] Free up three sliders from being dependant on each other, #1885 --- qcsrc/menu/xonotic/dialog_settings_effects.qc | 4 +- qcsrc/menu/xonotic/slider_particles.qc | 40 ------------------- qcsrc/menu/xonotic/slider_particles.qh | 9 ----- 3 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 qcsrc/menu/xonotic/slider_particles.qc delete mode 100644 qcsrc/menu/xonotic/slider_particles.qh diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.qc b/qcsrc/menu/xonotic/dialog_settings_effects.qc index b90507ee4..6f5ba8f57 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qc +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qc @@ -1,7 +1,6 @@ #include "dialog_settings_effects.qh" #include "slider_picmip.qh" -#include "slider_particles.qh" #include "slider_sbfadetime.qh" #include "weaponslist.qh" #include "keybinder.qh" @@ -246,7 +245,8 @@ void XonoticEffectsSettingsTab_fill(entity 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()); + me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 3.0, 0.25, "cl_particles_quality", + _("Multiplier for amount of particles. Less means less particles, which in turn gives for better performance (default: 1.0)"))); setDependent(e, "cl_particles", 1, 1); me.TR(me); me.TDempty(me, 0.2); diff --git a/qcsrc/menu/xonotic/slider_particles.qc b/qcsrc/menu/xonotic/slider_particles.qc deleted file mode 100644 index 3a89b00a7..000000000 --- a/qcsrc/menu/xonotic/slider_particles.qc +++ /dev/null @@ -1,40 +0,0 @@ -#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 deleted file mode 100644 index 47c1bff24..000000000 --- a/qcsrc/menu/xonotic/slider_particles.qh +++ /dev/null @@ -1,9 +0,0 @@ -#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(); -- 2.39.2