mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-01-08 15:10:14 +01:00
Added support for genre/manufacturer/year for collections, drawing the information from fields of the same name in the collection's settings.conf.
This commit is contained in:
parent
93f6b65c1e
commit
9ead070052
@ -119,18 +119,22 @@ bool CollectionInfoBuilder::createCollectionDirectory(std::string name)
|
||||
settingsFile << "list.menuSort = yes" << std::endl;
|
||||
settingsFile << std::endl;
|
||||
settingsFile << "launcher = mame" << std::endl;
|
||||
settingsFile << "metadata.type = MAME" << std::endl;
|
||||
settingsFile << "#metadata.type = MAME" << std::endl;
|
||||
settingsFile << std::endl;
|
||||
settingsFile << "#media.screenshot = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screenshot") << std::endl;
|
||||
settingsFile << "#media.screentitle = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screentitle") << std::endl;
|
||||
settingsFile << "#media.artwork_back = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "artwork_back") << std::endl;
|
||||
settingsFile << "#media.artwork_front = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "artwork_front") << std::endl;
|
||||
settingsFile << "#media.logo = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "logo") << std::endl;
|
||||
settingsFile << "#media.medium_back = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "medium_back") << std::endl;
|
||||
settingsFile << "#media.medium_front = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "medium_front") << std::endl;
|
||||
settingsFile << "#media.screenshot = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screenshot") << std::endl;
|
||||
settingsFile << "#media.screentitle = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screentitle") << std::endl;
|
||||
settingsFile << "#media.video = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "video") << std::endl;
|
||||
settingsFile << "#manufacturer = " << std::endl;
|
||||
settingsFile << "#year = " << std::endl;
|
||||
settingsFile << "#genre = " << std::endl;
|
||||
settingsFile << std::endl;
|
||||
settingsFile << "#media.screenshot = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screenshot") << std::endl;
|
||||
settingsFile << "#media.screentitle = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screentitle") << std::endl;
|
||||
settingsFile << "#media.artwork_back = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "artwork_back") << std::endl;
|
||||
settingsFile << "#media.artwork_front = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "artwork_front") << std::endl;
|
||||
settingsFile << "#media.logo = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "logo") << std::endl;
|
||||
settingsFile << "#media.medium_back = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "medium_back") << std::endl;
|
||||
settingsFile << "#media.medium_front = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "medium_front") << std::endl;
|
||||
settingsFile << "#media.screenshot = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screenshot") << std::endl;
|
||||
settingsFile << "#media.screentitle = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "screentitle") << std::endl;
|
||||
settingsFile << "#media.video = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "medium_artwork", "video") << std::endl;
|
||||
settingsFile << "#media.system_artwork = " << Utils::combinePath("%BASE_MEDIA_PATH%", "%ITEM_COLLECTION_NAME%", "system_artwork") << std::endl;
|
||||
settingsFile.close();
|
||||
|
||||
|
||||
@ -23,8 +23,9 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
ReloadableText::ReloadableText(std::string type, Page &page, Font *font, std::string layoutKey, float scaleX, float scaleY)
|
||||
ReloadableText::ReloadableText(std::string type, Page &page, Configuration &config, Font *font, std::string layoutKey, float scaleX, float scaleY)
|
||||
: Component(page)
|
||||
, config_(config)
|
||||
, imageInst_(NULL)
|
||||
, layoutKey_(layoutKey)
|
||||
, reloadRequested_(false)
|
||||
@ -160,16 +161,28 @@ void ReloadableText::ReloadTexture()
|
||||
ss << selectedItem->numberPlayers;
|
||||
break;
|
||||
case TextTypeYear:
|
||||
ss << selectedItem->year;
|
||||
if (selectedItem->leaf) // item is a leaf
|
||||
text = selectedItem->year;
|
||||
else // item is a collection
|
||||
(void)config_.getProperty("collections." + selectedItem->name + ".year", text );
|
||||
ss << text;
|
||||
break;
|
||||
case TextTypeTitle:
|
||||
ss << selectedItem->title;
|
||||
break;
|
||||
case TextTypeManufacturer:
|
||||
ss << selectedItem->manufacturer;
|
||||
if (selectedItem->leaf) // item is a leaf
|
||||
text = selectedItem->manufacturer;
|
||||
else // item is a collection
|
||||
(void)config_.getProperty("collections." + selectedItem->name + ".manufacturer", text );
|
||||
ss << text;
|
||||
break;
|
||||
case TextTypeGenre:
|
||||
ss << selectedItem->genre;
|
||||
if (selectedItem->leaf) // item is a leaf
|
||||
text = selectedItem->genre;
|
||||
else // item is a collection
|
||||
(void)config_.getProperty("collections." + selectedItem->name + ".genre", text );
|
||||
ss << text;
|
||||
break;
|
||||
case TextTypePlaylist:
|
||||
ss << playlistName;
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
class ReloadableText : public Component
|
||||
{
|
||||
public:
|
||||
ReloadableText(std::string type, Page &page, Font *font, std::string layoutKey, float scaleX, float scaleY);
|
||||
ReloadableText(std::string type, Page &page, Configuration &config, Font *font, std::string layoutKey, float scaleX, float scaleY);
|
||||
virtual ~ReloadableText();
|
||||
void update(float dt);
|
||||
void draw();
|
||||
@ -52,6 +52,7 @@ private:
|
||||
|
||||
void ReloadTexture();
|
||||
|
||||
Configuration &config_;
|
||||
Text *imageInst_;
|
||||
TextType type_;
|
||||
std::string layoutKey_;
|
||||
|
||||
@ -446,7 +446,7 @@ void PageBuilder::loadReloadableImages(xml_node<> *layout, std::string tagName,
|
||||
if(type)
|
||||
{
|
||||
Font *font = addFont(componentXml, NULL);
|
||||
c = new ReloadableText(type->value(), *page, font, layoutKey, scaleX_, scaleY_);
|
||||
c = new ReloadableText(type->value(), *page, config_, font, layoutKey, scaleX_, scaleY_);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user