mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
Fix geode checkbox and installed mods not showing restart
This commit is contained in:
parent
e557a551d8
commit
b21ff6e234
3 changed files with 14 additions and 2 deletions
|
@ -132,12 +132,14 @@ namespace geode {
|
|||
void setAvailablePlatforms(std::unordered_set<PlatformID> const& value);
|
||||
void setIsFeatured(bool const& value);
|
||||
void setTags(std::unordered_set<std::string> const& value);
|
||||
void setIsInstalled(bool const& value);
|
||||
#endif
|
||||
|
||||
IndexItem();
|
||||
~IndexItem();
|
||||
|
||||
friend class ModMetadata;
|
||||
friend class Index;
|
||||
};
|
||||
using IndexItemHandle = std::shared_ptr<IndexItem>;
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ private:
|
|||
std::string m_downloadURL;
|
||||
std::string m_downloadHash;
|
||||
std::unordered_set<PlatformID> m_platforms;
|
||||
bool m_isFeatured;
|
||||
bool m_isFeatured = false;
|
||||
bool m_isInstalled = false;
|
||||
std::unordered_set<std::string> m_tags;
|
||||
|
||||
friend class IndexItem;
|
||||
|
@ -137,6 +138,10 @@ void IndexItem::setIsFeatured(bool const& value) {
|
|||
void IndexItem::setTags(std::unordered_set<std::string> const& value) {
|
||||
m_impl->m_tags = value;
|
||||
}
|
||||
|
||||
void IndexItem::setIsInstalled(bool const& value) {
|
||||
m_impl->m_isInstalled = value;
|
||||
}
|
||||
#endif
|
||||
|
||||
Result<IndexItemHandle> IndexItem::Impl::create(ghc::filesystem::path const& rootDir, ghc::filesystem::path const& dir) {
|
||||
|
@ -183,6 +188,9 @@ Result<IndexItemHandle> IndexItem::Impl::create(ghc::filesystem::path const& roo
|
|||
}
|
||||
|
||||
bool IndexItem::Impl::isInstalled() const {
|
||||
if (m_isInstalled) {
|
||||
return true;
|
||||
}
|
||||
if (!Loader::get()->isModInstalled(m_metadata.getID())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -751,6 +759,8 @@ void Index::Impl::installNext(size_t index, IndexInstallList const& list) {
|
|||
));
|
||||
}
|
||||
|
||||
item->setIsInstalled(true);
|
||||
|
||||
// Install next item in queue
|
||||
this->installNext(index + 1, list);
|
||||
})
|
||||
|
|
|
@ -314,7 +314,7 @@ bool ModCell::init(
|
|||
}
|
||||
}
|
||||
|
||||
if (m_mod->wasSuccessfullyLoaded()) {
|
||||
if (m_mod->wasSuccessfullyLoaded() && m_mod->getMetadata().getID() != "geode.loader") {
|
||||
m_enableToggle =
|
||||
CCMenuItemToggler::createWithStandardSprites(this, menu_selector(ModCell::onEnable), .7f);
|
||||
m_enableToggle->setPosition(-45.f, 0.f);
|
||||
|
|
Loading…
Reference in a new issue