From e575f7708e00f6931e3bef5248e48e270a89d967 Mon Sep 17 00:00:00 2001 From: Koerty Date: Fri, 6 Apr 2018 18:37:34 +0200 Subject: [PATCH] Add the new metadata field md_title to grid, video and detailed views Unlike the others, it is by default positioned offscreen --- THEMES.md | 9 ++++++++- es-app/src/views/gamelist/DetailedGameListView.cpp | 12 +++++++++++- es-app/src/views/gamelist/DetailedGameListView.h | 1 + es-app/src/views/gamelist/GridGameListView.cpp | 12 +++++++++++- es-app/src/views/gamelist/GridGameListView.h | 1 + es-app/src/views/gamelist/VideoGameListView.cpp | 12 +++++++++++- es-app/src/views/gamelist/VideoGameListView.h | 1 + 7 files changed, 44 insertions(+), 4 deletions(-) diff --git a/THEMES.md b/THEMES.md index f44baaaf1..2941c50d6 100644 --- a/THEMES.md +++ b/THEMES.md @@ -306,6 +306,7 @@ You can now change the order in which elements are rendered by setting `zIndex` * `datetime name="md_lastplayed"` * `text name="md_playcount"` * `text name="md_description"` + * `text name="md_name"` * System Logo/Text - 50 * `text name="logoText"` * `image name="logo"` @@ -409,6 +410,8 @@ Reference - The "playcount" metadata (number of times the game has been played). * `text name="md_description"` - POSITION | SIZE | FONT_PATH | FONT_SIZE | COLOR | Z_INDEX - Text is the "desc" metadata. If no `pos`/`size` is specified, will move and resize to fit under the lowest label and reach to the bottom of the screen. + * `text name="md_name"` - ALL + - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default #### video * `helpsystem name="help"` - ALL @@ -460,7 +463,9 @@ Reference - The "playcount" metadata (number of times the game has been played). * `text name="md_description"` - POSITION | SIZE | FONT_PATH | FONT_SIZE | COLOR | Z_INDEX - Text is the "desc" metadata. If no `pos`/`size` is specified, will move and resize to fit under the lowest label and reach to the bottom of the screen. - + * `text name="md_name"` - ALL + - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default + --- #### grid @@ -511,6 +516,8 @@ Reference - The "playcount" metadata (number of times the game has been played). * `text name="md_description"` - POSITION | SIZE | FONT_PATH | FONT_SIZE | COLOR | Z_INDEX - Text is the "desc" metadata. If no `pos`/`size` is specified, will move and resize to fit under the lowest label and reach to the bottom of the screen. + * `text name="md_name"` - ALL + - The "name" metadata (the game name). Unlike the others metadata fields, the name is positioned offscreen by default --- diff --git a/es-app/src/views/gamelist/DetailedGameListView.cpp b/es-app/src/views/gamelist/DetailedGameListView.cpp index e4b0203b0..42d3ddcae 100644 --- a/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -12,7 +12,8 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root) : mLblGenre(window), mLblPlayers(window), mLblLastPlayed(window), mLblPlayCount(window), mRating(window), mReleaseDate(window), mDeveloper(window), mPublisher(window), - mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window) + mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window), + mName(window) { //mHeaderImage.setPosition(mSize.x() * 0.25f, 0); @@ -57,6 +58,13 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root) : addChild(&mLblPlayCount); addChild(&mPlayCount); + mName.setPosition(mSize.x(), mSize.y()); + mName.setDefaultZIndex(40); + mName.setColor(0xAAAAAAFF); + mName.setFont(Font::get(FONT_SIZE_MEDIUM)); + mName.setHorizontalAlignment(ALIGN_CENTER); + addChild(&mName); + mDescContainer.setPosition(mSize.x() * padding, mSize.y() * 0.65f); mDescContainer.setSize(mSize.x() * (0.50f - 2*padding), mSize.y() - mDescContainer.getPosition().y()); mDescContainer.setAutoScroll(true); @@ -79,6 +87,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr& them using namespace ThemeFlags; mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION); + mName.applyTheme(theme, getName(), "md_name", ALL); initMDLabels(); std::vector labels = getMDLabels(); @@ -200,6 +209,7 @@ void DetailedGameListView::updateInfoPanel() mPublisher.setValue(file->metadata.get("publisher")); mGenre.setValue(file->metadata.get("genre")); mPlayers.setValue(file->metadata.get("players")); + mName.setValue(file->metadata.get("name")); if(file->getType() == GAME) { diff --git a/es-app/src/views/gamelist/DetailedGameListView.h b/es-app/src/views/gamelist/DetailedGameListView.h index dfcd389e3..76c8a9353 100644 --- a/es-app/src/views/gamelist/DetailedGameListView.h +++ b/es-app/src/views/gamelist/DetailedGameListView.h @@ -36,6 +36,7 @@ private: TextComponent mPlayers; DateTimeComponent mLastPlayed; TextComponent mPlayCount; + TextComponent mName; std::vector getMDLabels(); std::vector getMDValues(); diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index bc5e9e481..e53cb7974 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -16,7 +16,8 @@ GridGameListView::GridGameListView(Window* window, FileData* root) : mLblGenre(window), mLblPlayers(window), mLblLastPlayed(window), mLblPlayCount(window), mRating(window), mReleaseDate(window), mDeveloper(window), mPublisher(window), - mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window) + mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window), + mName(window) { const float padding = 0.01f; @@ -54,6 +55,13 @@ GridGameListView::GridGameListView(Window* window, FileData* root) : addChild(&mLblPlayCount); addChild(&mPlayCount); + mName.setPosition(mSize.x(), mSize.y()); + mName.setDefaultZIndex(40); + mName.setColor(0xAAAAAAFF); + mName.setFont(Font::get(FONT_SIZE_MEDIUM)); + mName.setHorizontalAlignment(ALIGN_CENTER); + addChild(&mName); + mDescContainer.setPosition(mSize.x() * padding, mSize.y() * 0.65f); mDescContainer.setSize(mSize.x() * (0.50f - 2*padding), mSize.y() - mDescContainer.getPosition().y()); mDescContainer.setAutoScroll(true); @@ -126,6 +134,7 @@ void GridGameListView::onThemeChanged(const std::shared_ptr& theme) using namespace ThemeFlags; mGrid.applyTheme(theme, getName(), "gamegrid", ALL); + mName.applyTheme(theme, getName(), "md_name", ALL); initMDLabels(); std::vector labels = getMDLabels(); @@ -245,6 +254,7 @@ void GridGameListView::updateInfoPanel() mPublisher.setValue(file->metadata.get("publisher")); mGenre.setValue(file->metadata.get("genre")); mPlayers.setValue(file->metadata.get("players")); + mName.setValue(file->metadata.get("name")); if(file->getType() == GAME) { diff --git a/es-app/src/views/gamelist/GridGameListView.h b/es-app/src/views/gamelist/GridGameListView.h index 7fd8b5f2f..da09c8790 100644 --- a/es-app/src/views/gamelist/GridGameListView.h +++ b/es-app/src/views/gamelist/GridGameListView.h @@ -50,6 +50,7 @@ private: TextComponent mPlayers; DateTimeComponent mLastPlayed; TextComponent mPlayCount; + TextComponent mName; std::vector getMDLabels(); std::vector getMDValues(); diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index da7e2e259..e9ae420bd 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -23,7 +23,8 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root) : mLblGenre(window), mLblPlayers(window), mLblLastPlayed(window), mLblPlayCount(window), mRating(window), mReleaseDate(window), mDeveloper(window), mPublisher(window), - mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window) + mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window), + mName(window) { const float padding = 0.01f; @@ -91,6 +92,13 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root) : addChild(&mLblPlayCount); addChild(&mPlayCount); + mName.setPosition(mSize.x(), mSize.y()); + mName.setDefaultZIndex(40); + mName.setColor(0xAAAAAAFF); + mName.setFont(Font::get(FONT_SIZE_MEDIUM)); + mName.setHorizontalAlignment(ALIGN_CENTER); + addChild(&mName); + mDescContainer.setPosition(mSize.x() * padding, mSize.y() * 0.65f); mDescContainer.setSize(mSize.x() * (0.50f - 2*padding), mSize.y() - mDescContainer.getPosition().y()); mDescContainer.setAutoScroll(true); @@ -118,6 +126,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr& theme) mMarquee.applyTheme(theme, getName(), "md_marquee", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION); mImage.applyTheme(theme, getName(), "md_image", POSITION | ThemeFlags::SIZE | Z_INDEX | ROTATION); mVideo->applyTheme(theme, getName(), "md_video", POSITION | ThemeFlags::SIZE | ThemeFlags::DELAY | Z_INDEX | ROTATION); + mName.applyTheme(theme, getName(), "md_name", ALL); initMDLabels(); std::vector labels = getMDLabels(); @@ -256,6 +265,7 @@ void VideoGameListView::updateInfoPanel() mPublisher.setValue(file->metadata.get("publisher")); mGenre.setValue(file->metadata.get("genre")); mPlayers.setValue(file->metadata.get("players")); + mName.setValue(file->metadata.get("name")); if(file->getType() == GAME) { diff --git a/es-app/src/views/gamelist/VideoGameListView.h b/es-app/src/views/gamelist/VideoGameListView.h index 37ba2253f..8a8335866 100644 --- a/es-app/src/views/gamelist/VideoGameListView.h +++ b/es-app/src/views/gamelist/VideoGameListView.h @@ -45,6 +45,7 @@ private: TextComponent mPlayers; DateTimeComponent mLastPlayed; TextComponent mPlayCount; + TextComponent mName; std::vector getMDLabels(); std::vector getMDValues();