Xonotic
slider_particles.qc
Go to the documentation of this file.
1
#include "
slider_particles.qh
"
2
3
entity
makeXonoticParticlesSlider
()
4
{
5
entity
me;
6
me =
NEW
(
XonoticParticlesSlider
);
7
me.configureXonoticParticlesSlider(me);
8
return
me;
9
}
10
void
XonoticParticlesSlider_configureXonoticParticlesSlider
(
entity
me)
11
{
12
me.configureXonoticTextSlider(me,
"cl_particles_quality"
,
13
_(
"Multiplier for amount of particles. Less means less particles, which in turn gives for better performance"
));
14
if
(
cvar
(
"developer"
) > 0) { me.addValue(me,
ZCTX
(_(
"PART^OMG"
)),
"0.25 250 0"
); }
15
me.addValue(me,
ZCTX
(_(
"PARTQUAL^Low"
)),
"0.5 500 0"
);
16
me.addValue(me,
ZCTX
(_(
"PARTQUAL^Medium"
)),
"0.75 750 0"
);
17
me.addValue(me,
ZCTX
(_(
"PARTQUAL^Normal"
)),
"1.0 1000 1"
);
18
me.addValue(me,
ZCTX
(_(
"PARTQUAL^High"
)),
"1.5 1500 1"
);
19
me.addValue(me,
ZCTX
(_(
"PARTQUAL^Ultra"
)),
"2.0 2000 2"
);
20
if
(
cvar
(
"developer"
) > 0) { me.addValue(me,
ZCTX
(_(
"PARTQUAL^Ultimate"
)),
"3.0 3000 2"
); }
21
me.configureXonoticTextSliderValues(me);
22
}
23
void
XonoticParticlesSlider_loadCvars
(
entity
me)
24
{
25
me.setValueFromIdentifier_noAnim(me, sprintf(
"%s %s %s"
,
26
cvar_string
(
"cl_particles_quality"
),
27
cvar_string
(
"r_drawparticles_drawdistance"
),
28
cvar_string
(
"cl_damageeffect"
)
29
));
30
}
31
void
XonoticParticlesSlider_saveCvars
(
entity
me)
32
{
33
if
(me.value >= 0 || me.value < me.nValues)
34
{
35
tokenize_console
(me.getIdentifier(me));
36
cvar_set
(
"cl_particles_quality"
,
argv
(0));
37
cvar_set
(
"r_drawparticles_drawdistance"
,
argv
(1));
38
cvar_set
(
"cl_damageeffect"
,
argv
(2));
39
}
40
}
cvar
float cvar(string name)
XonoticParticlesSlider_loadCvars
void XonoticParticlesSlider_loadCvars(entity me)
Definition:
slider_particles.qc:23
NEW
#define NEW(cname,...)
Definition:
oo.qh:105
XonoticParticlesSlider_configureXonoticParticlesSlider
void XonoticParticlesSlider_configureXonoticParticlesSlider(entity me)
Definition:
slider_particles.qc:10
XonoticParticlesSlider
Definition:
slider_particles.qh:4
entity
entity() spawn
makeXonoticParticlesSlider
entity makeXonoticParticlesSlider()
Definition:
slider_particles.qc:3
ZCTX
#define ZCTX(s)
Definition:
i18n.qh:68
argv
string argv(float n)
tokenize_console
#define tokenize_console
Definition:
dpextensions.qh:24
XonoticParticlesSlider_saveCvars
void XonoticParticlesSlider_saveCvars(entity me)
Definition:
slider_particles.qc:31
cvar_string
const string cvar_string(string name)
slider_particles.qh
cvar_set
void cvar_set(string name, string value)
menu
xonotic
slider_particles.qc
Generated on Thu Mar 17 2022 17:26:29 for Xonotic by
1.8.13