From acce0890213498e435f71b9caba7bb72368b72a9 Mon Sep 17 00:00:00 2001 From: FireMario211 <17692105+FireMario211@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:30:12 -0500 Subject: [PATCH] change to using std::function --- mod.json | 2 +- src/MoreLeaderboards/MoreLeaderboards.cpp | 6 +++--- src/Styles/NewProfilePage.cpp | 4 ++-- src/Utils/DemonList.cpp | 4 ++-- src/Utils/DownloadManager.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mod.json b/mod.json index d16fefb..4c7887a 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.8.1", + "geode": "3.9.0", "version": "v1.3.12", "gd": { "win": "2.206", diff --git a/src/MoreLeaderboards/MoreLeaderboards.cpp b/src/MoreLeaderboards/MoreLeaderboards.cpp index 84c2743..0ed30e7 100644 --- a/src/MoreLeaderboards/MoreLeaderboards.cpp +++ b/src/MoreLeaderboards/MoreLeaderboards.cpp @@ -419,11 +419,11 @@ void MoreLeaderboards::handle_request_mods(std::string const& data) { } void MoreLeaderboards::startLoadingMods() { - const geode::utils::MiniFunction then = [this](std::string const& data) { + const std::function then = [this](std::string const& data) { handle_request_mods(data); fadeLoadingCircle(); }; - const geode::utils::MiniFunction expect = [this](std::string const& error) { + const std::function expect = [this](std::string const& error) { fadeLoadingCircle(); }; @@ -1319,4 +1319,4 @@ class $modify(LeaderboardsLayer) { return true; } -}; \ No newline at end of file +}; diff --git a/src/Styles/NewProfilePage.cpp b/src/Styles/NewProfilePage.cpp index db9d11f..0674bf0 100644 --- a/src/Styles/NewProfilePage.cpp +++ b/src/Styles/NewProfilePage.cpp @@ -265,7 +265,7 @@ class $modify(ProfilePage) { }; void requestGDUtilsBadges(int accountID, CCLayer* layer) { - const geode::utils::MiniFunction then = [this, accountID, layer](std::string const& result) { + const std::function then = [this, accountID, layer](std::string const& result) { std::vector data_user = MoreLeaderboards::getWords(result, "|"); while (data_user.size() > 0) { @@ -423,7 +423,7 @@ class $modify(ProfilePage) { data_user.erase(data_user.begin()); } }; - const geode::utils::MiniFunction expect = [this](std::string const& error) { + const std::function expect = [this](std::string const& error) { log::error("Failed to get GDUtils badges: {}", error); }; diff --git a/src/Utils/DemonList.cpp b/src/Utils/DemonList.cpp index 5c1087b..cdd0ce5 100644 --- a/src/Utils/DemonList.cpp +++ b/src/Utils/DemonList.cpp @@ -101,7 +101,7 @@ class $modify(LevelInfoLayer) { loading_circle->setParentLayer(this); loading_circle->show(); - const geode::utils::MiniFunction)> then = [this, level, levelID, loading_circle, positionLabel, demonSpr, winSize](Result const& result_json) { + const std::function)> then = [this, level, levelID, loading_circle, positionLabel, demonSpr, winSize](Result const& result_json) { matjson::Value json = result_json.value(); std::string listId = Mod::get()->template getSettingValue("demonListSelection"); @@ -144,7 +144,7 @@ class $modify(LevelInfoLayer) { } } }; - const geode::utils::MiniFunction expect = [this, loading_circle](std::string const& error) { + const std::function expect = [this, loading_circle](std::string const& error) { if (loading_circle != nullptr) { loading_circle->fadeAndRemove(); } diff --git a/src/Utils/DownloadManager.cpp b/src/Utils/DownloadManager.cpp index f6e94b5..282b8aa 100644 --- a/src/Utils/DownloadManager.cpp +++ b/src/Utils/DownloadManager.cpp @@ -79,14 +79,14 @@ void DownloadManager::setup() { // def not copied from geode hahahaha - const geode::utils::MiniFunction then = [this](geode::ByteVector const& data) { + const std::function then = [this](geode::ByteVector const& data) { // Save the file geode::utils::file::writeBinary(this->m_sDestination, data); ProcessLambdas::callMenuHandler(this, this->m_pSelector); this->onClose(CCNode::create()); }; - const geode::utils::MiniFunction expect = [this](int const& error) { + const std::function expect = [this](int const& error) { FLAlertLayer::create(nullptr, "Error!", "An error occured while trying to send a request to the servers. Check logs for more information.", "OK", nullptr, 200.0F)->show(); log::error("Error downloading: {}", error); };