forked from gildor2/UEViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsDialog.cpp
More file actions
108 lines (95 loc) · 2.79 KB
/
Copy pathSettingsDialog.cpp
File metadata and controls
108 lines (95 loc) · 2.79 KB
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
#include "BaseDialog.h"
#include "SettingsDialog.h"
#include "FileControls.h"
#if HAS_UI
UISettingsDialog::UISettingsDialog(CUmodelSettings& settings)
: Opt(settings)
, OptRef(&settings)
{}
bool UISettingsDialog::Show()
{
if (!ShowModal("Options", -1, -1))
return false;
*OptRef = Opt;
// Update export path (this call will handle relative and absolute paths)
OptRef->Export.Apply();
// Save settings
OptRef->Save();
return true;
}
void UISettingsDialog::InitUI()
{
guard(UISettingsDialog::InitUI);
(*this)
[
NewControl(UIGroup, GROUP_HORIZONTAL_LAYOUT|GROUP_NO_BORDER)
.SetWidth(EncodeWidth(1.0f))
[
//!! use pager for this (reqires TabControl)
/* NewControl(UIGroup, "Display")
+*/
NewControl(UIGroup, "Export")
.SetWidth(EncodeWidth(1.0f))
[
MakeExportOptions()
]
+ NewControl(UIGroup, "Save packages")
[
MakeSavePackagesOptions()
]
]
+ NewControl(UIGroup, GROUP_HORIZONTAL_LAYOUT|GROUP_NO_BORDER)
[
NewControl(UISpacer, -1)
+ NewControl(UIButton, "OK")
.SetWidth(EncodeWidth(0.2f))
.SetOK()
+ NewControl(UIButton, "Cancel")
.SetWidth(EncodeWidth(0.2f))
.SetCancel()
]
];
unguard;
}
UIElement& UISettingsDialog::MakeExportOptions()
{
return
NewControl(UIGroup, "File Layout")
[
NewControl(UILabel, "Export to this folder")
+ NewControl(UIFilePathEditor, &Opt.Export.ExportPath)
+ NewControl(UICheckbox, "Use object groups instead of types", &Opt.Export.SaveGroups)
+ NewControl(UICheckbox, "Use uncooked UE3 package names", &Opt.Export.SaveUncooked)
]
+ NewControl(UIGroup, "Mesh Export")
[
NewControl(UIGroup, GROUP_HORIZONTAL_LAYOUT|GROUP_NO_BORDER)
[
NewControl(UILabel, "Skeletal Mesh:").SetY(4).SetAutoSize()
+ NewControl(UICombobox, &Opt.Export.SkeletalMeshFormat)
.AddItem("ActorX (psk)", EExportMeshFormat::psk)
.AddItem("glTF 2.0", EExportMeshFormat::gltf)
.AddItem("md5mesh", EExportMeshFormat::md5)
+ NewControl(UISpacer)
+ NewControl(UILabel, "Static Mesh:").SetY(4).SetAutoSize()
+ NewControl(UICombobox, &Opt.Export.StaticMeshFormat)
.AddItem("ActorX (pskx)", EExportMeshFormat::psk)
.AddItem("glTF 2.0", EExportMeshFormat::gltf)
]
+ NewControl(UICheckbox, "Export LODs", &Opt.Export.ExportMeshLods)
]
+ NewControl(UICheckbox, "Export compressed textures to dds format", &Opt.Export.ExportDdsTexture)
+ NewControl(UICheckbox, "Don't overwrite already exported files", &Opt.Export.DontOverwriteFiles)
;
}
UIElement& UISettingsDialog::MakeSavePackagesOptions()
{
return NewControl(UIGroup, "File Layout")
[
NewControl(UILabel, "Save to this folder")
+ NewControl(UIFilePathEditor, &Opt.SavePackages.SavePath)
.SetWidth(250)
+ NewControl(UICheckbox, "Keep directory structure", &Opt.SavePackages.KeepDirectoryStructure)
];
}
#endif // HAS_UI