content-pack id validation + refactor

This commit is contained in:
MihailRis
2024-01-25 03:40:08 +03:00
parent ba4338c4fa
commit b7fbb8621a
10 changed files with 111 additions and 53 deletions
+7
View File
@@ -302,6 +302,13 @@ void create_new_world_panel(Engine* engine, PagesControl* menu) {
try {
engine->loadAllPacks();
engine->loadContent();
} catch (const contentpack_error& error) {
guiutil::alert(engine->getGUI(),
langs::get(L"Content Error", L"menu")+
L":\n"+util::str2wstr_utf8(std::string(error.what())+
"\npack '"+error.getPackId()+"' from "+
error.getFolder().u8string()));
return;
} catch (const std::runtime_error& error) {
guiutil::alert(engine->getGUI(),
langs::get(L"Content Error", L"menu")+