-
Notifications
You must be signed in to change notification settings - Fork 0
/
cMainGetSet.cpp
578 lines (475 loc) · 10.2 KB
/
cMainGetSet.cpp
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
#include "cMain.h"
// Settings Page
wxString cMain::getGameType() {
return m_gameType->GetValue();
}
int cMain::getMinPlayers() {
wxString val = m_minPlayers->GetValue();
long num;
if (!val.ToLong(&num)) {
return 1;
}
return int(num);
}
int cMain::getMaxPlayers() {
wxString val = m_maxPlayers->GetValue();
long num;
if (!val.ToLong(&num)) {
return 30;
}
return int(num);
}
int cMain::getRespawnType() {
return m_respawnType->GetCurrentSelection();
}
int cMain::getStartRespawn() {
return (m_startRespawn->GetCurrentSelection() - 1);
}
std::bitset<11> cMain::getHudSettings() {
std::bitset<11> hud;
hud.set(0, m_scriptedHud->IsChecked());
hud.set(1, m_unitInfo->IsChecked());
hud.set(2, m_vehRadar->IsChecked());
hud.set(3, m_vehCompass->IsChecked());
hud.set(4, m_tankDir->IsChecked());
hud.set(5, m_commandMenu->IsChecked());
hud.set(6, m_grpInfo->IsChecked());
hud.set(7, m_crosshair->IsChecked());
hud.set(8, m_vehDispPanel->IsChecked());
hud.set(9, m_deathMsg->IsChecked());
hud.set(10, m_forceDraw3D->IsChecked());
return hud;
}
bool cMain::getMap() {
return m_showMap->IsChecked();
}
int cMain::getCorpseMode() {
return m_corpseManager->GetCurrentSelection();
}
bool cMain::getAi() {
return m_disableAi->IsChecked();
}
int cMain::getAdmin() {
return m_adminConsole->GetCurrentSelection();
}
ChannelSet* cMain::getChannels() {
ChannelSet* channels = new ChannelSet();
channels->global.chat = m_globalChat->IsChecked();
channels->global.voice = m_globalVoice->IsChecked();
channels->side.chat = m_sideChat->IsChecked();
channels->side.voice = m_sideVoice->IsChecked();
channels->command.chat = m_commandChat->IsChecked();
channels->command.voice = m_commandVoice->IsChecked();
channels->group.chat = m_groupChat->IsChecked();
channels->group.voice = m_groupVoice->IsChecked();
channels->vehicle.chat = m_vehChat->IsChecked();
channels->vehicle.voice = m_vehVoice->IsChecked();
channels->direct.voice = m_dirVoice->IsChecked(); // Direct has no chat
return channels;
}
int cMain::getCorpseLimit()
{
wxString val = m_corpseLimit->GetValue();
long num;
if (!val.ToLong(&num)) {
return 15;
}
return int(num);
}
int cMain::getCorpseMinTime()
{
wxString val = m_corpseMinTime->GetValue();
long num;
if (!val.ToLong(&num)) {
return 10;
}
return int(num);
}
int cMain::getCorpseMaxTime()
{
wxString val = m_corpseMaxTime->GetValue();
long num;
if (!val.ToLong(&num)) {
return 3600;
}
return int(num);
}
int cMain::getWreckMode()
{
return m_wreckManager->GetCurrentSelection();
}
int cMain::getWreckLimit()
{
wxString val = m_wreckLimit->GetValue();
long num;
if (!val.ToLong(&num)) {
return 15;
}
return int(num);
}
int cMain::getWreckMinTime()
{
wxString val = m_wreckMinTime->GetValue();
long num;
if (!val.ToLong(&num)) {
return 10;
}
return int(num);
}
int cMain::getWreckMaxTime()
{
wxString val = m_wreckMaxTime->GetValue();
long num;
if (!val.ToLong(&num)) {
return 36000;
}
return int(num);
}
int cMain::getMinPlayerDistance()
{
wxString val = m_minPlayerDistance->GetValue();
long num;
if (!val.ToLong(&num)) {
return 0;
}
return int(num);
}
bool cMain::getAiKills()
{
return m_aiKills->IsChecked();
}
bool cMain::getUAV()
{
return m_showUAVFeed->IsChecked();
}
bool cMain::getGroupInd()
{
return m_showGroupIndicator->IsChecked();
}
bool cMain::getWatch()
{
return m_showWatch->IsChecked();
}
bool cMain::getGPS()
{
return m_showGPS->IsChecked();
}
bool cMain::getCompass()
{
return m_showCompass->IsChecked();
}
// Load Screen Page
wxString cMain::getMapName() {
return m_name->GetValue();
}
wxString cMain::getMapAuthor() {
return m_author->GetValue();
}
wxString cMain::getMissionName() {
return m_missionNameLocation->GetValue();
}
wxString cMain::getMissionAuthor() {
return m_missionAuthorLocation->GetValue();
}
wxString cMain::getMissionBackground() {
return m_missionBackground->GetPath();
}
wxString cMain::getMapBackground() {
return m_worldBackground->GetPath();
}
wxArrayString cMain::getLoadTexts() {
wxArrayString txts;
int itemCnt = m_loadingTextLB->GetCount();
for (int i = 0; i < itemCnt; ++i)
{
txts.push_back(m_loadingTextLB->GetString(i));
}
return txts;
}
// Settings Setters
void cMain::setGameType(wxString type)
{
m_gameType->SetValue(type);
}
void cMain::setMinPlayers(int min)
{
m_minPlayers->SetValue(wxString::Format(wxT("%i"), min));
}
void cMain::setMaxPlayers(int max)
{
m_maxPlayers->SetValue(wxString::Format(wxT("%i"), max));
}
void cMain::setRespawnType(int type)
{
m_respawnType->SetSelection(type);
}
void cMain::setStartRespawn(int type)
{
m_startRespawn->SetSelection(type + 1);
}
void cMain::setHudSettings(std::bitset<11> hud)
{
m_scriptedHud->SetValue(hud[0]);
m_unitInfo->SetValue(hud[1]);
m_vehRadar->SetValue(hud[2]);
m_vehCompass->SetValue(hud[3]);
m_tankDir->SetValue(hud[4]);
m_commandMenu->SetValue(hud[5]);
m_grpInfo->SetValue(hud[6]);
m_crosshair->SetValue(hud[7]);
m_vehDispPanel->SetValue(hud[8]);
m_deathMsg->SetValue(hud[9]);
m_forceDraw3D->SetValue(hud[10]);
}
void cMain::setMap(bool map)
{
m_showMap->SetValue(map);
}
void cMain::setCorpseMode(int type)
{
m_corpseManager->SetSelection(type);
}
void cMain::setAi(bool ai)
{
m_disableAi->SetValue(ai);
}
void cMain::setAdmin(int admin)
{
m_adminConsole->SetSelection(admin);
}
void cMain::setChannels(ChannelSet* channels)
{
m_globalChat->SetValue(channels->global.chat);
m_globalVoice->SetValue(channels->global.voice);
m_sideChat->SetValue(channels->side.chat);
m_sideVoice->SetValue(channels->side.voice);
m_commandChat->SetValue(channels->command.chat);
m_commandVoice->SetValue(channels->command.voice);
m_groupChat->SetValue(channels->group.chat);
m_groupVoice->SetValue(channels->group.voice);
m_vehChat->SetValue(channels->vehicle.chat);
m_vehVoice->SetValue(channels->vehicle.voice);
m_dirVoice->SetValue(channels->direct.voice);
}
void cMain::setCorpseLimit(int num)
{
m_corpseLimit->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setCorpseMinTime(int num)
{
m_corpseMinTime->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setCorpseMaxTime(int num)
{
m_corpseMaxTime->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setWreckMode(int type)
{
m_wreckManager->SetSelection(type);
}
void cMain::setWreckLimit(int num)
{
m_wreckLimit->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setWreckMinTime(int num)
{
m_wreckMinTime->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setWreckMaxTime(int num)
{
m_wreckMaxTime->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setMinPlayerDistance(int num)
{
m_minPlayerDistance->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setCompass(bool set)
{
m_showCompass->SetValue(set);
}
void cMain::setGPS(bool set)
{
m_showGPS->SetValue(set);
}
void cMain::setWatch(bool set)
{
m_showWatch->SetValue(set);
}
void cMain::setUAV(bool set)
{
m_showUAVFeed->SetValue(set);
}
void cMain::setAiKills(bool set)
{
m_aiKills->SetValue(set);
}
void cMain::setGroupInd(bool set)
{
m_showGroupIndicator->SetValue(set);
}
// Load Screen Setters
void cMain::setMapAuthor(wxString name)
{
m_author->SetValue(name);
}
void cMain::setMapName(wxString name)
{
m_name->SetValue(name);
}
void cMain::setMissionBackground(wxString back)
{
m_missionBackground->SetPath(back);
}
void cMain::setMissionAuthor(wxString name)
{
m_missionAuthorLocation->SetValue(name);
}
void cMain::setMissionName(wxString name)
{
m_missionNameLocation->SetValue(name);
}
void cMain::setMapBackground(wxString back)
{
m_worldBackground->SetPath(back);
}
void cMain::setLoadTexts(wxArrayString txts) {
for (wxArrayString::iterator i = txts.begin(); i != txts.end(); ++i) {
m_loadingTextLB->Append(*i);
}
}
// Respawn Getters
bool cMain::getRespawnButton()
{
return m_respawnButton->IsChecked();
}
bool cMain::getRespawnDialog()
{
return m_respawnDialog->IsChecked();
}
int cMain::getRespawnDelay()
{
wxString val = m_respawnDelay->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
int cMain::getVehRespawnDelay()
{
wxString val = m_vehRespawnDelay->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
int cMain::getReviveMode()
{
return m_reviveMode->GetCurrentSelection();
}
int cMain::getDamageModel()
{
return m_damageModel->GetCurrentSelection();
}
bool cMain::getMedic()
{
return m_medicNeeded->IsChecked();
}
bool cMain::getFAK()
{
return m_fakConsumed->IsChecked();
}
int cMain::getReviveItem()
{
return m_reviveItem->GetCurrentSelection();
}
int cMain::getReviveTime()
{
wxString val = m_reviveTime->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
int cMain::getMedicMult()
{
wxString val = m_medicMult->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
int cMain::getForceRespawnDelay()
{
wxString val = m_forceRespawnDelay->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
int cMain::getBleedOutTime()
{
wxString val = m_bleedOut->GetValue();
long num;
if (!val.ToLong(&num)) {
return 5;
}
return int(num);
}
// Respawn Setters
void cMain::setRespawnButton(bool set)
{
m_respawnButton->SetValue(set);
}
void cMain::setRespawnDialog(bool set)
{
m_respawnDialog->SetValue(set);
}
void cMain::setRespawnDelay(int num)
{
m_respawnDelay->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setVehRespawnDelay(int num)
{
m_vehRespawnDelay->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setReviveMode(int type)
{
m_reviveMode->SetSelection(type);
}
void cMain::setDamageModel(int num)
{
m_damageModel->SetSelection(num);
}
void cMain::setMedic(bool set)
{
m_medicNeeded->SetValue(set);
}
void cMain::setFAK(bool set)
{
m_fakConsumed->SetValue(set);
}
void cMain::setReviveItem(int num)
{
m_reviveItem->SetSelection(num);
}
void cMain::setReviveTime(int num)
{
m_reviveTime->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setMedicMult(int num)
{
m_medicMult->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setForceRespawnDelay(int num)
{
m_forceRespawnDelay->SetValue(wxString::Format(wxT("%i"), num));
}
void cMain::setBleedOutTime(int num)
{
m_bleedOut->SetValue(wxString::Format(wxT("%i"), num));
}