fix resource paths not being updated on switch to fullscreen

This commit is contained in:
HJfod 2023-01-23 22:24:38 +02:00
parent 9be7bea66f
commit db32b910ea
2 changed files with 24 additions and 19 deletions

View file

@ -13,10 +13,13 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
CustomLoadingLayer() : m_updatingResources(false) {} CustomLoadingLayer() : m_updatingResources(false) {}
bool init(bool fromReload) { bool init(bool fromReload) {
if (!fromReload) {
Loader::get()->waitForModsToBeLoaded(); Loader::get()->waitForModsToBeLoaded();
}
if (!LoadingLayer::init(fromReload)) return false; if (!LoadingLayer::init(fromReload)) return false;
if (!fromReload) {
auto winSize = CCDirector::sharedDirector()->getWinSize(); auto winSize = CCDirector::sharedDirector()->getWinSize();
auto count = Loader::get()->getAllMods().size(); auto count = Loader::get()->getAllMods().size();
@ -40,6 +43,7 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
m_fields->m_updatingResources = true; m_fields->m_updatingResources = true;
this->setUpdateText("Downloading Resources"); this->setUpdateText("Downloading Resources");
} }
}
return true; return true;
} }

View file

@ -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();
} }
} }