Skip to content

Commit

Permalink
change to using std::function
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Nov 4, 2024
1 parent 89bb25e commit acce089
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.8.1",
"geode": "3.9.0",
"version": "v1.3.12",
"gd": {
"win": "2.206",
Expand Down
6 changes: 3 additions & 3 deletions src/MoreLeaderboards/MoreLeaderboards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,11 @@ void MoreLeaderboards::handle_request_mods(std::string const& data) {
}

void MoreLeaderboards::startLoadingMods() {
const geode::utils::MiniFunction<void(std::string const&)> then = [this](std::string const& data) {
const std::function<void(std::string const&)> then = [this](std::string const& data) {
handle_request_mods(data);
fadeLoadingCircle();
};
const geode::utils::MiniFunction<void(std::string const&)> expect = [this](std::string const& error) {
const std::function<void(std::string const&)> expect = [this](std::string const& error) {
fadeLoadingCircle();
};

Expand Down Expand Up @@ -1319,4 +1319,4 @@ class $modify(LeaderboardsLayer) {

return true;
}
};
};
4 changes: 2 additions & 2 deletions src/Styles/NewProfilePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class $modify(ProfilePage) {
};

void requestGDUtilsBadges(int accountID, CCLayer* layer) {
const geode::utils::MiniFunction<void(std::string const&)> then = [this, accountID, layer](std::string const& result) {
const std::function<void(std::string const&)> then = [this, accountID, layer](std::string const& result) {
std::vector<std::string> data_user = MoreLeaderboards::getWords(result, "|");

while (data_user.size() > 0) {
Expand Down Expand Up @@ -423,7 +423,7 @@ class $modify(ProfilePage) {
data_user.erase(data_user.begin());
}
};
const geode::utils::MiniFunction<void(std::string const&)> expect = [this](std::string const& error) {
const std::function<void(std::string const&)> expect = [this](std::string const& error) {
log::error("Failed to get GDUtils badges: {}", error);
};

Expand Down
4 changes: 2 additions & 2 deletions src/Utils/DemonList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class $modify(LevelInfoLayer) {
loading_circle->setParentLayer(this);
loading_circle->show();

const geode::utils::MiniFunction<void(Result<matjson::Value>)> then = [this, level, levelID, loading_circle, positionLabel, demonSpr, winSize](Result<matjson::Value> const& result_json) {
const std::function<void(Result<matjson::Value>)> then = [this, level, levelID, loading_circle, positionLabel, demonSpr, winSize](Result<matjson::Value> const& result_json) {
matjson::Value json = result_json.value();

std::string listId = Mod::get()->template getSettingValue<std::string>("demonListSelection");
Expand Down Expand Up @@ -144,7 +144,7 @@ class $modify(LevelInfoLayer) {
}
}
};
const geode::utils::MiniFunction<void(std::string const&)> expect = [this, loading_circle](std::string const& error) {
const std::function<void(std::string const&)> expect = [this, loading_circle](std::string const& error) {
if (loading_circle != nullptr) {
loading_circle->fadeAndRemove();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ void DownloadManager::setup() {

// def not copied from geode hahahaha

const geode::utils::MiniFunction<void(geode::ByteVector const&)> then = [this](geode::ByteVector const& data) {
const std::function<void(geode::ByteVector const&)> 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<void(int const&)> expect = [this](int const& error) {
const std::function<void(int const&)> expect = [this](int const& error) {
FLAlertLayer::create(nullptr, "Error!", "An error occured while trying to send a request to the servers. Check <cy>logs</c> for more information.", "OK", nullptr, 200.0F)->show();
log::error("Error downloading: {}", error);
};
Expand Down

0 comments on commit acce089

Please sign in to comment.