@@ -17,12 +17,12 @@ pub fn main() !void {
17
17
};
18
18
defer zglfw .terminate ();
19
19
20
- const window = zglfw .Window .create (1600 , 1000 , "Legacy Mod Converter 1.0 for Pre-Release 5.2" , null ) catch {
20
+ const window = zglfw .Window .create (1000 , 300 , "Legacy Mod Converter 1.0 for Pre-Release 5.2" , null ) catch {
21
21
std .log .err ("Failed to create window." , .{});
22
22
return ;
23
23
};
24
24
defer window .destroy ();
25
- window .setSizeLimits (400 , 400 , -1 , -1 );
25
+ // window.setSizeLimits(600 , 400, -1, -1);
26
26
27
27
var gpa_state = std .heap .GeneralPurposeAllocator (.{}){};
28
28
defer _ = gpa_state .deinit ();
@@ -54,10 +54,25 @@ pub fn main() !void {
54
54
);
55
55
56
56
// Set the starting window position and size to custom values
57
- zgui .setNextWindowPos (.{ .x = 20.0 , .y = 20.0 , .cond = .first_use_ever });
58
- zgui .setNextWindowSize (.{ .w = -1.0 , .h = -1.0 , .cond = .first_use_ever });
59
-
60
- if (zgui .begin ("Button list" , .{})) {
57
+ zgui .setNextWindowPos (.{ .x = 0.0 , .y = 0.0 , .cond = .always });
58
+ // zgui.setNextWindowSize(.{ .w = -1.0, .h = -1.0, .cond = .always });
59
+
60
+ if (zgui .begin ("a" , .{ .flags = .{ .no_title_bar = true , .no_resize = true , .no_background = true } })) {
61
+ const static = struct {
62
+ var input_mod_path_buf : [std .fs .MAX_PATH_BYTES + 1 ]u8 = undefined ;
63
+ var output_mod_path_buf : [std .fs .MAX_PATH_BYTES + 1 ]u8 = undefined ;
64
+ var progress : f32 = 0.0 ;
65
+ };
66
+ // std.debug.print("xd: {d}\n", .{"I:/Programming/Cortex-Command-Community-Project-Source".len});
67
+ // zgui.pushItemWidth("I:/Programming/Cortex-Command-Community-Project-Source".len);
68
+ // zgui.setNextItemWidth("I:/Programming/Cortex-Command-Community-Project-Source".len);
69
+ if (zgui .inputTextWithHint ("Input/ directory path" , .{ .hint = "Copy-paste a path from File Explorer here" , .buf = static .input_mod_path_buf [0.. ] })) {
70
+ std .debug .print ("The user edited input_mod_path_buf\n " , .{});
71
+ }
72
+ // zgui.popItemWidth();
73
+ if (zgui .inputTextWithHint ("Mods/ directory path" , .{ .hint = "Copy-paste a path from File Explorer here" , .buf = static .output_mod_path_buf [0.. ] })) {
74
+ std .debug .print ("The user edited output_mod_path_buf\n " , .{});
75
+ }
61
76
if (zgui .button ("Convert" , .{ .w = 200.0 })) {
62
77
std .debug .print ("Converting...\n " , .{});
63
78
@@ -134,7 +149,16 @@ pub fn main() !void {
134
149
const output_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Community-Project-Data/Mods" , & output_mod_path_buffer );
135
150
136
151
try converter .zip_mods (input_mod_path , output_mod_path , allocator );
152
+
153
+ std .debug .print ("Done zipping!\n " , .{});
137
154
}
155
+
156
+ zgui .pushStyleColor4f (.{ .idx = .plot_histogram , .c = .{ 0.1 + 0.5 * (1 - static .progress ), 0.2 + 0.7 * static .progress , 0.3 , 1.0 } });
157
+ zgui .progressBar (.{ .fraction = static .progress , .overlay = "" });
158
+ zgui .popStyleColor (.{});
159
+
160
+ static .progress += 0.03 ;
161
+ if (static .progress > 2.0 ) static .progress = 0.0 ;
138
162
}
139
163
zgui .end ();
140
164
0 commit comments