Skip to content

Commit

Permalink
remove deprecated funcs from mod and fix wasSuccesfullyLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Dec 20, 2023
1 parent 6bc67e9 commit 151303c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
3 changes: 0 additions & 3 deletions loader/include/Geode/loader/Mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ namespace geode {
ghc::filesystem::path getPackagePath() const;
VersionInfo getVersion() const;
bool isEnabled() const;
[[deprecated("use isEnabled instead")]] bool isLoaded() const;
bool supportsDisabling() const;
[[deprecated("always true")]] bool canDisable() const;
[[deprecated("always true")]] bool canEnable() const;
bool needsEarlyLoad() const;
bool wasSuccessfullyLoaded() const;
ModMetadata getMetadata() const;
Expand Down
2 changes: 1 addition & 1 deletion loader/src/loader/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ void Index::Impl::installNext(size_t index, IndexInstallList const& list) {
.join("install_item_" + item->getMetadata().getID())
.fetch(item->getDownloadURL())
.into(tempFile)
.then([=](auto) {
.then([=, this](auto) {
// Check for 404
auto notFound = utils::file::readString(tempFile);
if (notFound && notFound.unwrap() == "Not Found") {
Expand Down
4 changes: 2 additions & 2 deletions loader/src/loader/LoaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) {
else {
std::thread([=]() {
auto res = unzipFunction();
queueInMainThread([=]() {
queueInMainThread([=, this]() {
if (!res) {
m_problems.push_back({
LoadProblem::Type::UnzipFailed,
Expand Down Expand Up @@ -812,7 +812,7 @@ void Loader::Impl::downloadLoaderResources(bool useLatestRelease) {
this->getVersion().toString()
), true);
})
.expect([=](std::string const& info, int code) {
.expect([=, this](std::string const& info, int code) {
if (code == 404) {
if (useLatestRelease) {
log::debug("Loader version {} does not exist on Github, downloading latest resources", this->getVersion().toString());
Expand Down
16 changes: 2 additions & 14 deletions loader/src/loader/Mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,16 @@ bool Mod::isEnabled() const {
return m_impl->isEnabled();
}

bool Mod::isLoaded() const {
return this->isEnabled();
}

bool Mod::supportsDisabling() const {
return m_impl->supportsDisabling();
}

bool Mod::canDisable() const {
return true;
}

bool Mod::canEnable() const {
return true;
}

bool Mod::needsEarlyLoad() const {
return m_impl->needsEarlyLoad();
}

bool Mod::wasSuccessfullyLoaded() const {
return m_impl->wasSuccessfullyLoaded();
return this->isEnabled();
}

ModMetadata Mod::getMetadata() const {
Expand Down Expand Up @@ -218,4 +206,4 @@ bool Mod::hasSavedValue(std::string const& key) {

bool Mod::shouldLoad() const {
return m_impl->shouldLoad();
}
}

0 comments on commit 151303c

Please sign in to comment.