mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Grid View Fixes
Fix for metadata disappearing when selecting system for the first time. Fix for video not resuming after launching game.
This commit is contained in:
parent
c9b3f5b646
commit
c114ef05ac
|
@ -235,6 +235,8 @@ void ViewController::launch(FileData* game, Vector3f center)
|
||||||
game->launchGame(mWindow);
|
game->launchGame(mWindow);
|
||||||
setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { mLockInput = false; }, true);
|
setAnimation(new LambdaAnimation(fadeFunc, 800), 0, [this] { mLockInput = false; }, true);
|
||||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||||
|
if (mCurrentView)
|
||||||
|
mCurrentView->onShow();
|
||||||
});
|
});
|
||||||
} else if (transition_style == "slide"){
|
} else if (transition_style == "slide"){
|
||||||
// move camera to zoom in on center + fade out, launch game, come back in
|
// move camera to zoom in on center + fade out, launch game, come back in
|
||||||
|
@ -244,6 +246,8 @@ void ViewController::launch(FileData* game, Vector3f center)
|
||||||
mCamera = origCamera;
|
mCamera = origCamera;
|
||||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { mLockInput = false; }, true);
|
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 600), 0, [this] { mLockInput = false; }, true);
|
||||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||||
|
if (mCurrentView)
|
||||||
|
mCurrentView->onShow();
|
||||||
});
|
});
|
||||||
} else { // instant
|
} else { // instant
|
||||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this, origCamera, center, game]
|
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this, origCamera, center, game]
|
||||||
|
@ -252,6 +256,8 @@ void ViewController::launch(FileData* game, Vector3f center)
|
||||||
mCamera = origCamera;
|
mCamera = origCamera;
|
||||||
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this] { mLockInput = false; }, true);
|
setAnimation(new LaunchAnimation(mCamera, mFadeOpacity, center, 10), 0, [this] { mLockInput = false; }, true);
|
||||||
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
this->onFileChanged(game, FILE_METADATA_CHANGED);
|
||||||
|
if (mCurrentView)
|
||||||
|
mCurrentView->onShow();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,11 @@ GridGameListView::GridGameListView(Window* window, FileData* root) :
|
||||||
updateInfoPanel();
|
updateInfoPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GridGameListView::~GridGameListView()
|
||||||
|
{
|
||||||
|
delete mVideo;
|
||||||
|
}
|
||||||
|
|
||||||
FileData* GridGameListView::getCursor()
|
FileData* GridGameListView::getCursor()
|
||||||
{
|
{
|
||||||
return mGrid.getSelected();
|
return mGrid.getSelected();
|
||||||
|
@ -219,7 +224,10 @@ void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
||||||
mDescription.setSize(mDescContainer.getSize().x(), 0);
|
mDescription.setSize(mDescContainer.getSize().x(), 0);
|
||||||
mDescription.applyTheme(theme, getName(), "md_description", ALL ^ (POSITION | ThemeFlags::SIZE | ThemeFlags::ORIGIN | TEXT | ROTATION));
|
mDescription.applyTheme(theme, getName(), "md_description", ALL ^ (POSITION | ThemeFlags::SIZE | ThemeFlags::ORIGIN | TEXT | ROTATION));
|
||||||
|
|
||||||
|
// Repopulate list in case new theme is displaying a different image. Preserve selection.
|
||||||
|
FileData* file = mGrid.getSelected();
|
||||||
populateList(mRoot->getChildrenListToDisplay());
|
populateList(mRoot->getChildrenListToDisplay());
|
||||||
|
mGrid.setCursor(file);
|
||||||
|
|
||||||
sortChildren();
|
sortChildren();
|
||||||
}
|
}
|
||||||
|
@ -474,3 +482,15 @@ std::vector<HelpPrompt> GridGameListView::getHelpPrompts()
|
||||||
}
|
}
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GridGameListView::update(int deltaTime)
|
||||||
|
{
|
||||||
|
ISimpleGameListView::update(deltaTime);
|
||||||
|
mVideo->update(deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GridGameListView::onShow()
|
||||||
|
{
|
||||||
|
GuiComponent::onShow();
|
||||||
|
updateInfoPanel();
|
||||||
|
}
|
||||||
|
|
|
@ -13,6 +13,9 @@ class GridGameListView : public ISimpleGameListView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GridGameListView(Window* window, FileData* root);
|
GridGameListView(Window* window, FileData* root);
|
||||||
|
virtual ~GridGameListView();
|
||||||
|
|
||||||
|
virtual void onShow() override;
|
||||||
|
|
||||||
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
||||||
|
|
||||||
|
@ -27,6 +30,7 @@ public:
|
||||||
virtual void launch(FileData* game) override;
|
virtual void launch(FileData* game) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void update(int deltaTime) override;
|
||||||
virtual std::string getQuickSystemSelectRightButton() override;
|
virtual std::string getQuickSystemSelectRightButton() override;
|
||||||
virtual std::string getQuickSystemSelectLeftButton() override;
|
virtual std::string getQuickSystemSelectLeftButton() override;
|
||||||
virtual void populateList(const std::vector<FileData*>& files) override;
|
virtual void populateList(const std::vector<FileData*>& files) override;
|
||||||
|
|
Loading…
Reference in a new issue