Changed metadata text entry prompts to be more descriptive.

This commit is contained in:
Aloshi 2014-04-30 12:16:56 -05:00
parent 63113aeea7
commit a9514843b4
3 changed files with 15 additions and 13 deletions

View file

@ -3,18 +3,19 @@
#include "Log.h" #include "Log.h"
MetaDataDecl gameDecls[] = { MetaDataDecl gameDecls[] = {
{"name", MD_STRING, "", false, "name"}, // key, type, default, statistic, name in GuiMetaDataEd, prompt in GuiMetaDataEd
{"desc", MD_MULTILINE_STRING, "", false, "description"}, {"name", MD_STRING, "", false, "name", "enter game name"},
{"image", MD_IMAGE_PATH, "", false, "image"}, {"desc", MD_MULTILINE_STRING, "", false, "description", "enter description"},
{"thumbnail", MD_IMAGE_PATH, "", false, "thumbnail"}, {"image", MD_IMAGE_PATH, "", false, "image", "enter path to image"},
{"rating", MD_RATING, "0", false, "rating"}, {"thumbnail", MD_IMAGE_PATH, "", false, "thumbnail", "enter path to thumbnail"},
{"releasedate", MD_DATE, "0", false, "release date"}, {"rating", MD_RATING, "0", false, "rating", "enter rating"},
{"developer", MD_STRING, "unknown", false, "developer"}, {"releasedate", MD_DATE, "0", false, "release date", "enter release date"},
{"publisher", MD_STRING, "unknown", false, "publisher"}, {"developer", MD_STRING, "unknown", false, "developer", "enter game developer"},
{"genre", MD_STRING, "unknown", false, "genre"}, {"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher"},
{"players", MD_INT, "1", false, "players"}, {"genre", MD_STRING, "unknown", false, "genre", "enter game genre"},
{"playcount", MD_INT, "0", true, "play count"}, {"players", MD_INT, "1", false, "players", "enter number of players"},
{"lastplayed", MD_TIME, "0", true, "last played"} {"playcount", MD_INT, "0", true, "play count", "enter number of times played"},
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date"}
}; };
const std::vector<MetaDataDecl> gameMDD(gameDecls, gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0])); const std::vector<MetaDataDecl> gameMDD(gameDecls, gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0]));

View file

@ -28,6 +28,7 @@ struct MetaDataDecl
std::string defaultValue; std::string defaultValue;
bool isStatistic; //if true, ignore scraper values for this metadata bool isStatistic; //if true, ignore scraper values for this metadata
std::string displayName; // displayed as this in editors std::string displayName; // displayed as this in editors
std::string displayPrompt; // phrase displayed in editors when prompted to enter value (currently only for strings)
}; };
boost::posix_time::ptime string_to_ptime(const std::string& str, const std::string& fmt = "%Y%m%dT%H%M%S%F%q"); boost::posix_time::ptime string_to_ptime(const std::string& str, const std::string& fmt = "%Y%m%dT%H%M%S%F%q");

View file

@ -111,7 +111,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector
row.addElement(bracket, false); row.addElement(bracket, false);
bool multiLine = iter->type == MD_MULTILINE_STRING; bool multiLine = iter->type == MD_MULTILINE_STRING;
const std::string title = "INPUT GAME " + iter->key; const std::string title = iter->displayPrompt;
auto updateVal = [ed](const std::string& newVal) { ed->setValue(newVal); }; // ok callback (apply new value to ed) auto updateVal = [ed](const std::string& newVal) { ed->setValue(newVal); }; // ok callback (apply new value to ed)
row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] { row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] {
mWindow->pushGui(new GuiTextEditPopup(mWindow, title, ed->getValue(), updateVal, multiLine)); mWindow->pushGui(new GuiTextEditPopup(mWindow, title, ed->getValue(), updateVal, multiLine));