DayZ 1.24
Loading...
Searching...
No Matches
PluginConfigEmotesProfile.c
Go to the documentation of this file.
1class PluginConfigEmotesProfile extends PluginConfigHandler
2{
3 /*protected const string EMOTE_1 = "emote_slot_1";
4 protected const string EMOTE_2 = "emote_slot_2";
5 protected const string EMOTE_3 = "emote_slot_3";
6 protected const string EMOTE_4 = "emote_slot_4";
7 protected const string EMOTE_5 = "emote_slot_5";
8 protected const string EMOTE_6 = "emote_slot_6";
9 protected const string EMOTE_7 = "emote_slot_7";
10 protected const string EMOTE_8 = "emote_slot_8";
11 protected const string EMOTE_9 = "emote_slot_9";
12 protected const string EMOTE_10 = "emote_slot_10";
13 protected const string EMOTE_11 = "emote_slot_11";
14 protected const string EMOTE_12 = "emote_slot_12";*/
15
18
19 //========================================
20 // GetInstance
21 //========================================
22 static PluginConfigEmotesProfile GetInstance()
23 {
24 return PluginConfigEmotesProfile.Cast(GetPlugin(PluginConfigEmotesProfile));
25 }
26
27
28 //========================================
29 // GetCfgParamInt
30 //========================================
31 protected CfgParamInt GetNewCfgParamInt(int value)
32 {
33 CfgParamInt param = new CfgParamInt("");
34 param.SetValue(value);
35 return param;
36 }
37
38 //========================================
39 // Int
40 //========================================
41 protected CfgParamInt SetInt(string key, int value)
42 {
43 CfgParamInt param = CfgParamInt.Cast(GetParamByName(key, CFG_TYPE_INT));
44 param.SetValue(value);
45 //SaveConfigToFile();
46 return param;
47 }
48
49 protected int GetInt(string key)
50 {
51 if (ParamExist(key))
52 {
53 CfgParamInt param = CfgParamInt.Cast(GetParamByName(key, CFG_TYPE_INT));
54 return param.GetValue();
55 }
56 else
57 {
58 if (m_DefaultValues.Contains(key))
59 {
60 CfgParamInt default_param = CfgParamInt.Cast(m_DefaultValues.Get(key));
61 return SetInt(key, default_param.GetValue()).GetValue();
62 }
63 else
64 return SetInt(key, 0).GetValue();
65 }
66 }
67
68 //========================================
69 // PluginConfigEmotesProfile
70 //========================================
72 {
73 m_DefaultValues = new map<string, ref CfgParam>;
74 //Here you can configure default EMOTES
75
76 m_DefaultValues.Insert(EmoteSlots.EMOTE_1.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_GREETING));
77 m_DefaultValues.Insert(EmoteSlots.EMOTE_2.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_SOS));
78 m_DefaultValues.Insert(EmoteSlots.EMOTE_3.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_HEART));
79 m_DefaultValues.Insert(EmoteSlots.EMOTE_4.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_TAUNT));
80 m_DefaultValues.Insert(EmoteSlots.EMOTE_5.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_SURRENDER));
81 m_DefaultValues.Insert(EmoteSlots.EMOTE_6.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_TAUNTKISS));
82 m_DefaultValues.Insert(EmoteSlots.EMOTE_7.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_POINT));
83 m_DefaultValues.Insert(EmoteSlots.EMOTE_8.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_TAUNTELBOW));
84 m_DefaultValues.Insert(EmoteSlots.EMOTE_9.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_THUMB));
85 m_DefaultValues.Insert(EmoteSlots.EMOTE_10.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_THROAT));
86 m_DefaultValues.Insert(EmoteSlots.EMOTE_11.ToString(), GetNewCfgParamInt(EmoteConstants.ID_EMOTE_SUICIDE));
87 //m_DefaultValues.Insert( EMOTE_12, GetNewCfgParamInt(EmoteConstants.ID_EMOTE_DANCE) );
88 //m_DefaultValues.Insert( EMOTE_12, GetNewCfgParamInt(EmoteConstants.ID_EMOTE_SOS) );
89 }
90
91 //========================================
92 // GetFileName
93 //========================================
94 override string GetFileName()
95 {
97 }
98
99 //========================================
100 // EmoteStoring
101 //========================================
103 {
104 return GetInt(EmoteSlots.EMOTE_1.ToString());
105 }
106
108 {
109 SetInt(EmoteSlots.EMOTE_1.ToString(), emoted_id);
110 }
111
113 {
114 return GetInt(EmoteSlots.EMOTE_2.ToString());
115 }
116
118 {
119 SetInt(EmoteSlots.EMOTE_2.ToString(), emoted_id);
120 }
121
123 {
124 return GetInt(EmoteSlots.EMOTE_3.ToString());
125 }
126
128 {
129 SetInt(EmoteSlots.EMOTE_3.ToString(), emoted_id);
130 }
131
133 {
134 return GetInt(EmoteSlots.EMOTE_4.ToString());
135 }
136
138 {
139 SetInt(EmoteSlots.EMOTE_4.ToString(), emoted_id);
140 }
141
143 {
144 return GetInt(EmoteSlots.EMOTE_5.ToString());
145 }
146
148 {
149 SetInt(EmoteSlots.EMOTE_5.ToString(), emoted_id);
150 }
151
153 {
154 return GetInt(EmoteSlots.EMOTE_6.ToString());
155 }
156
158 {
159 SetInt(EmoteSlots.EMOTE_6.ToString(), emoted_id);
160 }
161
163 {
164 return GetInt(EmoteSlots.EMOTE_7.ToString());
165 }
166
168 {
169 SetInt(EmoteSlots.EMOTE_7.ToString(), emoted_id);
170 }
171
173 {
174 return GetInt(EmoteSlots.EMOTE_8.ToString());
175 }
176
178 {
179 SetInt(EmoteSlots.EMOTE_8.ToString(), emoted_id);
180 }
181
183 {
184 return GetInt(EmoteSlots.EMOTE_9.ToString());
185 }
186
188 {
189 SetInt(EmoteSlots.EMOTE_9.ToString(), emoted_id);
190 }
191
193 {
194 return GetInt(EmoteSlots.EMOTE_10.ToString());
195 }
196
198 {
199 SetInt(EmoteSlots.EMOTE_10.ToString(), emoted_id);
200 }
201
203 {
204 return GetInt(EmoteSlots.EMOTE_11.ToString());
205 }
206
208 {
209 SetInt(EmoteSlots.EMOTE_11.ToString(), emoted_id);
210 }
211
212 /*int GetEmoteSlot12()
213 {
214 return GetInt( EMOTE_12 );
215 }
216
217 void SetEmoteSlot12( int emoted_id )
218 {
219 SetInt( EMOTE_12, emoted_id );
220 }*/
221
222 int GetEmoteFromSlot(string slot)
223 {
224 return GetInt(slot);
225 }
226}
227
228enum EmoteSlots
229{
242}
const int CFG_TYPE_INT
Definition CfgParam.c:2
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_6
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_8
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_11
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_2
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_1
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_9
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_3
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_7
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_10
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_4
class PluginConfigEmotesProfile extends PluginConfigHandler EMOTE_5
int GetInt()
PluginBase GetPlugin(typename plugin_type)
static PluginConfigEmotesProfile GetInstance()
void SetEmoteSlot8(int emoted_id)
void SetEmoteSlot2(int emoted_id)
void SetEmoteSlot9(int emoted_id)
void SetEmoteSlot7(int emoted_id)
CfgParamInt SetInt(string key, int value)
CfgParamInt GetNewCfgParamInt(int value)
void SetEmoteSlot3(int emoted_id)
void SetEmoteSlot6(int emoted_id)
void SetEmoteSlot1(int emoted_id)
void SetEmoteSlot4(int emoted_id)
ref map< string, ref CfgParam > m_DefaultValues
void SetEmoteSlot5(int emoted_id)
void SetEmoteSlot10(int emoted_id)
void SetEmoteSlot11(int emoted_id)
const string CFG_FILE_EMOTES_PROFILE
Definition constants.c:232
const int ID_EMOTE_SURRENDER
Definition constants.c:389
const int ID_EMOTE_POINT
Definition constants.c:370
const int ID_EMOTE_THUMB
Definition constants.c:358
const int ID_EMOTE_TAUNT
Definition constants.c:353
const int ID_EMOTE_GREETING
Definition constants.c:350
const int ID_EMOTE_THROAT
Definition constants.c:359
const int ID_EMOTE_SUICIDE
Definition constants.c:360
const int ID_EMOTE_HEART
Definition constants.c:352
const int ID_EMOTE_SOS
Definition constants.c:351
const int ID_EMOTE_TAUNTKISS
Definition constants.c:355
const int ID_EMOTE_TAUNTELBOW
Definition constants.c:357