diff --git a/loader/include/Geode/loader/Index.hpp b/loader/include/Geode/loader/Index.hpp index e24654b2..b01228c2 100644 --- a/loader/include/Geode/loader/Index.hpp +++ b/loader/include/Geode/loader/Index.hpp @@ -9,8 +9,8 @@ namespace geode { using UpdateFinished = std::monostate; using UpdateProgress = std::pair; - using UpdateError = std::string; - using UpdateStatus = std::variant; + using UpdateFailed = std::string; + using UpdateStatus = std::variant; struct GEODE_DLL ModInstallEvent : public Event { const std::string modID; diff --git a/loader/src/hooks/LoadingLayer.cpp b/loader/src/hooks/LoadingLayer.cpp index e37d749b..32864c74 100644 --- a/loader/src/hooks/LoadingLayer.cpp +++ b/loader/src/hooks/LoadingLayer.cpp @@ -59,7 +59,7 @@ struct CustomLoadingLayer : Modify { m_fields->m_updatingResources = false; this->loadAssets(); }, - [&](UpdateError const& error) { + [&](UpdateFailed const& error) { InternalLoader::platformMessageBox( "Error updating resources", "Unable to update Geode resources: " + diff --git a/loader/src/hooks/MenuLayer.cpp b/loader/src/hooks/MenuLayer.cpp index 8f18baf8..e0b37acb 100644 --- a/loader/src/hooks/MenuLayer.cpp +++ b/loader/src/hooks/MenuLayer.cpp @@ -32,7 +32,7 @@ $execute { INDEX_UPDATE_NOTIF->waitAndHide(); INDEX_UPDATE_NOTIF = nullptr; }, - [](UpdateError const& info) { + [](UpdateFailed const& info) { INDEX_UPDATE_NOTIF->setIcon(NotificationIcon::Error); INDEX_UPDATE_NOTIF->setString(info); INDEX_UPDATE_NOTIF->setTime(NOTIFICATION_LONG_TIME); @@ -135,7 +135,7 @@ struct CustomMenuLayer : Modify { void onIndexUpdate(IndexUpdateEvent* event) { if ( std::holds_alternative(event->status) || - std::holds_alternative(event->status) + std::holds_alternative(event->status) ) { this->addUpdateIndicator(); } diff --git a/loader/src/internal/InternalLoader.cpp b/loader/src/internal/InternalLoader.cpp index 1353eb27..dbf136cf 100644 --- a/loader/src/internal/InternalLoader.cpp +++ b/loader/src/internal/InternalLoader.cpp @@ -147,14 +147,14 @@ void InternalLoader::downloadLoaderResources() { auto unzip = file::Unzip::intoDir(tempResourcesZip, resourcesDir, true); if (!unzip) { return ResourceDownloadEvent( - UpdateError("Unable to unzip new resources: " + unzip.unwrapErr()) + UpdateFailed("Unable to unzip new resources: " + unzip.unwrapErr()) ).post(); } ResourceDownloadEvent(UpdateFinished()).post(); }) .expect([](std::string const& info) { ResourceDownloadEvent( - UpdateError("Unable to download resources: " + info) + UpdateFailed("Unable to download resources: " + info) ).post(); }) .progress([](auto&, double now, double total) { diff --git a/loader/src/loader/Index.cpp b/loader/src/loader/Index.cpp index 67dc2159..309fa872 100644 --- a/loader/src/loader/Index.cpp +++ b/loader/src/loader/Index.cpp @@ -202,7 +202,7 @@ void Index::onSourceUpdate(SourceUpdateEvent* event) { break; } // otherwise, if some source failed, then post failed - else if (std::holds_alternative(status)) { + else if (std::holds_alternative(status)) { if (whatToPost != Progress) { whatToPost = Failed; } @@ -239,14 +239,14 @@ void Index::onSourceUpdate(SourceUpdateEvent* event) { case Failed: { std::string info = ""; for (auto& [src, status] : m_sourceStatuses) { - if (std::holds_alternative(status)) { - info += src + ": " + std::get(status) + "\n"; + if (std::holds_alternative(status)) { + info += src + ": " + std::get(status) + "\n"; } } // clear source statuses to allow updating index again m_sourceStatuses.clear(); // post finish event - IndexUpdateEvent(UpdateError(info)).post(); + IndexUpdateEvent(UpdateFailed(info)).post(); } break; } } @@ -286,7 +286,7 @@ void Index::checkSourceUpdates(IndexSourceImpl* src) { .expect([src](std::string const& err) { SourceUpdateEvent( src, - UpdateError(fmt::format("Error checking for updates: {}", err)) + UpdateFailed(fmt::format("Error checking for updates: {}", err)) ).post(); }); } @@ -310,7 +310,7 @@ void Index::downloadSource(IndexSourceImpl* src) { } catch(...) { return SourceUpdateEvent( - src, UpdateError("Unable to clear cached index") + src, UpdateFailed("Unable to clear cached index") ).post(); } @@ -319,7 +319,7 @@ void Index::downloadSource(IndexSourceImpl* src) { .expect("Unable to unzip new index"); if (!unzip) { return SourceUpdateEvent( - src, UpdateError(unzip.unwrapErr()) + src, UpdateFailed(unzip.unwrapErr()) ).post(); } @@ -331,7 +331,7 @@ void Index::downloadSource(IndexSourceImpl* src) { }) .expect([src](std::string const& err) { SourceUpdateEvent( - src, UpdateError(fmt::format("Error downloading: {}", err)) + src, UpdateFailed(fmt::format("Error downloading: {}", err)) ).post(); }) .progress([src](auto&, double now, double total) { diff --git a/loader/src/ui/internal/list/ModListLayer.cpp b/loader/src/ui/internal/list/ModListLayer.cpp index 4a0eefbb..589d0428 100644 --- a/loader/src/ui/internal/list/ModListLayer.cpp +++ b/loader/src/ui/internal/list/ModListLayer.cpp @@ -422,7 +422,7 @@ void ModListLayer::onIndexUpdate(IndexUpdateEvent* event) { [&](UpdateFinished const&) { this->reloadList(); }, - [&](UpdateError const& error) { + [&](UpdateFailed const& error) { this->reloadList(); } }, event->status);