Configuration/Application: disable armoury.

This commit is contained in:
Guillaume Jacquemin 2024-07-22 11:15:39 +02:00
parent 40f2d88433
commit 205c502c54
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
3 changed files with 38 additions and 38 deletions

View file

@ -335,17 +335,17 @@ Application::drawCustomStyle(GameObjects::CustomStyle& style) {
style.name = name_buf.data();
}
if(ImGui::SmallButton(ICON_FA_FILE_EXPORT " Export")) {
if(!ImportExport::exportStyle(_currentMass->name(), style)) {
_queue.addToast(Toast::Type::Error, ImportExport::lastExportError());
}
else {
_queue.addToast(Toast::Type::Success, "Style exported successfully.");
}
}
if(drawUnsafeWidget(ImGui::SmallButton, ICON_FA_FILE_IMPORT " Import")) {
// TODO: implement once the style manager is ready.
}
//if(ImGui::SmallButton(ICON_FA_FILE_EXPORT " Export")) {
// if(!ImportExport::exportStyle(_currentMass->name(), style)) {
// _queue.addToast(Toast::Type::Error, ImportExport::lastExportError());
// }
// else {
// _queue.addToast(Toast::Type::Success, "Style exported successfully.");
// }
//}
//if(drawUnsafeWidget(ImGui::SmallButton, ICON_FA_FILE_IMPORT " Import")) {
// // TODO: implement once the style manager is ready.
//}
ImGui::EndMenuBar();
}

View file

@ -66,7 +66,7 @@ Application::drawMainMenu() {
openUri(Utility::Path::toNativeSeparators(conf().directories().staging));
}
if(ImGui::BeginMenu(ICON_FA_BOXES " Armoury")) {
/*if(ImGui::BeginMenu(ICON_FA_BOXES " Armoury")) {
if(ImGui::MenuItem(ICON_FA_SHIELD_ALT " Armour parts", nullptr, false,
Utility::Path::exists(conf().directories().armours)))
{
@ -86,7 +86,7 @@ Application::drawMainMenu() {
}
ImGui::EndMenu();
}
}*/
ImGui::EndMenu();
}

View file

@ -119,10 +119,10 @@ Configuration::Configuration() {
Containers::String executable_location = Utility::Path::split(*Utility::Path::executableLocation()).first();
_directories.backups = Utility::Path::join(executable_location, "backups");
_directories.staging = Utility::Path::join(executable_location, "staging");
auto armoury_dir = Utility::Path::join(executable_location, "armoury");
_directories.armours = Utility::Path::join(armoury_dir, "armours");
_directories.weapons = Utility::Path::join(armoury_dir, "weapons");
_directories.styles = Utility::Path::join(armoury_dir, "styles");
//auto armoury_dir = Utility::Path::join(executable_location, "armoury");
//_directories.armours = Utility::Path::join(armoury_dir, "armours");
//_directories.weapons = Utility::Path::join(armoury_dir, "weapons");
//_directories.styles = Utility::Path::join(armoury_dir, "styles");
_directories.temp = Utility::Path::join(executable_location, "temp");
if(!Utility::Path::exists(_directories.backups)) {
@ -139,27 +139,27 @@ Configuration::Configuration() {
return;
}
}
if(!Utility::Path::exists(_directories.armours)) {
LOG_WARNING("Armours directory not found, creating...");
if(!Utility::Path::make(_directories.armours)) {
LOG_ERROR(_lastError = "Couldn't create the armours directory.");
return;
}
}
if(!Utility::Path::exists(_directories.weapons)) {
LOG_WARNING("Weapons directory not found, creating...");
if(!Utility::Path::make(_directories.weapons)) {
LOG_ERROR(_lastError = "Couldn't create the weapons directory.");
return;
}
}
if(!Utility::Path::exists(_directories.styles)) {
LOG_WARNING("Styles directory not found, creating...");
if(!Utility::Path::make(_directories.styles)) {
LOG_ERROR(_lastError = "Couldn't create the styles directory.");
return;
}
}
//if(!Utility::Path::exists(_directories.armours)) {
// LOG_WARNING("Armours directory not found, creating...");
// if(!Utility::Path::make(_directories.armours)) {
// LOG_ERROR(_lastError = "Couldn't create the armours directory.");
// return;
// }
//}
//if(!Utility::Path::exists(_directories.weapons)) {
// LOG_WARNING("Weapons directory not found, creating...");
// if(!Utility::Path::make(_directories.weapons)) {
// LOG_ERROR(_lastError = "Couldn't create the weapons directory.");
// return;
// }
//}
//if(!Utility::Path::exists(_directories.styles)) {
// LOG_WARNING("Styles directory not found, creating...");
// if(!Utility::Path::make(_directories.styles)) {
// LOG_ERROR(_lastError = "Couldn't create the styles directory.");
// return;
// }
//}
if(!Utility::Path::exists(_directories.temp)) {
LOG_WARNING("Temporary directory not found, creating...");