mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 15:15:37 +00:00
Merge pull request #634 from supersquared/master
Add support for md_thumbnail & md_marquee
This commit is contained in:
commit
4eafb8771a
|
@ -6,6 +6,8 @@
|
||||||
DetailedGameListView::DetailedGameListView(Window* window, FileData* root) :
|
DetailedGameListView::DetailedGameListView(Window* window, FileData* root) :
|
||||||
BasicGameListView(window, root),
|
BasicGameListView(window, root),
|
||||||
mDescContainer(window), mDescription(window),
|
mDescContainer(window), mDescription(window),
|
||||||
|
mThumbnail(window),
|
||||||
|
mMarquee(window),
|
||||||
mImage(window),
|
mImage(window),
|
||||||
|
|
||||||
mLblRating(window), mLblReleaseDate(window), mLblDeveloper(window), mLblPublisher(window),
|
mLblRating(window), mLblReleaseDate(window), mLblDeveloper(window), mLblPublisher(window),
|
||||||
|
@ -24,6 +26,23 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root) :
|
||||||
mList.setAlignment(TextListComponent<FileData*>::ALIGN_LEFT);
|
mList.setAlignment(TextListComponent<FileData*>::ALIGN_LEFT);
|
||||||
mList.setCursorChangedCallback([&](const CursorState& /*state*/) { updateInfoPanel(); });
|
mList.setCursorChangedCallback([&](const CursorState& /*state*/) { updateInfoPanel(); });
|
||||||
|
|
||||||
|
// Thumbnail
|
||||||
|
mThumbnail.setOrigin(0.5f, 0.5f);
|
||||||
|
mThumbnail.setPosition(2.0f, 2.0f);
|
||||||
|
mThumbnail.setVisible(false);
|
||||||
|
mThumbnail.setMaxSize(mSize.x() * (0.25f - 2*padding), mSize.y() * 0.10f);
|
||||||
|
mThumbnail.setDefaultZIndex(25);
|
||||||
|
addChild(&mThumbnail);
|
||||||
|
|
||||||
|
// Marquee
|
||||||
|
mMarquee.setOrigin(0.5f, 0.5f);
|
||||||
|
// Default to off the screen
|
||||||
|
mMarquee.setPosition(2.0f, 2.0f);
|
||||||
|
mMarquee.setVisible(false);
|
||||||
|
mMarquee.setMaxSize(mSize.x() * (0.5f - 2*padding), mSize.y() * 0.18f);
|
||||||
|
mMarquee.setDefaultZIndex(35);
|
||||||
|
addChild(&mMarquee);
|
||||||
|
|
||||||
// image
|
// image
|
||||||
mImage.setOrigin(0.5f, 0.5f);
|
mImage.setOrigin(0.5f, 0.5f);
|
||||||
mImage.setPosition(mSize.x() * 0.25f, mList.getPosition().y() + mSize.y() * 0.2125f);
|
mImage.setPosition(mSize.x() * 0.25f, mList.getPosition().y() + mSize.y() * 0.2125f);
|
||||||
|
@ -86,6 +105,8 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
|
||||||
BasicGameListView::onThemeChanged(theme);
|
BasicGameListView::onThemeChanged(theme);
|
||||||
|
|
||||||
using namespace ThemeFlags;
|
using namespace ThemeFlags;
|
||||||
|
mThumbnail.applyTheme(theme, getName(), "md_thumbnail", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
|
mMarquee.applyTheme(theme, getName(), "md_marquee", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
mName.applyTheme(theme, getName(), "md_name", ALL);
|
mName.applyTheme(theme, getName(), "md_name", ALL);
|
||||||
|
|
||||||
|
@ -199,6 +220,8 @@ void DetailedGameListView::updateInfoPanel()
|
||||||
//mDescription.setText("");
|
//mDescription.setText("");
|
||||||
fadingOut = true;
|
fadingOut = true;
|
||||||
}else{
|
}else{
|
||||||
|
mThumbnail.setImage(file->getThumbnailPath());
|
||||||
|
mMarquee.setImage(file->getMarqueePath());
|
||||||
mImage.setImage(file->getImagePath());
|
mImage.setImage(file->getImagePath());
|
||||||
mDescription.setText(file->metadata.get("desc"));
|
mDescription.setText(file->metadata.get("desc"));
|
||||||
mDescContainer.reset();
|
mDescContainer.reset();
|
||||||
|
@ -221,6 +244,8 @@ void DetailedGameListView::updateInfoPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<GuiComponent*> comps = getMDValues();
|
std::vector<GuiComponent*> comps = getMDValues();
|
||||||
|
comps.push_back(&mThumbnail);
|
||||||
|
comps.push_back(&mMarquee);
|
||||||
comps.push_back(&mImage);
|
comps.push_back(&mImage);
|
||||||
comps.push_back(&mDescription);
|
comps.push_back(&mDescription);
|
||||||
comps.push_back(&mName);
|
comps.push_back(&mName);
|
||||||
|
|
|
@ -24,6 +24,8 @@ private:
|
||||||
void initMDLabels();
|
void initMDLabels();
|
||||||
void initMDValues();
|
void initMDValues();
|
||||||
|
|
||||||
|
ImageComponent mThumbnail;
|
||||||
|
ImageComponent mMarquee;
|
||||||
ImageComponent mImage;
|
ImageComponent mImage;
|
||||||
|
|
||||||
TextComponent mLblRating, mLblReleaseDate, mLblDeveloper, mLblPublisher, mLblGenre, mLblPlayers, mLblLastPlayed, mLblPlayCount;
|
TextComponent mLblRating, mLblReleaseDate, mLblDeveloper, mLblPublisher, mLblGenre, mLblPlayers, mLblLastPlayed, mLblPlayCount;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
VideoGameListView::VideoGameListView(Window* window, FileData* root) :
|
VideoGameListView::VideoGameListView(Window* window, FileData* root) :
|
||||||
BasicGameListView(window, root),
|
BasicGameListView(window, root),
|
||||||
mDescContainer(window), mDescription(window),
|
mDescContainer(window), mDescription(window),
|
||||||
|
mThumbnail(window),
|
||||||
mMarquee(window),
|
mMarquee(window),
|
||||||
mImage(window),
|
mImage(window),
|
||||||
mVideo(nullptr),
|
mVideo(nullptr),
|
||||||
|
@ -43,6 +44,14 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root) :
|
||||||
mList.setAlignment(TextListComponent<FileData*>::ALIGN_LEFT);
|
mList.setAlignment(TextListComponent<FileData*>::ALIGN_LEFT);
|
||||||
mList.setCursorChangedCallback([&](const CursorState& /*state*/) { updateInfoPanel(); });
|
mList.setCursorChangedCallback([&](const CursorState& /*state*/) { updateInfoPanel(); });
|
||||||
|
|
||||||
|
// Thumbnail
|
||||||
|
mThumbnail.setOrigin(0.5f, 0.5f);
|
||||||
|
mThumbnail.setPosition(2.0f, 2.0f);
|
||||||
|
mThumbnail.setVisible(false);
|
||||||
|
mThumbnail.setMaxSize(mSize.x() * (0.25f - 2*padding), mSize.y() * 0.10f);
|
||||||
|
mThumbnail.setDefaultZIndex(35);
|
||||||
|
addChild(&mThumbnail);
|
||||||
|
|
||||||
// Marquee
|
// Marquee
|
||||||
mMarquee.setOrigin(0.5f, 0.5f);
|
mMarquee.setOrigin(0.5f, 0.5f);
|
||||||
mMarquee.setPosition(mSize.x() * 0.25f, mSize.y() * 0.10f);
|
mMarquee.setPosition(mSize.x() * 0.25f, mSize.y() * 0.10f);
|
||||||
|
@ -54,6 +63,7 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root) :
|
||||||
mImage.setOrigin(0.5f, 0.5f);
|
mImage.setOrigin(0.5f, 0.5f);
|
||||||
// Default to off the screen
|
// Default to off the screen
|
||||||
mImage.setPosition(2.0f, 2.0f);
|
mImage.setPosition(2.0f, 2.0f);
|
||||||
|
mImage.setVisible(false);
|
||||||
mImage.setMaxSize(1.0f, 1.0f);
|
mImage.setMaxSize(1.0f, 1.0f);
|
||||||
mImage.setDefaultZIndex(30);
|
mImage.setDefaultZIndex(30);
|
||||||
addChild(&mImage);
|
addChild(&mImage);
|
||||||
|
@ -123,6 +133,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
||||||
BasicGameListView::onThemeChanged(theme);
|
BasicGameListView::onThemeChanged(theme);
|
||||||
|
|
||||||
using namespace ThemeFlags;
|
using namespace ThemeFlags;
|
||||||
|
mThumbnail.applyTheme(theme, getName(), "md_thumbnail", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
mMarquee.applyTheme(theme, getName(), "md_marquee", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
mMarquee.applyTheme(theme, getName(), "md_marquee", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION | VISIBLE);
|
||||||
mVideo->applyTheme(theme, getName(), "md_video", POSITION | ThemeFlags::SIZE | ThemeFlags::DELAY | Z_INDEX | ROTATION | VISIBLE);
|
mVideo->applyTheme(theme, getName(), "md_video", POSITION | ThemeFlags::SIZE | ThemeFlags::DELAY | Z_INDEX | ROTATION | VISIBLE);
|
||||||
|
@ -253,6 +264,7 @@ void VideoGameListView::updateInfoPanel()
|
||||||
mVideoPlaying = true;
|
mVideoPlaying = true;
|
||||||
|
|
||||||
mVideo->setImage(file->getThumbnailPath());
|
mVideo->setImage(file->getThumbnailPath());
|
||||||
|
mThumbnail.setImage(file->getThumbnailPath());
|
||||||
mMarquee.setImage(file->getMarqueePath());
|
mMarquee.setImage(file->getMarqueePath());
|
||||||
mImage.setImage(file->getImagePath());
|
mImage.setImage(file->getImagePath());
|
||||||
|
|
||||||
|
@ -277,6 +289,7 @@ void VideoGameListView::updateInfoPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<GuiComponent*> comps = getMDValues();
|
std::vector<GuiComponent*> comps = getMDValues();
|
||||||
|
comps.push_back(&mThumbnail);
|
||||||
comps.push_back(&mMarquee);
|
comps.push_back(&mMarquee);
|
||||||
comps.push_back(mVideo);
|
comps.push_back(mVideo);
|
||||||
comps.push_back(&mDescription);
|
comps.push_back(&mDescription);
|
||||||
|
@ -317,6 +330,12 @@ void VideoGameListView::launch(FileData* game)
|
||||||
{
|
{
|
||||||
target = Vector3f(mMarquee.getCenter().x(), mMarquee.getCenter().y(), 0);
|
target = Vector3f(mMarquee.getCenter().x(), mMarquee.getCenter().y(), 0);
|
||||||
}
|
}
|
||||||
|
else if(mThumbnail.hasImage() &&
|
||||||
|
(mThumbnail.getPosition().x() < screenWidth && mThumbnail.getPosition().x() > 2.0f &&
|
||||||
|
mThumbnail.getPosition().y() < screenHeight && mThumbnail.getPosition().y() > 2.0f))
|
||||||
|
{
|
||||||
|
target = Vector3f(mThumbnail.getCenter().x(), mThumbnail.getCenter().y(), 0);
|
||||||
|
}
|
||||||
else if(mImage.hasImage() &&
|
else if(mImage.hasImage() &&
|
||||||
(mImage.getPosition().x() < screenWidth && mImage.getPosition().x() > 2.0f &&
|
(mImage.getPosition().x() < screenWidth && mImage.getPosition().x() > 2.0f &&
|
||||||
mImage.getPosition().y() < screenHeight && mImage.getPosition().y() > 2.0f))
|
mImage.getPosition().y() < screenHeight && mImage.getPosition().y() > 2.0f))
|
||||||
|
|
|
@ -31,6 +31,7 @@ private:
|
||||||
void initMDLabels();
|
void initMDLabels();
|
||||||
void initMDValues();
|
void initMDValues();
|
||||||
|
|
||||||
|
ImageComponent mThumbnail;
|
||||||
ImageComponent mMarquee;
|
ImageComponent mMarquee;
|
||||||
VideoComponent* mVideo;
|
VideoComponent* mVideo;
|
||||||
ImageComponent mImage;
|
ImageComponent mImage;
|
||||||
|
|
Loading…
Reference in a new issue