Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
textslider.qc File Reference
#include "textslider.qh"
Include dependency graph for textslider.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void TextSlider_addValue (entity me, string theString, string theIdentifier)
void TextSlider_clearValues (entity me)
void TextSlider_configureTextSliderValues (entity me, string theDefault)
string TextSlider_getIdentifier (entity me)
void TextSlider_insertValue (entity me, int pos, string theString, string theIdentifier)
void TextSlider_setValueFromIdentifier (entity me, string id, bool allowAnim)
string TextSlider_valueToIdentifier (entity me, int val)
string TextSlider_valueToText (entity me, int val)

Function Documentation

◆ TextSlider_addValue()

void TextSlider_addValue ( entity me,
string theString,
string theIdentifier )

Definition at line 34 of file textslider.qc.

35 {
36 me.(valueStrings[me.nValues]) = theString;
37 me.(valueIdentifiers[me.nValues]) = theIdentifier;
38 ++me.nValues;
39 }

References entity().

◆ TextSlider_clearValues()

void TextSlider_clearValues ( entity me)

Definition at line 30 of file textslider.qc.

31 {
32 me.nValues = 0;
33 }

References entity().

◆ TextSlider_configureTextSliderValues()

void TextSlider_configureTextSliderValues ( entity me,
string theDefault )

Definition at line 52 of file textslider.qc.

53 {
54 me.configureSliderValues(me, 0, 0, me.nValues - 1, 1, 1, 1);
55 me.setValueFromIdentifier(me, theDefault, false);
56 }

References entity().

◆ TextSlider_getIdentifier()

string TextSlider_getIdentifier ( entity me)

Definition at line 26 of file textslider.qc.

27 {
28 return me.valueToIdentifier(me, me.value);
29 }

References entity().

◆ TextSlider_insertValue()

void TextSlider_insertValue ( entity me,
int pos,
string theString,
string theIdentifier )

Definition at line 40 of file textslider.qc.

41 {
42 int i;
43 for (i = me.nValues; i > pos; --i)
44 {
45 me.(valueStrings[i]) = me.(valueStrings[i - 1]);
46 me.(valueIdentifiers[i]) = me.(valueIdentifiers[i - 1]);
47 }
48 me.(valueStrings[pos]) = theString;
49 me.(valueIdentifiers[pos]) = theIdentifier;
50 ++me.nValues;
51 }

References entity().

◆ TextSlider_setValueFromIdentifier()

void TextSlider_setValueFromIdentifier ( entity me,
string id,
bool allowAnim )

Definition at line 15 of file textslider.qc.

16 {
17 int i;
18 for (i = 0; i < me.nValues; ++i)
19 if (me.valueToIdentifier(me, i) == id)
20 {
21 SUPER(TextSlider).setValue(me, i, allowAnim);
22 return;
23 }
24 SUPER(TextSlider).setValue(me, -1, allowAnim);
25 }
#define SUPER(cname)
Definition oo.qh:231

References entity(), and SUPER.

◆ TextSlider_valueToIdentifier()

string TextSlider_valueToIdentifier ( entity me,
int val )

Definition at line 3 of file textslider.qc.

4 {
5 if (val >= me.nValues) return "custom";
6 if (val < 0) return "custom";
7 return me.(valueIdentifiers[val]);
8 }

References entity().

◆ TextSlider_valueToText()

string TextSlider_valueToText ( entity me,
int val )

Definition at line 9 of file textslider.qc.

10 {
11 if (val >= me.nValues) return _("Custom");
12 if (val < 0) return _("Custom");
13 return me.(valueStrings[val]);
14 }

References entity().