Skip to content

Commit c3268a2

Browse files
committed
Added export errors
1 parent 7e8405f commit c3268a2

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

ManyPacker/GUI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ namespace ManyPacker
8080

8181
if (ManyPacker::Assets::exportStatus == 0)
8282
{
83-
ImGui::OpenPopup("No Assets Selected!");
84-
ManyPacker::Assets::exportStatus = -1;
83+
ImGui::OpenPopup("No Assets Selected!");
84+
ManyPacker::Assets::exportStatus = -1;
8585
}
8686
else if (ManyPacker::Assets::exportStatus == 1)
8787
{
@@ -91,7 +91,7 @@ namespace ManyPacker
9191
else if (ManyPacker::Assets::exportStatus == 2)
9292
{
9393
ImGui::OpenPopup("Error!");
94-
ManyPacker::Assets::exportStatus = -1;
94+
ManyPacker::Assets::exportStatus = -1;
9595
}
9696

9797
Components::AboutWindow();
@@ -379,7 +379,7 @@ namespace ManyPacker
379379

380380
if (ImGui::BeginPopupModal("Error!", NULL, ImGuiWindowFlags_AlwaysAutoResize))
381381
{
382-
ImGui::Text("An error occurred during export.");
382+
ImGui::Text(("An error occurred during export.\n" + ManyPacker::Assets::exportErrorMessage).c_str());
383383

384384
if (ImGui::Button("OK", ImVec2(120, 0)))
385385
ImGui::CloseCurrentPopup();

ManyPacker/assets.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace ManyPacker
2121
std::vector<std::string> Images;
2222

2323
int exportStatus = -1;
24+
std::string exportErrorMessage = "";
2425

2526
void ProcessAllAssets()
2627
{
@@ -155,6 +156,7 @@ namespace ManyPacker
155156
{
156157
std::cout << "Error: Missing file " << soundAliasPath << '\n';
157158
exportStatus = 2;
159+
exportErrorMessage = "Missing soundalias file: " + soundAliasPath.string();
158160
CleanUpAssets();
159161
return;
160162
}
@@ -168,6 +170,7 @@ namespace ManyPacker
168170
{
169171
std::cout << "Error: Missing file " << soundFilePath << '\n';
170172
exportStatus = 2;
173+
exportErrorMessage = "Missing sound file: " + soundFilePath.string();
171174
CleanUpAssets();
172175
return;
173176
}
@@ -195,6 +198,7 @@ namespace ManyPacker
195198
{
196199
std::cout << "Error: Missing file " << xanimPath << '\n';
197200
exportStatus = 2;
201+
exportErrorMessage = "Missing xanim file: " + xanimPath.string();
198202
CleanUpAssets();
199203
return;
200204
}
@@ -218,6 +222,7 @@ namespace ManyPacker
218222
{
219223
std::cout << "Error: Missing file " << xmodelPath << '\n';
220224
exportStatus = 2;
225+
exportErrorMessage = "Missing xmodel file: " + xmodelPath.string();
221226
CleanUpAssets();
222227
return;
223228
}
@@ -226,6 +231,7 @@ namespace ManyPacker
226231
{
227232
std::cout << "Error: Missing file " << partPath << '\n';
228233
exportStatus = 2;
234+
exportErrorMessage = "Missing xmodelparts file: " + partPath.string();
229235
CleanUpAssets();
230236
return;
231237
}
@@ -241,6 +247,7 @@ namespace ManyPacker
241247
{
242248
std::cout << "Error: Missing file " << surfPath << '\n';
243249
exportStatus = 2;
250+
exportErrorMessage = "Missing xmodelsurfs file: " + surfPath.string();
244251
CleanUpAssets();
245252
return;
246253
}
@@ -264,13 +271,15 @@ namespace ManyPacker
264271
{
265272
std::cout << "Error: Missing file " << matPath << '\n';
266273
exportStatus = 2;
274+
exportErrorMessage = "Missing material file: " + matPath.string();
267275
CleanUpAssets();
268276
return;
269277
}
270278
if (!std::filesystem::exists(propPath))
271279
{
272280
std::cout << "Error: Missing file " << propPath << '\n';
273281
exportStatus = 2;
282+
exportErrorMessage = "Missing material properties file: " + propPath.string();
274283
CleanUpAssets();
275284
return;
276285
}
@@ -294,6 +303,7 @@ namespace ManyPacker
294303
{
295304
std::cout << "Error: Missing file " << imagePath << '\n';
296305
exportStatus = 2;
306+
exportErrorMessage = "Missing image file: " + imagePath.string();
297307
CleanUpAssets();
298308
return;
299309
}
@@ -314,6 +324,7 @@ namespace ManyPacker
314324
{
315325
std::cout << "Error: Missing file " << weaponPath << '\n';
316326
exportStatus = 2;
327+
exportErrorMessage = "Missing weapon file: " + weaponPath.string();
317328
CleanUpAssets();
318329
return;
319330
}

ManyPacker/assets.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace ManyPacker
1515
extern std::vector<std::string> Images;
1616

1717
extern int exportStatus;
18+
extern std::string exportErrorMessage;
1819

1920
void ProcessAllAssets();
2021
void CleanUpAssets();

0 commit comments

Comments
 (0)