mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
fix crash when custom menu is disabled
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
This commit is contained in:
parent
82e703b6ad
commit
b69f810dd4
1 changed files with 10 additions and 8 deletions
|
@ -90,12 +90,14 @@ struct CustomMenuLayer : Modify<CustomMenuLayer, MenuLayer> {
|
|||
Notification::create("There were errors - see Geode page!", NotificationIcon::Error)->show();
|
||||
}
|
||||
|
||||
m_fields->m_exclamation = CCSprite::createWithSpriteFrameName("exMark_001.png");
|
||||
m_fields->m_exclamation->setPosition(m_fields->m_geodeButton->getContentSize() - ccp(10, 10));
|
||||
m_fields->m_exclamation->setID("errors-found");
|
||||
m_fields->m_exclamation->setZOrder(99);
|
||||
m_fields->m_exclamation->setScale(.6f);
|
||||
m_fields->m_geodeButton->addChild(m_fields->m_exclamation);
|
||||
if (m_fields->m_geodeButton) {
|
||||
m_fields->m_exclamation = CCSprite::createWithSpriteFrameName("exMark_001.png");
|
||||
m_fields->m_exclamation->setPosition(m_fields->m_geodeButton->getContentSize() - ccp(10, 10));
|
||||
m_fields->m_exclamation->setID("errors-found");
|
||||
m_fields->m_exclamation->setZOrder(99);
|
||||
m_fields->m_exclamation->setScale(.6f);
|
||||
m_fields->m_geodeButton->addChild(m_fields->m_exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
// show if the user tried to be naughty and load arbitrary DLLs
|
||||
|
@ -178,9 +180,9 @@ struct CustomMenuLayer : Modify<CustomMenuLayer, MenuLayer> {
|
|||
[this](server::ServerRequest<std::vector<std::string>>::Value* result) {
|
||||
if (result->isOk()) {
|
||||
auto updatesFound = result->unwrap();
|
||||
if (updatesFound.size() && !m_fields->m_geodeButton->getChildByID("updates-available")) {
|
||||
if (updatesFound.size() && m_fields->m_geodeButton && !m_fields->m_geodeButton->getChildByID("updates-available")) {
|
||||
log::info("Found updates for mods: {}!", updatesFound);
|
||||
|
||||
|
||||
if(auto icon = CCSprite::createWithSpriteFrameName("updates-available.png"_spr)) {
|
||||
// Remove errors icon if it was added, to prevent overlap
|
||||
if (m_fields->m_exclamation) {
|
||||
|
|
Loading…
Reference in a new issue