-
Notifications
You must be signed in to change notification settings - Fork 10
/
script_macros.hpp
60 lines (51 loc) · 1.93 KB
/
script_macros.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Internal
#define DOUBLES(var1,var2) ##var1##_##var2
#define TRIPLES(var1,var2,var3) ##var1##_##var2##_##var3
#define ADDON DOUBLES(PREFIX,COMPONENT)
// Main
#define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION); versionAr[] = {VERSION_AR}
#define QUOTE(var1) #var1
// Path
#define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\##var3
#define PATHTOF(var1) PATHTOF_SYS(PREFIX,COMPONENT,var1)
#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
#define QPATHTOF(var1) QUOTE(PATHTOF(var1))
#define QPATHTOEF(var1,var2) QUOTE(PATHTOEF(var1,var2))
// Class
#define CLASS(var1) DOUBLES(PREFIX,var1)
#define QCLASS(var1) QUOTE(DOUBLES(PREFIX,var1))
// Stringtable
#define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
#define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
// Items
#define ITEMS_2(var) var, var
#define ITEMS_3(var) var, var, var
#define ITEMS_4(var) var, var, var, var
#define ITEMS_5(var) var, var, var, var, var
#define ITEMS_6(var) var, var, var, var, var, var
#define ITEMS_7(var) var, var, var, var, var, var, var
#define ITEMS_8(var) var, var, var, var, var, var, var, var
#define ITEMS_9(var) var, var, var, var, var, var, var, var, var
#define ITEMS_10(var) var, var, var, var, var, var, var, var, var, var
#define ITEMS_11(var) var, var, var, var, var, var, var, var, var, var, var
#define ITEMS_12(var) var, var, var, var, var, var, var, var, var, var, var, var
#define MACRO_ADDWEAPON(WEAPON,COUNT) \
class _xx_##WEAPON { \
weapon = #WEAPON; \
count = COUNT; \
};
#define MACRO_ADDITEM(ITEM,COUNT) \
class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) \
class _xx_##MAGAZINE { \
magazine = #MAGAZINE; \
count = COUNT; \
};
#define MACRO_ADDBACKPACK(BACKPACK,COUNT) \
class _xx_##BACKPACK { \
backpack = #BACKPACK; \
count = COUNT; \
};