Xonotic
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)
 
void TextSlider_setValueFromIdentifier_allowAnim (entity me, string id, bool allowAnim)
 
void TextSlider_setValueFromIdentifier_noAnim (entity me, string id)
 
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 42 of file textslider.qc.

43  {
44  me.(valueStrings[me.nValues]) = theString;
45  me.(valueIdentifiers[me.nValues]) = theIdentifier;
46  me.nValues += 1;
47  }

◆ TextSlider_clearValues()

void TextSlider_clearValues ( entity  me)

Definition at line 38 of file textslider.qc.

39  {
40  me.nValues = 0;
41  }

◆ TextSlider_configureTextSliderValues()

void TextSlider_configureTextSliderValues ( entity  me,
string  theDefault 
)

Definition at line 60 of file textslider.qc.

61  {
62  me.configureSliderValues(me, 0, 0, me.nValues - 1, 1, 1, 1);
63  me.setValueFromIdentifier_noAnim(me, theDefault);
64  }

◆ TextSlider_getIdentifier()

string TextSlider_getIdentifier ( entity  me)

Definition at line 34 of file textslider.qc.

35  {
36  return me.valueToIdentifier(me, me.value);
37  }

◆ TextSlider_insertValue()

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

Definition at line 48 of file textslider.qc.

49  {
50  int i;
51  for (i = me.nValues; i > pos; --i)
52  {
53  me.(valueStrings[i]) = me.(valueStrings[i - 1]);
54  me.(valueIdentifiers[i]) = me.(valueIdentifiers[i - 1]);
55  }
56  me.(valueStrings[pos]) = theString;
57  me.(valueIdentifiers[pos]) = theIdentifier;
58  me.nValues += 1;
59  }

◆ TextSlider_setValueFromIdentifier()

void TextSlider_setValueFromIdentifier ( entity  me,
string  id 
)

Definition at line 30 of file textslider.qc.

References TextSlider_setValueFromIdentifier_allowAnim().

31  {
33  }
void TextSlider_setValueFromIdentifier_allowAnim(entity me, string id, bool allowAnim)
Definition: textslider.qc:15
+ Here is the call graph for this function:

◆ TextSlider_setValueFromIdentifier_allowAnim()

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

Definition at line 15 of file textslider.qc.

References SUPER.

Referenced by TextSlider_setValueFromIdentifier(), and TextSlider_setValueFromIdentifier_noAnim().

16  {
17  int i;
18  for (i = 0; i < me.nValues; ++i)
19  if (me.valueToIdentifier(me, i) == id)
20  {
21  SUPER(TextSlider).setValue_allowAnim(me, i, allowAnim);
22  return;
23  }
24  SUPER(TextSlider).setValue_allowAnim(me, -1, allowAnim);
25  }
#define SUPER(cname)
Definition: oo.qh:219
+ Here is the caller graph for this function:

◆ TextSlider_setValueFromIdentifier_noAnim()

void TextSlider_setValueFromIdentifier_noAnim ( entity  me,
string  id 
)

Definition at line 26 of file textslider.qc.

References TextSlider_setValueFromIdentifier_allowAnim().

27  {
29  }
void TextSlider_setValueFromIdentifier_allowAnim(entity me, string id, bool allowAnim)
Definition: textslider.qc:15
+ Here is the call graph for this function:

◆ 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  }

◆ 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  }