@@ -10,6 +10,7 @@ const Settings = struct {
10
10
input_folder_path : []const u8 = "" ,
11
11
output_folder_path : []const u8 = "" ,
12
12
game_executable_path : []const u8 = "" ,
13
+ beautify_lua : bool = true ,
13
14
};
14
15
15
16
pub fn main () ! void {
@@ -19,7 +20,7 @@ pub fn main() !void {
19
20
};
20
21
defer zglfw .terminate ();
21
22
22
- const window = zglfw .Window .create (1600 , 300 , "Legacy Mod Converter v1.0 for CCCP v6.0.0 " , null ) catch {
23
+ const window = zglfw .Window .create (1600 , 300 , "Legacy Mod Converter v1.2 for CCCP release 6 " , null ) catch {
23
24
std .log .err ("Failed to create window." , .{});
24
25
return ;
25
26
};
@@ -101,6 +102,10 @@ pub fn main() !void {
101
102
try writeSettings (settings );
102
103
}
103
104
105
+ if (zgui .checkbox ("Beautify Lua" , .{ .v = & settings .beautify_lua })) {
106
+ try writeSettings (settings );
107
+ }
108
+
104
109
if (zgui .button ("Convert" , .{ .w = 200.0 })) {
105
110
std .debug .print ("Converting...\n " , .{});
106
111
@@ -115,7 +120,9 @@ pub fn main() !void {
115
120
allocator ,
116
121
& diagnostics ,
117
122
)) {
118
- try converter .beautifyLua (settings .output_folder_path , allocator );
123
+ if (settings .beautify_lua ) {
124
+ try converter .beautifyLua (settings .output_folder_path , allocator );
125
+ }
119
126
120
127
// TODO: Run .convert() in a separate thread, letting it update a passed Progress struct so we can update a progress bar here?
121
128
// TODO: Check if std/Progress.zig is of use: https://ziglang.org/documentation/master/std/src/std/Progress.zig.html
@@ -179,10 +186,6 @@ pub fn main() !void {
179
186
zgui .openPopup ("popup" , .{});
180
187
}
181
188
}
182
- if (zgui .beginPopup ("popup" , .{})) {
183
- zgui .text ("{s}\n " , .{popup_slice });
184
- zgui .endPopup ();
185
- }
186
189
187
190
zgui .setNextItemWidth (@max (zgui .calcTextSize (settings .game_executable_path , .{})[0 ] + padding , min_width ));
188
191
if (zgui .inputTextWithHint ("Game executable path" , .{ .hint = "Copy-paste a path from File Explorer here" , .buf = & game_executable_path_mut })) {
@@ -213,6 +216,11 @@ pub fn main() !void {
213
216
// try converter.zipMods(settings.input_folder_path, settings.output_folder_path, allocator);
214
217
// std.debug.print("Done zipping!\n", .{});
215
218
// }
219
+
220
+ if (zgui .beginPopup ("popup" , .{})) {
221
+ zgui .text ("{s}\n " , .{popup_slice });
222
+ zgui .endPopup ();
223
+ }
216
224
}
217
225
zgui .end ();
218
226
0 commit comments