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

Go to the source code of this file.

Functions

string GenericCommand_markup (string s2)

Variables

string markup_from [NUM_MARKUPS]
bool markup_init
string markup_to [NUM_MARKUPS]
const int NUM_MARKUPS = 41

Function Documentation

◆ GenericCommand_markup()

string GenericCommand_markup ( string s2)

Definition at line 61 of file markup.qc.

62{
63 int red, ccase, i, j;
64 string s, s3;
65
67
68 s = "";
69
70 red = 0;
71 ccase = 0;
72 int len = strlen(s2);
73 for (i = 0; i < len; ++i)
74 {
75 for(j = 0; j < NUM_MARKUPS; ++j)
76 {
77 s3 = substring(s2, i, strlen(markup_from[j]));
78 if (s3 == markup_from[j])
79 {
80 s = strcat(s, markup_to[j]);
81 i += strlen(markup_from[j]) - 1;
82 break;
83 }
84 }
85
86 if(j == NUM_MARKUPS)
87 {
88 if(substring(s2, i, 2) == "&&")
89 {
90 s = strcat(s, strconv(ccase, red, red, "&"));
91 ++i;
92 }
93 else if(substring(s2, i, 2) == "&d")
94 {
95 red = 2;
96 ccase = 0;
97 ++i;
98 }
99 else if(substring(s2, i, 2) == "&a")
100 {
101 red = 2;
102 ccase = 2;
103 ++i;
104 }
105 else if(substring(s2, i, 2) == "&n")
106 {
107 red = 0;
108 ccase = 0;
109 ++i;
110 }
111 else
112 s = strcat(s, strconv(ccase, red, red, substring(s2, i, 1)));
113 }
114 }
115
116 return s;
117}
#define strlen
void GenericCommand_markup_init()
Definition markup.qc:10
const int NUM_MARKUPS
Definition markup.qh:8
string markup_from[NUM_MARKUPS]
Definition markup.qh:10
string markup_to[NUM_MARKUPS]
Definition markup.qh:11
string substring(string s, float start, float length)
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1points s1 s2
Definition all.inc:469
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

References GenericCommand_markup_init(), markup_from, markup_to, NUM_MARKUPS, s2, strcat(), strlen, and substring().

Referenced by GenericCommand().

Variable Documentation

◆ markup_from

string markup_from[NUM_MARKUPS]

Definition at line 10 of file markup.qh.

Referenced by GenericCommand_markup(), and GenericCommand_markup_init().

◆ markup_init

bool markup_init

Definition at line 9 of file markup.qh.

Referenced by GenericCommand_markup_init().

◆ markup_to

string markup_to[NUM_MARKUPS]

Definition at line 11 of file markup.qh.

Referenced by GenericCommand_markup(), and GenericCommand_markup_init().

◆ NUM_MARKUPS

const int NUM_MARKUPS = 41

Definition at line 8 of file markup.qh.

Referenced by GenericCommand_markup().