mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Added up and down button navigation to switch between the media viewer and the PDF viewer
This commit is contained in:
parent
1888ec55f5
commit
a964d89b80
|
@ -14,6 +14,7 @@
|
|||
|
||||
MediaViewer::MediaViewer()
|
||||
: mRenderer {Renderer::getInstance()}
|
||||
, mGame {nullptr}
|
||||
{
|
||||
Window::getInstance()->setMediaViewer(this);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
PDFViewer::PDFViewer()
|
||||
: mRenderer {Renderer::getInstance()}
|
||||
, mGame {nullptr}
|
||||
{
|
||||
Window::getInstance()->setPDFViewer(this);
|
||||
mTexture = TextureResource::get("");
|
||||
|
@ -50,10 +51,11 @@ bool PDFViewer::startPDFViewer(FileData* game)
|
|||
return false;
|
||||
}
|
||||
|
||||
mManualPath = game->getManualPath();
|
||||
mGame = game;
|
||||
mManualPath = mGame->getManualPath();
|
||||
|
||||
if (!Utils::FileSystem::exists(mManualPath)) {
|
||||
LOG(LogError) << "No PDF manual found for game \"" << game->getName() << "\"";
|
||||
LOG(LogError) << "No PDF manual found for game \"" << mGame->getName() << "\"";
|
||||
NavigationSounds::getInstance().playThemeNavigationSound(SCROLLSOUND);
|
||||
ViewController::getInstance()->stopViewVideos();
|
||||
return false;
|
||||
|
@ -136,6 +138,12 @@ void PDFViewer::stopPDFViewer()
|
|||
mPageImage.reset();
|
||||
}
|
||||
|
||||
void PDFViewer::launchMediaViewer()
|
||||
{
|
||||
Window::getInstance()->stopPDFViewer();
|
||||
Window::getInstance()->startMediaViewer(mGame);
|
||||
}
|
||||
|
||||
bool PDFViewer::getDocumentInfo()
|
||||
{
|
||||
std::string commandOutput;
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
|
||||
bool startPDFViewer(FileData* game) override;
|
||||
void stopPDFViewer() override;
|
||||
void launchMediaViewer() override;
|
||||
|
||||
bool getDocumentInfo();
|
||||
void convertPage(int pageNum);
|
||||
|
@ -43,6 +44,7 @@ private:
|
|||
std::shared_ptr<TextureResource> mTexture;
|
||||
std::unique_ptr<ImageComponent> mPageImage;
|
||||
std::map<int, PageEntry> mPages;
|
||||
FileData* mGame;
|
||||
|
||||
std::string mESConvertPath;
|
||||
std::string mManualPath;
|
||||
|
|
|
@ -221,7 +221,7 @@ void Window::input(InputConfig* config, Input input)
|
|||
}
|
||||
|
||||
if (mMediaViewer && mRenderMediaViewer) {
|
||||
if (config->isMappedLike("y", input) && input.value != 0) {
|
||||
if (config->isMappedLike("up", input) && input.value != 0) {
|
||||
mMediaViewer->launchPDFViewer();
|
||||
return;
|
||||
}
|
||||
|
@ -236,7 +236,11 @@ void Window::input(InputConfig* config, Input input)
|
|||
}
|
||||
|
||||
if (mPDFViewer && mRenderPDFViewer) {
|
||||
if (config->isMappedLike("right", input) && input.value != 0)
|
||||
if (config->isMappedLike("down", input) && input.value != 0) {
|
||||
mPDFViewer->launchMediaViewer();
|
||||
return;
|
||||
}
|
||||
else if (config->isMappedLike("right", input) && input.value != 0)
|
||||
mPDFViewer->showNextPage();
|
||||
else if (config->isMappedLike("left", input) && input.value != 0)
|
||||
mPDFViewer->showPreviousPage();
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
public:
|
||||
virtual bool startPDFViewer(FileData* game) = 0;
|
||||
virtual void stopPDFViewer() = 0;
|
||||
virtual void launchMediaViewer() = 0;
|
||||
|
||||
virtual void showNextPage() = 0;
|
||||
virtual void showPreviousPage() = 0;
|
||||
|
|
Loading…
Reference in a new issue