diff --git a/README.md b/README.md index 3128c1f9d..29c6e1fff 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,11 @@ Unfortunately, there is no built-in way to change keyboard mappings - if you nee Writing an es_systems.cfg ========================= -The file `~/.emulationstation/es_systems.cfg` contains the system configuration data for EmulationStation. A system is a NAME, PATH, EXTENSION, and COMMAND. You can define any number of systems. You can switch between them by pressing left and right. They will cycle in the order they are defined. +The file `~/.emulationstation/es_systems.cfg` contains the system configuration data for EmulationStation. A system is a NAME, DESCNAME, PATH, EXTENSION, and COMMAND. You can define any number of systems. You can switch between them by pressing left and right. They will cycle in the order they are defined. -The NAME is what ES will show in the header if you're not using a theme. +The NAME is what ES will use to internally identify the system. Theme.xml and gamelist.xml files will also be searched for in `~/.emulationstation/NAME/` if not found at the root of PATH. It is recommended that you abbreviate here if necessary, e.g. "nes". + +The DESCNAME is a "pretty" name for the system - it show up in a header if one is displayed. It is optional; if not supplied, it will copy NAME (note: DESCNAME must also *not* be the last tag you define for a system! This is due to the nature of how optional tags are implemented.). The PATH is where ES will start the search for ROMs. All subdirectories (and links!) will be included. @@ -97,7 +99,7 @@ The following "tags" are replaced by ES in COMMANDs: gamelist.xml ============ -If a file named gamelist.xml is found in the root of a system's search directory, it will be parsed and the detailed GuiGameList will be used. This means you can define images, descriptions, and different names for files. Note that only standard ASCII characters are supported (if you see a weird [X] symbol, you're probably using unicode!). +If a file named gamelist.xml is found in the root of a system's search directory OR within `~/.emulationstation/%NAME%/`, it will be parsed and the detailed GuiGameList will be used. This means you can define images, descriptions, and different names for files. Note that only standard ASCII characters are supported (if you see a weird [X] symbol, you're probably using unicode!). Images will be automatically resized to fit within the left column of the screen. Smaller images will load faster, so try to keep your resolution low. An example gamelist.xml: ``` diff --git a/THEMES.md b/THEMES.md index 0d1d9be66..5cfd37d65 100644 --- a/THEMES.md +++ b/THEMES.md @@ -4,7 +4,7 @@ Themes EmulationStation allows each system to have its own "theme." A theme is a collection of display settings and images defined in an XML document. ES will check 3 places for a theme, in the following order: - - a theme.xml file in the sysytem's %PATH% directory. + - a theme.xml file in the root of a system's %PATH% directory. - $HOME/.emulationstation/%NAME%/theme.xml - $HOME/.emulationstation/es_theme.xml diff --git a/src/SystemData.cpp b/src/SystemData.cpp index 15ffa8aa2..582b61c7a 100644 --- a/src/SystemData.cpp +++ b/src/SystemData.cpp @@ -18,10 +18,10 @@ extern bool IGNOREGAMELIST; std::string SystemData::getStartPath() { return mStartPath; } std::string SystemData::getExtension() { return mSearchExtension; } -SystemData::SystemData(std::string name, std::string desc, std::string startPath, std::string extension, std::string command) +SystemData::SystemData(std::string name, std::string descName, std::string startPath, std::string extension, std::string command) { mName = name; - mDesc = desc; + mDescName = descName; //expand home symbol if the startpath contains it if(startPath[0] == '~') @@ -158,9 +158,9 @@ std::string SystemData::getName() return mName; } -std::string SystemData::getDesc() +std::string SystemData::getDescName() { - return mDesc; + return mDescName; } //creates systems from information located in a config file @@ -176,7 +176,7 @@ void SystemData::loadConfig() if(file.is_open()) { std::string line; - std::string sysName, sysDesc, sysPath, sysExtension, sysCommand; + std::string sysName, sysDescName, sysPath, sysExtension, sysCommand; while(file.good()) { std::getline(file, line); @@ -204,8 +204,8 @@ void SystemData::loadConfig() //map the value to the appropriate variable if(varName == "NAME") sysName = varValue; - else if(varName == "DESC") - sysDesc = varValue; + else if(varName == "DESCNAME") + sysDescName = varValue; else if(varName == "PATH") { if(varValue[varValue.length() - 1] == '/') @@ -218,9 +218,12 @@ void SystemData::loadConfig() sysCommand = varValue; //we have all our variables - create the system object - if(!sysName.empty() && !sysDesc.empty() && !sysPath.empty() &&!sysExtension.empty() && !sysCommand.empty()) + if(!sysName.empty() && !sysPath.empty() &&!sysExtension.empty() && !sysCommand.empty()) { - SystemData* newSystem = new SystemData(sysName, sysDesc, sysPath, sysExtension, sysCommand); + if(sysDescName.empty()) + sysDescName = sysName; + + SystemData* newSystem = new SystemData(sysName, sysDescName, sysPath, sysExtension, sysCommand); if(newSystem->getRootFolder()->getFileCount() == 0) { std::cout << "System \"" << sysName << "\" has no games! Deleting.\n"; @@ -230,7 +233,7 @@ void SystemData::loadConfig() } //reset the variables for the next block (should there be one) - sysName = ""; sysDesc = ""; sysPath = ""; sysExtension = ""; sysCommand = "" ; + sysName = ""; sysDescName = ""; sysPath = ""; sysExtension = ""; sysCommand = "" ; } }else{ std::cerr << "Error reading config file \"" << path << "\" - no equals sign found on line \"" << line << "\"!\n"; @@ -256,20 +259,20 @@ void SystemData::writeExampleConfig() file << "# Lines that begin with a hash (#) are ignored, as are empty lines." << std::endl; file << "# A sample system might look like this:" << std::endl; file << "#NAME=nes" << std::endl; - file << "#DESC=Nintendo Entertainment System" << std::endl; + file << "#DESCNAME=Nintendo Entertainment System" << std::endl; file << "#PATH=~/ROMs/nes/" << std::endl; file << "#EXTENSION=.nes .NES" << std::endl; file << "#COMMAND=retroarch -L ~/cores/libretro-fceumm.so %ROM%" << std::endl << std::endl; - file << "#NAME is a short name used internaly." << std::endl; - file << "#DESC is just a pretty desciption to identify the system." << std::endl; + file << "#NAME is a short name used internally (and in alternative paths)." << std::endl; + file << "#DESCNAME is a descriptive name to identify the system. It may be displayed in a header." << std::endl; file << "#PATH is the path to start the recursive search for ROMs in. ~ will be expanded into the $HOME variable." << std::endl; file << "#EXTENSION is a list of extensions to search for, separated by spaces. You MUST include the period, and it must be exact - it's case sensitive, and no wildcards." << std::endl; file << "#COMMAND is the shell command to execute when a game is selected. %ROM% will be replaced with the (bash special-character escaped) path to the ROM." << std::endl << std::endl; file << "#Now try your own!" << std::endl; file << "NAME=" << std::endl; - file << "DESC=" << std::endl; + file << "DESCNAME=" << std::endl; file << "PATH=" << std::endl; file << "EXTENSION=" << std::endl; file << "COMMAND=" << std::endl; diff --git a/src/SystemData.h b/src/SystemData.h index 06b6c0a2e..15e6417eb 100644 --- a/src/SystemData.h +++ b/src/SystemData.h @@ -10,12 +10,12 @@ class GameData; class SystemData { public: - SystemData(std::string name, std::string desc, std::string startPath, std::string extension, std::string command); + SystemData(std::string name, std::string descName, std::string startPath, std::string extension, std::string command); ~SystemData(); FolderData* getRootFolder(); std::string getName(); - std::string getDesc(); + std::string getDescName(); std::string getStartPath(); std::string getExtension(); std::string getGamelistPath(); @@ -31,7 +31,7 @@ public: static std::vector sSystemVector; private: std::string mName; - std::string mDesc; + std::string mDescName; std::string mStartPath; std::string mSearchExtension; std::string mLaunchCommand; diff --git a/src/components/GuiGameList.cpp b/src/components/GuiGameList.cpp index 016a47aa4..1943fd6c1 100644 --- a/src/components/GuiGameList.cpp +++ b/src/components/GuiGameList.cpp @@ -91,7 +91,7 @@ void GuiGameList::onRender() //header if(!mTheme->getBool("hideHeader")) - Renderer::drawCenteredText(mSystem->getDesc(), 0, 1, 0xFF0000FF, Renderer::getDefaultFont(Renderer::LARGE)); + Renderer::drawCenteredText(mSystem->getDescName(), 0, 1, 0xFF0000FF, Renderer::getDefaultFont(Renderer::LARGE)); if(mDetailed) {