@@ -69,8 +69,8 @@ pub fn main() !void {
69
69
@memcpy (game_executable_path_mut [0.. settings .game_executable_path .len ], settings .game_executable_path );
70
70
game_executable_path_mut [settings .game_executable_path .len ] = 0 ;
71
71
72
- var err_msg_buf : [420420 ]u8 = undefined ;
73
- var err_msg_slice : []u8 = undefined ;
72
+ var popup_buf : [420420 ]u8 = undefined ;
73
+ var popup_slice : []u8 = undefined ;
74
74
75
75
while (! window .shouldClose ()) {
76
76
zglfw .pollEvents ();
@@ -129,54 +129,58 @@ pub fn main() !void {
129
129
// if (progress > 2.0) progress = 0.0;
130
130
131
131
std .debug .print ("Done converting!\n " , .{});
132
+
133
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "The converted mods have been put in {s}" , .{settings .output_folder_path });
134
+
135
+ zgui .openPopup ("popup" , .{});
132
136
} else | err | {
133
137
switch (err ) {
134
138
error .InvalidInputPath = > {
135
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Invalid input path" , .{});
139
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Invalid input path" , .{});
136
140
},
137
141
error .InvalidOutputPath = > {
138
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Invalid output path" , .{});
142
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Invalid output path" , .{});
139
143
},
140
144
error .FileNotFound = > {
141
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Please enter valid input and output paths" , .{});
145
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Please enter valid input and output paths" , .{});
142
146
},
143
147
error .UnexpectedToken = > {
144
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Unexpected token '{s}' in file {s} on line {} and column {}" , .{
148
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Unexpected token '{s}' in file {s} on line {} and column {}" , .{
145
149
diagnostics .token orelse "null" ,
146
150
diagnostics .file_path orelse "null" ,
147
151
diagnostics .line orelse -1 ,
148
152
diagnostics .column orelse -1 ,
149
153
});
150
154
},
151
155
error .UnclosedMultiComment = > {
152
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Unclosed multi-line comment in file {s}" , .{
156
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Unclosed multi-line comment in file {s}" , .{
153
157
diagnostics .file_path orelse "null" ,
154
158
});
155
159
},
156
160
error .TooManyTabs = > {
157
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Too many tabs in file {s} on line {} and column {}" , .{
161
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Too many tabs in file {s} on line {} and column {}" , .{
158
162
diagnostics .file_path orelse "null" ,
159
163
diagnostics .line orelse -1 ,
160
164
diagnostics .column orelse -1 ,
161
165
});
162
166
},
163
167
error .ExpectedADataModule = > {
164
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Expected a DataModule" , .{});
168
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Expected a DataModule" , .{});
165
169
},
166
170
error .ContainsMoreThanOneDataModule = > {
167
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: The mod contains more than one DataModule" , .{});
171
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: The mod contains more than one DataModule" , .{});
168
172
},
169
173
else = > | _ | {
170
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "{?}" , .{@errorReturnTrace ()});
174
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "{?}" , .{@errorReturnTrace ()});
171
175
},
172
176
}
173
177
174
- std .debug .print ("{s}\n " , .{err_msg_slice });
175
- zgui .openPopup ("error_popup " , .{});
178
+ std .debug .print ("{s}\n " , .{popup_slice });
179
+ zgui .openPopup ("popup " , .{});
176
180
}
177
181
}
178
- if (zgui .beginPopup ("error_popup " , .{})) {
179
- zgui .text ("{s}\n " , .{err_msg_slice });
182
+ if (zgui .beginPopup ("popup " , .{})) {
183
+ zgui .text ("{s}\n " , .{popup_slice });
180
184
zgui .endPopup ();
181
185
}
182
186
@@ -193,19 +197,19 @@ pub fn main() !void {
193
197
var argv = [_ ][]const u8 {settings .game_executable_path };
194
198
_ = std .ChildProcess .exec (.{ .argv = & argv , .allocator = gpa }) catch | err | switch (err ) {
195
199
error .FileNotFound = > {
196
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Please enter the game executable path" , .{});
197
- zgui .openPopup ("error_popup " , .{});
200
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Please enter the game executable path" , .{});
201
+ zgui .openPopup ("popup " , .{});
198
202
},
199
203
else = > | e | return e ,
200
204
};
201
205
} else | err | switch (err ) {
202
206
error .BadPathName = > {
203
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Please enter the game executable path" , .{});
204
- zgui .openPopup ("error_popup " , .{});
207
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Please enter the game executable path" , .{});
208
+ zgui .openPopup ("popup " , .{});
205
209
},
206
210
error .FileNotFound = > {
207
- err_msg_slice = try std .fmt .bufPrint (& err_msg_buf , "Error: Please enter the game executable path" , .{});
208
- zgui .openPopup ("error_popup " , .{});
211
+ popup_slice = try std .fmt .bufPrint (& popup_buf , "Error: Please enter the game executable path" , .{});
212
+ zgui .openPopup ("popup " , .{});
209
213
},
210
214
else = > | e | return e ,
211
215
}
0 commit comments