Fixed an issue where the screen would go partly black during slide transitions.

This commit is contained in:
Leon Styhre 2021-01-01 22:37:21 +01:00
parent 287c6ea36e
commit c431e5a233
5 changed files with 18 additions and 12 deletions

View file

@ -85,7 +85,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
setNeedsReloading();
setNeedsCollectionsUpdate();
if (!mAddedCustomCollection)
setNeedsGoToSystemView(SystemData::sSystemVector.front());
setNeedsGoToSystem(SystemData::sSystemVector.front());
}
});
@ -139,7 +139,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
setNeedsReloading();
setNeedsCollectionsUpdate();
if (!mAddedCustomCollection)
setNeedsGoToSystemView(SystemData::sSystemVector.front());
setNeedsGoToSystem(SystemData::sSystemVector.front());
}
}
});
@ -259,7 +259,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
Settings::getInstance()->setString("CollectionSystemsCustom",
collectionsConfigEntry);
setNeedsSaving();
setNeedsGoToSystemView(SystemData::sSystemVector.front());
setNeedsGoToSystem(SystemData::sSystemVector.front());
}
CollectionSystemsManager::get()->deleteCustomCollection(name);
return true;
@ -322,7 +322,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
setNeedsSaving();
setNeedsCollectionsUpdate();
setNeedsReloading();
setNeedsGoToSystemView(SystemData::sSystemVector.front());
setNeedsGoToSystem(SystemData::sSystemVector.front());
}
});
@ -356,7 +356,7 @@ void GuiCollectionSystemsOptions::createCustomCollection(std::string inName)
collection_systems_custom->add(collectionName, collectionName, true);
mAddedCustomCollection = true;
setNeedsGoToSystemView(newCollection);
setNeedsGoToSystem(newCollection);
Window* window = mWindow;
while (window->peekGui() && window->peekGui() != ViewController::get())

View file

@ -30,7 +30,7 @@ GuiSettings::GuiSettings(
mNeedsSortingCollections(false),
mGoToSystem(nullptr),
mNeedsGoToStart(false),
mNeedsGoToSystemView(false)
mNeedsGoToSystem(false)
{
addChild(&mMenu);
mMenu.addButton("BACK", "back", [this] { delete this; });
@ -79,11 +79,11 @@ void GuiSettings::save()
if (mNeedsGoToStart)
ViewController::get()->goToStart();
if (mNeedsGoToSystemView)
ViewController::get()->goToSystemView(mGoToSystem, false);
if (mNeedsGoToSystem)
ViewController::get()->goToSystem(mGoToSystem, false);
if (mNeedsSaving || mNeedsCollectionsUpdate || mNeedsReloading || mNeedsSorting ||
mNeedsGoToStart || mNeedsGoToSystemView)
mNeedsGoToStart || mNeedsGoToSystem)
mWindow->invalidateCachedBackground();
}

View file

@ -39,8 +39,8 @@ public:
void setNeedsSorting() { mNeedsSorting = true; };
void setNeedsSortingCollections() { mNeedsSortingCollections = true; };
void setNeedsGoToStart() { mNeedsGoToStart = true; };
void setNeedsGoToSystemView(SystemData* goToSystem)
{ mNeedsGoToSystemView = true; mGoToSystem = goToSystem; };
void setNeedsGoToSystem(SystemData* goToSystem)
{ mNeedsGoToSystem = true; mGoToSystem = goToSystem; };
bool input(InputConfig* config, Input input) override;
std::vector<HelpPrompt> getHelpPrompts() override;
@ -55,7 +55,7 @@ private:
bool mNeedsSorting;
bool mNeedsSortingCollections;
bool mNeedsGoToStart;
bool mNeedsGoToSystemView;
bool mNeedsGoToSystem;
SystemData* mGoToSystem;
};

View file

@ -261,6 +261,11 @@ void ViewController::goToSystemView(SystemData* system, bool playTransition)
playViewTransition(true);
}
void ViewController::goToSystem(SystemData* system, bool animate)
{
mSystemListView->goToSystem(system, animate);
}
void ViewController::goToNextGameList()
{
assert(mState.viewing == GAME_LIST);

View file

@ -50,6 +50,7 @@ public:
void goToPrevGameList();
void goToGameList(SystemData* system);
void goToSystemView(SystemData* system, bool playTransition);
void goToSystem(SystemData* system, bool animate);
void goToStart();
void ReloadAndGoToStart();