-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOpenSaveDialog.cpp
467 lines (432 loc) · 20 KB
/
OpenSaveDialog.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
#include "Common.h"
#include "CustomWidgets.h"
#include "EditableVersion.h"
#include "OpenSaveDialog.h"
OpenSaveDialog::OpenSaveDialog(wxWindow *parent, const wxString &title, wxDialog *slave, const wxFont &font)
: wxDialog(parent, -1, title + " files...", wxDefaultPosition, wxSize(500, 250), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxNO_DEFAULT)
{
SetFont(font);
Layout = new wxFlexGridSizer(2, 2, 2);
ForceDat = false;
Main = new wxBoxSizer(wxVERTICAL);
SolidText *Defaults_Label = new SolidText(slave, " Defaults: ");
Defaults = new wxBoxSizer(wxHORIZONTAL);
Defaults_StarWars = new wxBoxSizer(wxHORIZONTAL);
Buttons = new wxBoxSizer(wxHORIZONTAL);
Radio_DatFileLocation = new PairedCheckBox(slave, "Compressed data set (*.dat):", (wxWindow **)&Path_DatFileLocation);
ButtonOK = new wxButton(slave, wxID_OK, title);
ButtonCancel = new wxButton(slave, wxID_CANCEL, "Cancel");
Buttons->Add(ButtonOK);
Buttons->Add(ButtonCancel);
Button_DefaultAoE = new wxButton(slave, wxID_ANY, "Age of Empires");
Button_DefaultRoR = new wxButton(slave, wxID_ANY, "Rise of Rome");
Button_DefaultDE1 = new wxButton(slave, wxID_ANY, "Age of Empires: Definitive Edition");
Button_DefaultAoK = new wxButton(slave, wxID_ANY, "Age of Kings");
Button_DefaultTC = new wxButton(slave, wxID_ANY, "The Conquerors");
Button_DefaultAoKHD = new wxButton(slave, wxID_ANY, "Age of Empires II: HD");
Button_DefaultAP = new wxButton(slave, wxID_ANY, "Forgotten + African Kingdoms + Rajas");
Button_DefaultSWGB = new wxButton(slave, wxID_ANY, "Star Wars: Galactic Battlegrounds");
Button_DefaultCC = new wxButton(slave, wxID_ANY, "Clone Campaigns");
Button_DefaultDE2 = new wxButton(slave, wxID_ANY, "Age of Empires II: Definitive Edition");
#ifdef WIN32
Button_PathFromRegistry = new wxButton(slave, wxID_ANY, "Fill paths from registry");
#endif
Defaults->Add(Defaults_Label);
Defaults->Add(Button_DefaultAoE, 0, wxEXPAND);
Defaults->Add(Button_DefaultRoR, 0, wxEXPAND);
Defaults->Add(Button_DefaultAoK, 0, wxEXPAND);
Defaults->Add(Button_DefaultTC, 0, wxEXPAND);
Defaults->Add(Button_DefaultAoKHD, 0, wxEXPAND);
Defaults->Add(Button_DefaultAP, 0, wxEXPAND | wxRIGHT, 50);
Defaults_StarWars->Add(Button_DefaultSWGB, 0, wxEXPAND | wxLEFT, 50);
Defaults_StarWars->Add(Button_DefaultCC, 0, wxEXPAND);
Defaults_StarWars->Add(Button_DefaultDE1, 0, wxEXPAND);
Defaults_StarWars->Add(Button_DefaultDE2, 0, wxEXPAND);
SolidText *Text_GenieVer = new SolidText(slave, " Genie version:");
ComboBox_GenieVer = new wxOwnerDrawnComboBox(slave, wxID_ANY, "", wxDefaultPosition, wxSize(350, -1), 0, 0, wxCB_READONLY);
ComboBox_GenieVer->Append("TEST");
ComboBox_GenieVer->Append("TEST.DAT");
ComboBox_GenieVer->Append("MICKEY.DAT");
ComboBox_GenieVer->Append("DAVE.DAT");
ComboBox_GenieVer->Append("MATT.DAT < 6.92");
ComboBox_GenieVer->Append("Age of Empires Beta (7.04 - 7.11)");
ComboBox_GenieVer->Append("Age of Empires (7.2)");
ComboBox_GenieVer->Append("Rise of Rome (7.24)");
ComboBox_GenieVer->Append("Age of Kings E3 (9.36)");
ComboBox_GenieVer->Append("Age of Kings Alpha (10.19)");
ComboBox_GenieVer->Append("Age of Kings Beta (11.05)");
ComboBox_GenieVer->Append("Age of Kings (11.5)");
ComboBox_GenieVer->Append("The Conquerors (11.76)");
ComboBox_GenieVer->Append("The Conquerors (11.76) + UserPatch 1.5");
ComboBox_GenieVer->Append("The Conquerors (11.76) + Terrain patch");
ComboBox_GenieVer->Append("Forgotten + African Kingdoms + Rajas > 12");
ComboBox_GenieVer->Append("Star Wars: Galactic Battlegrounds (1.0)");
ComboBox_GenieVer->Append("Clone Campaigns (1.1)");
ComboBox_GenieVer->Append("Mod: Expanding Fronts (1.3 - 1.4) / Terrain patch");
ComboBox_GenieVer->Append("Mod: Expanding Fronts (>= 1.4.1) / Terrain + tech tree patch");
ComboBox_GenieVer->Append("Age of Empires: Definitive Edition");
ComboBox_GenieVer->Append("Age of Empires II: Definitive Edition");
ComboBox_GenieVer->SetSelection(EV_TC);
SolidText *RecentText = new SolidText(slave, " Recent paths:");
CheckBox_Recent = new wxOwnerDrawnComboBox(slave, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_READONLY);
SolidText *DriveText = new SolidText(slave, " Drive letter:");
DriveLetterBox = new wxTextCtrl(slave, wxID_ANY, "C", wxDefaultPosition, wxSize(50, -1));
SolidText *LanguageText = new SolidText(slave, " Language: * ");
LanguageBox = new wxTextCtrl(slave, wxID_ANY, "en", wxDefaultPosition, wxSize(50, -1));
LanguageBox->SetToolTip("For AoK HD paths");
Extras = new wxBoxSizer(wxHORIZONTAL);
CheckBox_CustomDefault = new PairedCheckBox(slave, "Custom path override:", (wxWindow **)&Path_CustomDefault);
Path_CustomDefault = new wxDirPickerCtrl(slave, wxID_ANY, "", "Select a folder", wxDefaultPosition, wxDefaultSize, wxDIRP_USE_TEXTCTRL | wxDIRP_DIR_MUST_EXIST);
wxSizer *sizer1 = new wxBoxSizer(wxHORIZONTAL);
wxSizer *sizer2 = new wxBoxSizer(wxHORIZONTAL);
CheckBox_LangFileLocation = new PairedCheckBox(slave, "Language file location:", (wxWindow **)&Path_LangFileLocation);
CheckBox_LangX1FileLocation = new PairedCheckBox(slave, "Language x1 file location:", (wxWindow **)&Path_LangX1FileLocation);
CheckBox_LangX1P1FileLocation = new PairedCheckBox(slave, "Language p1 file location:", (wxWindow **)&Path_LangX1P1FileLocation);
Layout->Add(RecentText, 1, wxEXPAND);
Layout->Add(CheckBox_Recent, 1, wxEXPAND);
Layout->Add(Text_GenieVer, 1, wxEXPAND);
sizer1->Add(ComboBox_GenieVer);
#ifdef WIN32
sizer1->Add(Button_PathFromRegistry);
#endif
Layout->Add(sizer1, 1, wxEXPAND);
sizer2->Add(DriveText, 1, wxEXPAND);
sizer2->Add(DriveLetterBox, 0, wxRIGHT, 15);
Layout->Add(sizer2, 1, wxEXPAND);
Extras->Add(LanguageText);
Extras->Add(LanguageBox);
Layout->Add(Extras, 1, wxEXPAND);
Layout->AddSpacer(15);
Layout->AddSpacer(15);
Layout->Add(CheckBox_CustomDefault, 1, wxEXPAND);
Layout->Add(Path_CustomDefault, 1, wxEXPAND);
Layout->Add(Radio_DatFileLocation, 1, wxEXPAND);
Button_DefaultAoE->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultAoE, this);
Button_DefaultRoR->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultRoR, this);
Button_DefaultDE1->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultDE1, this);
Button_DefaultAoK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultAoK, this);
Button_DefaultTC->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultTC, this);
Button_DefaultAoKHD->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultAoKHD, this);
Button_DefaultAP->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultAoP, this);
Button_DefaultDE2->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultDE2, this);
Button_DefaultSWGB->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultSWGB, this);
Button_DefaultCC->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnDefaultCC, this);
CheckBox_Recent->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &OpenSaveDialog::OnRecent, this);
ButtonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &)
{
if (ComboBox_GenieVer->GetSelection() >= 0)
{
EndModal(wxID_OK);
}
else
{
wxMessageBox("Select genie version", "Notice");
}
});
#ifdef WIN32
Button_PathFromRegistry->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenSaveDialog::OnPathFromRegistry, this);
#endif
}
void OpenSaveDialog::OnRecent(wxCommandEvent &event)
{
if (RecentValues.empty()) return;
int sel = CheckBox_Recent->GetSelection();
ComboBox_GenieVer->SetSelection(lexical_cast<int>(RecentValues[sel][0]));
Path_DatFileLocation->SetPath(RecentValues[sel][1]);
Path_LangFileLocation->SetPath(RecentValues[sel][2]);
Path_LangX1FileLocation->SetPath(RecentValues[sel][3]);
Path_LangX1P1FileLocation->SetPath(RecentValues[sel][4]);
CheckBox_LangFileLocation->SetValue(RecentValues[sel][2].size());
CheckBox_LangX1FileLocation->SetValue(RecentValues[sel][3].size());
CheckBox_LangX1P1FileLocation->SetValue(RecentValues[sel][4].size());
}
void OpenSaveDialog::OnDefault(const wxString &part)
{
wxString custom = Path_CustomDefault->GetPath();
if (CheckBox_CustomDefault->GetValue() && custom.size() > 3)
{
game_path = custom;
}
else
{
game_path = DriveLetterBox->GetValue() + (wxIsPlatform64Bit() ? ":/Program Files (x86)" : ":/Program Files") + part;
}
}
void OpenSaveDialog::OnDefaultAoE(wxCommandEvent &event)
{
OnDefault("/Microsoft Games/Age of Empires");
ComboBox_GenieVer->SetSelection(EV_AoE);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/data/empires.dat");
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(wxEmptyString);
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(false);
CheckBox_LangX1P1FileLocation->SetValue(false);
CheckBox_LangWrite->Enable(true);
}
void OpenSaveDialog::OnDefaultRoR(wxCommandEvent &event)
{
OnDefault("/Microsoft Games/Age of Empires");
ComboBox_GenieVer->SetSelection(EV_RoR);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/data2/empires.dat");
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(game_path + "/languagex.dll");
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(true);
CheckBox_LangX1P1FileLocation->SetValue(false);
CheckBox_LangWrite->Enable(true);
}
void OpenSaveDialog::OnDefaultDE1(wxCommandEvent &event)
{
OnDefault("/Steam/steamapps/common/AoEDE");
wxString locale = LanguageBox->GetValue();
ComboBox_GenieVer->SetSelection(EV_Tapsa);
CheckBox_LangWrite->Enable(false);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/Data/empires.dat");
Path_LangFileLocation->SetPath(game_path + "/Data/Localization/" + locale + "/strings.txt");
Path_LangX1FileLocation->SetPath(wxEmptyString);
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(false);
CheckBox_LangX1P1FileLocation->SetValue(false);
}
void OpenSaveDialog::OnDefaultAoK(wxCommandEvent &event)
{
OnDefault("/Microsoft Games/Age of Empires II");
ComboBox_GenieVer->SetSelection(EV_AoK);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/data/empires2.dat");
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(wxEmptyString);
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(false);
CheckBox_LangX1P1FileLocation->SetValue(false);
CheckBox_LangWrite->Enable(true);
}
void OpenSaveDialog::OnDefaultTC(wxCommandEvent &event)
{
OnDefault("/Microsoft Games/Age of Empires II");
ComboBox_GenieVer->SetSelection(EV_TC);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/data/empires2_x1_p1.dat");
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(game_path + "/language_x1.dll");
Path_LangX1P1FileLocation->SetPath(game_path + "/language_x1_p1.dll");
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(true);
CheckBox_LangX1P1FileLocation->SetValue(true);
CheckBox_LangWrite->Enable(true);
}
void OpenSaveDialog::OnDefaultAoKHD(wxCommandEvent &event)
{
OnDefault("/Steam/steamapps/common/Age2HD");
wxString locale = LanguageBox->GetValue();
ComboBox_GenieVer->SetSelection(EV_TC);
CheckBox_LangWrite->Enable(false);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/resources/_common/dat/empires2_x1_p1.dat");
Path_LangFileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-strings-utf8.txt");
Path_LangX1FileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-modded-strings-utf8.txt");
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangX1P1FileLocation->SetValue(false);
}
void OpenSaveDialog::OnDefaultAoP(wxCommandEvent &event)
{
OnDefault("/Steam/steamapps/common/Age2HD");
wxString locale = LanguageBox->GetValue();
ComboBox_GenieVer->SetSelection(EV_Cysion);
CheckBox_LangWrite->Enable(false);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/resources/_common/dat/empires2_x2_p1.dat");
Path_LangFileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-strings-utf8.txt");
Path_LangX1FileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-modded-strings-utf8.txt");
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangX1P1FileLocation->SetValue(false);
}
void OpenSaveDialog::OnDefaultDE2(wxCommandEvent &event)
{
OnDefault("/Steam/steamapps/common/AoE2DE");
wxString locale = LanguageBox->GetValue();
ComboBox_GenieVer->SetSelection(EV_DE2);
CheckBox_LangWrite->Enable(false);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/resources/_common/dat/empires2_x2_p1.dat");
Path_LangFileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-strings-utf8.txt");
Path_LangX1FileLocation->SetPath(game_path + "/resources/" + locale + "/strings/key-value/key-value-modded-strings-utf8.txt");
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangX1P1FileLocation->SetValue(false);
}
void OpenSaveDialog::OnDefaultSWGB(wxCommandEvent &event)
{
OnDefault("/GOG Games/Star Wars - Galactic Battlegrounds");
ComboBox_GenieVer->SetSelection(EV_SWGB);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/Data/genie.dat");
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(wxEmptyString);
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(false);
CheckBox_LangX1P1FileLocation->SetValue(false);
CheckBox_LangWrite->Enable(true);
}
void OpenSaveDialog::OnDefaultCC(wxCommandEvent &event)
{
OnDefault("/GOG Games/Star Wars - Galactic Battlegrounds");
if (path_src == 2)
{
ComboBox_GenieVer->SetSelection(EV_EF2);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/Data/genie_x2.dat");
Path_LangX1P1FileLocation->SetPath(game_path + "/language_x2.dll");
CheckBox_LangX1P1FileLocation->SetValue(true);
}
else
{
ComboBox_GenieVer->SetSelection(EV_CC);
if (!ForceDat) Path_DatFileLocation->SetPath(game_path + "/Data/genie_x1.dat");
Path_LangX1P1FileLocation->SetPath(wxEmptyString);
CheckBox_LangX1P1FileLocation->SetValue(false);
}
Path_LangFileLocation->SetPath(game_path + "/language.dll");
Path_LangX1FileLocation->SetPath(game_path + "/language_x1.dll");
Radio_DatFileLocation->SetValue(true);
CheckBox_LangFileLocation->SetValue(true);
CheckBox_LangX1FileLocation->SetValue(true);
CheckBox_LangWrite->Enable(true);
}
#ifdef WIN32
void OpenSaveDialog::OnPathFromRegistry(wxCommandEvent &event)
{
bool customx = CheckBox_CustomDefault->GetValue();
wxString path, custom = Path_CustomDefault->GetPath();
CheckBox_CustomDefault->SetValue(true);
path_src = 1;
switch (ComboBox_GenieVer->GetSelection())
{
case EV_AoE:
{
wxRegKey key(wxRegKey::HKLM, "Software/Microsoft/Microsoft Games/Age of Empires/1.0");
if (key.Exists())
{
if (key.QueryValue("EXE Path", path))
{
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultAoE(event);
}
}
break;
}
case EV_RoR:
{
wxRegKey key(wxRegKey::HKLM, "Software/Microsoft/Microsoft Games/Age of Empires Expansion/1.0");
if (key.Exists())
{
if (key.QueryValue("EXE Path", path))
{
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultRoR(event);
}
}
break;
}
case EV_AoK:
{
wxRegKey key(wxRegKey::HKLM, "Software/Microsoft/Microsoft Games/Age of Empires/2.0");
if (key.Exists())
{
if (key.QueryValue("EXE Path", path))
{
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultAoK(event);
}
}
break;
}
case EV_TC:
case EV_UP:
case EV_TCV:
{
wxRegKey key(wxRegKey::HKLM, "Software/Microsoft/Microsoft Games/Age of Empires II: The Conquerors Expansion/1.0");
if (key.Exists())
{
if (key.QueryValue("EXE Path", path))
{
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultTC(event);
}
}
break;
}
case EV_SWGB:
{
wxRegKey key(wxRegKey::HKLM, "Software/LucasArts Entertainment Company LLC/Star Wars Galactic Battlegrounds/1.0");
if (key.Exists())
{
if (key.QueryValue("Game Path", path))
{
path.Truncate(path.size() - 1);
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultSWGB(event);
}
}
break;
}
case EV_CC:
{
wxRegKey key(wxRegKey::HKLM, "Software/LucasArts Entertainment Company LLC/Star Wars Galactic Battlegrounds: Clone Campaigns/1.0");
if (key.Exists())
{
if (key.QueryValue("Game Path", path))
{
path.Truncate(path.size() - 1);
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultCC(event);
}
}
break;
}
case EV_EF:
case EV_EF2:
{
wxRegKey key(wxRegKey::HKLM, "Software/LucasArts Entertainment Company LLC/Star Wars Galactic Battlegrounds: Clone Campaigns/1.0");
if (key.Exists())
{
path_src = 2;
if (key.QueryValue("Game Path", path))
{
path.Truncate(path.size() - 1);
DriveLetterBox->ChangeValue(path[0]);
Path_CustomDefault->SetPath(path);
OnDefaultCC(event);
}
}
break;
}
default: break;
}
CheckBox_CustomDefault->SetValue(customx);
Path_CustomDefault->SetPath(custom);
if (path.empty()) wxMessageBox("No registry entry found.", "Advanced Genie Editor");
}
#endif
PairedCheckBox::PairedCheckBox(wxWindow *parent, const wxString &label, wxWindow **pair)
: wxCheckBox(parent, wxID_ANY, label)
{
window_pair = pair;
}
void PairedCheckBox::DoSet3StateValue(wxCheckBoxState state)
{
wxCheckBox::DoSet3StateValue(state);
(*window_pair)->Enable(state != wxCHK_UNCHECKED);
}