mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
fix resource paths not being updated on switch to fullscreen
This commit is contained in:
parent
9be7bea66f
commit
db32b910ea
2 changed files with 24 additions and 19 deletions
|
@ -13,32 +13,36 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
|
||||||
CustomLoadingLayer() : m_updatingResources(false) {}
|
CustomLoadingLayer() : m_updatingResources(false) {}
|
||||||
|
|
||||||
bool init(bool fromReload) {
|
bool init(bool fromReload) {
|
||||||
Loader::get()->waitForModsToBeLoaded();
|
if (!fromReload) {
|
||||||
|
Loader::get()->waitForModsToBeLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
if (!LoadingLayer::init(fromReload)) return false;
|
if (!LoadingLayer::init(fromReload)) return false;
|
||||||
|
|
||||||
auto winSize = CCDirector::sharedDirector()->getWinSize();
|
if (!fromReload) {
|
||||||
|
auto winSize = CCDirector::sharedDirector()->getWinSize();
|
||||||
|
|
||||||
auto count = Loader::get()->getAllMods().size();
|
auto count = Loader::get()->getAllMods().size();
|
||||||
|
|
||||||
auto label = CCLabelBMFont::create(
|
auto label = CCLabelBMFont::create(
|
||||||
fmt::format("Geode: Loaded {} mods", count).c_str(),
|
fmt::format("Geode: Loaded {} mods", count).c_str(),
|
||||||
"goldFont.fnt"
|
"goldFont.fnt"
|
||||||
);
|
);
|
||||||
label->setPosition(winSize.width / 2, 30.f);
|
label->setPosition(winSize.width / 2, 30.f);
|
||||||
label->setScale(.45f);
|
label->setScale(.45f);
|
||||||
label->setID("geode-loaded-info");
|
label->setID("geode-loaded-info");
|
||||||
this->addChild(label);
|
this->addChild(label);
|
||||||
|
|
||||||
// fields have unpredictable destructors
|
// fields have unpredictable destructors
|
||||||
this->addChild(EventListenerNode<ResourceDownloadFilter>::create(
|
this->addChild(EventListenerNode<ResourceDownloadFilter>::create(
|
||||||
this, &CustomLoadingLayer::updateResourcesProgress
|
this, &CustomLoadingLayer::updateResourcesProgress
|
||||||
));
|
));
|
||||||
|
|
||||||
// verify loader resources
|
// verify loader resources
|
||||||
if (!LoaderImpl::get()->verifyLoaderResources()) {
|
if (!LoaderImpl::get()->verifyLoaderResources()) {
|
||||||
m_fields->m_updatingResources = true;
|
m_fields->m_updatingResources = true;
|
||||||
this->setUpdateText("Downloading Resources");
|
this->setUpdateText("Downloading Resources");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -9,6 +9,7 @@ struct ResourcesUpdate : Modify<ResourcesUpdate, LoadingLayer> {
|
||||||
LoadingLayer::loadAssets();
|
LoadingLayer::loadAssets();
|
||||||
// this is in case the user refreshes texture quality at runtime
|
// this is in case the user refreshes texture quality at runtime
|
||||||
if (m_loadStep == 10) {
|
if (m_loadStep == 10) {
|
||||||
|
CCFileUtils::get()->updatePaths();
|
||||||
Loader::get()->updateResources();
|
Loader::get()->updateResources();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue