mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2026-02-22 01:01:33 +01:00
Added support for control type information:
- Use tag <ctrltype> in the meta XML. - Use type "ctrlType" in the layout XML.
This commit is contained in:
parent
2502607a04
commit
064932c46f
@ -36,6 +36,7 @@ public:
|
|||||||
std::string cloneof;
|
std::string cloneof;
|
||||||
std::string numberPlayers;
|
std::string numberPlayers;
|
||||||
std::string numberButtons;
|
std::string numberButtons;
|
||||||
|
std::string ctrlType;
|
||||||
std::string joyWays;
|
std::string joyWays;
|
||||||
std::string rating;
|
std::string rating;
|
||||||
CollectionInfo *collectionInfo;
|
CollectionInfo *collectionInfo;
|
||||||
|
|||||||
@ -84,6 +84,7 @@ bool MetadataDatabase::initialize()
|
|||||||
sql.append("genre TEXT NOT NULL DEFAULT '',");
|
sql.append("genre TEXT NOT NULL DEFAULT '',");
|
||||||
sql.append("cloneOf TEXT NOT NULL DEFAULT '',");
|
sql.append("cloneOf TEXT NOT NULL DEFAULT '',");
|
||||||
sql.append("players TEXT NOT NULL DEFAULT '',");
|
sql.append("players TEXT NOT NULL DEFAULT '',");
|
||||||
|
sql.append("ctrltype TEXT NOT NULL DEFAULT '',");
|
||||||
sql.append("buttons TEXT NOT NULL DEFAULT '',");
|
sql.append("buttons TEXT NOT NULL DEFAULT '',");
|
||||||
sql.append("joyways TEXT NOT NULL DEFAULT '',");
|
sql.append("joyways TEXT NOT NULL DEFAULT '',");
|
||||||
sql.append("rating TEXT NOT NULL DEFAULT '');");
|
sql.append("rating TEXT NOT NULL DEFAULT '');");
|
||||||
@ -207,7 +208,7 @@ void MetadataDatabase::injectMetadata(CollectionInfo *collection)
|
|||||||
|
|
||||||
//todo: program crashes if this query fails
|
//todo: program crashes if this query fails
|
||||||
sqlite3_prepare_v2(handle,
|
sqlite3_prepare_v2(handle,
|
||||||
"SELECT DISTINCT Meta.name, Meta.title, Meta.year, Meta.manufacturer, Meta.genre, Meta.players, Meta.buttons, Meta.joyways, Meta.cloneOf, Meta.rating "
|
"SELECT DISTINCT Meta.name, Meta.title, Meta.year, Meta.manufacturer, Meta.genre, Meta.players, Meta.ctrltype, Meta.buttons, Meta.joyways, Meta.cloneOf, Meta.rating "
|
||||||
"FROM Meta WHERE collectionName=? ORDER BY title ASC;",
|
"FROM Meta WHERE collectionName=? ORDER BY title ASC;",
|
||||||
-1, &stmt, 0);
|
-1, &stmt, 0);
|
||||||
|
|
||||||
@ -223,10 +224,11 @@ void MetadataDatabase::injectMetadata(CollectionInfo *collection)
|
|||||||
std::string manufacturer = (char *)sqlite3_column_text(stmt, 3);
|
std::string manufacturer = (char *)sqlite3_column_text(stmt, 3);
|
||||||
std::string genre = (char *)sqlite3_column_text(stmt, 4);
|
std::string genre = (char *)sqlite3_column_text(stmt, 4);
|
||||||
std::string numberPlayers = (char *)sqlite3_column_text(stmt, 5);
|
std::string numberPlayers = (char *)sqlite3_column_text(stmt, 5);
|
||||||
std::string numberButtons = (char *)sqlite3_column_text(stmt, 6);
|
std::string ctrlType = (char *)sqlite3_column_text(stmt, 6);
|
||||||
std::string joyWays = (char *)sqlite3_column_text(stmt, 7);
|
std::string numberButtons = (char *)sqlite3_column_text(stmt, 7);
|
||||||
std::string cloneOf = (char *)sqlite3_column_text(stmt, 8);
|
std::string joyWays = (char *)sqlite3_column_text(stmt, 8);
|
||||||
std::string rating = (char *)sqlite3_column_text(stmt, 9);
|
std::string cloneOf = (char *)sqlite3_column_text(stmt, 9);
|
||||||
|
std::string rating = (char *)sqlite3_column_text(stmt, 10);
|
||||||
std::string launcher;
|
std::string launcher;
|
||||||
std::string title = fullTitle;
|
std::string title = fullTitle;
|
||||||
|
|
||||||
@ -276,6 +278,7 @@ void MetadataDatabase::injectMetadata(CollectionInfo *collection)
|
|||||||
item->genre = genre;
|
item->genre = genre;
|
||||||
item->numberPlayers = numberPlayers;
|
item->numberPlayers = numberPlayers;
|
||||||
item->numberButtons = numberButtons;
|
item->numberButtons = numberButtons;
|
||||||
|
item->ctrlType = ctrlType;
|
||||||
item->joyWays = joyWays;
|
item->joyWays = joyWays;
|
||||||
item->cloneof = cloneOf;
|
item->cloneof = cloneOf;
|
||||||
item->rating = rating;
|
item->rating = rating;
|
||||||
@ -342,6 +345,7 @@ bool MetadataDatabase::importHyperlist(std::string hyperlistFile, std::string co
|
|||||||
rapidxml::xml_node<> *genreXml = game->first_node("genre");
|
rapidxml::xml_node<> *genreXml = game->first_node("genre");
|
||||||
rapidxml::xml_node<> *ratingXml = game->first_node("rating");
|
rapidxml::xml_node<> *ratingXml = game->first_node("rating");
|
||||||
rapidxml::xml_node<> *numberPlayersXml = game->first_node("players");
|
rapidxml::xml_node<> *numberPlayersXml = game->first_node("players");
|
||||||
|
rapidxml::xml_node<> *ctrlTypeXml = game->first_node("ctrltype");
|
||||||
rapidxml::xml_node<> *numberButtonsXml = game->first_node("buttons");
|
rapidxml::xml_node<> *numberButtonsXml = game->first_node("buttons");
|
||||||
rapidxml::xml_node<> *numberJoyWaysXml = game->first_node("joyways");
|
rapidxml::xml_node<> *numberJoyWaysXml = game->first_node("joyways");
|
||||||
rapidxml::xml_node<> *enabledXml = game->first_node("enabled");
|
rapidxml::xml_node<> *enabledXml = game->first_node("enabled");
|
||||||
@ -354,6 +358,7 @@ bool MetadataDatabase::importHyperlist(std::string hyperlistFile, std::string co
|
|||||||
std::string genre = (genreXml) ? genreXml->value() : "";
|
std::string genre = (genreXml) ? genreXml->value() : "";
|
||||||
std::string rating = (ratingXml) ? ratingXml->value() : "";
|
std::string rating = (ratingXml) ? ratingXml->value() : "";
|
||||||
std::string numberPlayers = (numberPlayersXml) ? numberPlayersXml->value() : "";
|
std::string numberPlayers = (numberPlayersXml) ? numberPlayersXml->value() : "";
|
||||||
|
std::string ctrlType = (ctrlTypeXml) ? ctrlTypeXml->value() : "";
|
||||||
std::string numberButtons = (numberButtonsXml) ? numberButtonsXml->value() : "";
|
std::string numberButtons = (numberButtonsXml) ? numberButtonsXml->value() : "";
|
||||||
std::string numberJoyWays = (numberJoyWaysXml) ? numberJoyWaysXml->value() : "";
|
std::string numberJoyWays = (numberJoyWaysXml) ? numberJoyWaysXml->value() : "";
|
||||||
std::string enabled = (enabledXml) ? enabledXml->value() : "";
|
std::string enabled = (enabledXml) ? enabledXml->value() : "";
|
||||||
@ -363,7 +368,7 @@ bool MetadataDatabase::importHyperlist(std::string hyperlistFile, std::string co
|
|||||||
sqlite3_stmt *stmt;
|
sqlite3_stmt *stmt;
|
||||||
|
|
||||||
sqlite3_prepare_v2(handle,
|
sqlite3_prepare_v2(handle,
|
||||||
"INSERT OR REPLACE INTO Meta (name, title, year, manufacturer, genre, players, buttons, joyways, cloneOf, collectionName, rating) VALUES (?,?,?,?,?,?,?,?,?,?,?)",
|
"INSERT OR REPLACE INTO Meta (name, title, year, manufacturer, genre, players, ctrltype, buttons, joyways, cloneOf, collectionName, rating) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||||
-1, &stmt, 0);
|
-1, &stmt, 0);
|
||||||
|
|
||||||
sqlite3_bind_text(stmt, 1, name.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 1, name.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
@ -372,11 +377,12 @@ bool MetadataDatabase::importHyperlist(std::string hyperlistFile, std::string co
|
|||||||
sqlite3_bind_text(stmt, 4, manufacturer.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 4, manufacturer.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 5, genre.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 5, genre.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 6, numberPlayers.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 6, numberPlayers.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 7, numberButtons.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 7, ctrlType.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 8, numberJoyWays.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 8, numberButtons.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 9, cloneOf.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 9, numberJoyWays.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 10, collectionName.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 10, cloneOf.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
sqlite3_bind_text(stmt, 11, rating.c_str(), -1, SQLITE_TRANSIENT);
|
sqlite3_bind_text(stmt, 11, collectionName.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
|
sqlite3_bind_text(stmt, 12, rating.c_str(), -1, SQLITE_TRANSIENT);
|
||||||
|
|
||||||
sqlite3_step(stmt);
|
sqlite3_step(stmt);
|
||||||
sqlite3_finalize(stmt);
|
sqlite3_finalize(stmt);
|
||||||
|
|||||||
@ -164,6 +164,10 @@ void ReloadableText::ReloadTexture()
|
|||||||
ss << " Players";
|
ss << " Players";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type_ == "ctrlType")
|
||||||
|
{
|
||||||
|
ss << selectedItem->ctrlType;
|
||||||
|
}
|
||||||
else if (type_ == "numberJoyWays")
|
else if (type_ == "numberJoyWays")
|
||||||
{
|
{
|
||||||
ss << selectedItem->joyWays;
|
ss << selectedItem->joyWays;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user