mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Added an error if the <systemList> tag is missing.
Made SystemView more themable (added a ThemeExtras component, made theming on pre-existing elements less restrictive).
This commit is contained in:
parent
5a84bc03ea
commit
81a9941645
|
@ -200,8 +200,8 @@ Reference
|
|||
* image name="header" - POSITION | SIZE | PATH
|
||||
|
||||
#### system
|
||||
* image name="header" - PATH
|
||||
* image name="system" - PATH
|
||||
* image name="header" - ALL
|
||||
* image name="system" - ALL
|
||||
|
||||
#### menu
|
||||
* ninepatch name="background" - PATH
|
||||
|
|
|
@ -238,6 +238,12 @@ bool SystemData::loadConfig(const std::string& path, bool writeExample)
|
|||
//actually read the file
|
||||
pugi::xml_node systemList = doc.child("systemList");
|
||||
|
||||
if(!systemList)
|
||||
{
|
||||
LOG(LogError) << "es_systems.cfg is missing the <systemList> tag!";
|
||||
return false;
|
||||
}
|
||||
|
||||
for(pugi::xml_node system = systemList.child("system"); system; system = system.next_sibling("system"))
|
||||
{
|
||||
std::string name, fullname, path, cmd;
|
||||
|
|
105
src/main.cpp
105
src/main.cpp
|
@ -24,62 +24,59 @@ bool scrape_cmdline = false;
|
|||
|
||||
bool parseArgs(int argc, char* argv[], unsigned int* width, unsigned int* height)
|
||||
{
|
||||
if(argc > 1)
|
||||
for(int i = 1; i < argc; i++)
|
||||
{
|
||||
for(int i = 1; i < argc; i++)
|
||||
if(strcmp(argv[i], "-w") == 0)
|
||||
{
|
||||
if(strcmp(argv[i], "-w") == 0)
|
||||
{
|
||||
*width = atoi(argv[i + 1]);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "-h") == 0)
|
||||
{
|
||||
*height = atoi(argv[i + 1]);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "--gamelist-only") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("PARSEGAMELISTONLY", true);
|
||||
}else if(strcmp(argv[i], "--ignore-gamelist") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("IGNOREGAMELIST", true);
|
||||
}else if(strcmp(argv[i], "--draw-framerate") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DRAWFRAMERATE", true);
|
||||
}else if(strcmp(argv[i], "--no-exit") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DONTSHOWEXIT", true);
|
||||
}else if(strcmp(argv[i], "--debug") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DEBUG", true);
|
||||
Log::setReportingLevel(LogDebug);
|
||||
}else if(strcmp(argv[i], "--dimtime") == 0)
|
||||
{
|
||||
Settings::getInstance()->setInt("DIMTIME", atoi(argv[i + 1]) * 1000);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "--windowed") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("WINDOWED", true);
|
||||
}else if(strcmp(argv[i], "--scrape") == 0)
|
||||
{
|
||||
scrape_cmdline = true;
|
||||
}else if(strcmp(argv[i], "--help") == 0)
|
||||
{
|
||||
std::cout << "EmulationStation, a graphical front-end for ROM browsing.\n";
|
||||
std::cout << "Command line arguments:\n";
|
||||
std::cout << "-w [width in pixels] set screen width\n";
|
||||
std::cout << "-h [height in pixels] set screen height\n";
|
||||
std::cout << "--gamelist-only skip automatic game detection, only read from gamelist.xml\n";
|
||||
std::cout << "--ignore-gamelist ignore the gamelist (useful for troubleshooting)\n";
|
||||
std::cout << "--draw-framerate display the framerate\n";
|
||||
std::cout << "--no-exit don't show the exit option in the menu\n";
|
||||
std::cout << "--debug even more logging\n";
|
||||
std::cout << "--dimtime [seconds] time to wait before dimming the screen (default 30, use 0 for never)\n";
|
||||
std::cout << "--scrape scrape using command line interface\n";
|
||||
std::cout << "--windowed not fullscreen\n";
|
||||
std::cout << "--help summon a sentient, angry tuba\n\n";
|
||||
std::cout << "More information available in README.md.\n";
|
||||
return false; //exit after printing help
|
||||
}
|
||||
*width = atoi(argv[i + 1]);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "-h") == 0)
|
||||
{
|
||||
*height = atoi(argv[i + 1]);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "--gamelist-only") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("PARSEGAMELISTONLY", true);
|
||||
}else if(strcmp(argv[i], "--ignore-gamelist") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("IGNOREGAMELIST", true);
|
||||
}else if(strcmp(argv[i], "--draw-framerate") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DRAWFRAMERATE", true);
|
||||
}else if(strcmp(argv[i], "--no-exit") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DONTSHOWEXIT", true);
|
||||
}else if(strcmp(argv[i], "--debug") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("DEBUG", true);
|
||||
Log::setReportingLevel(LogDebug);
|
||||
}else if(strcmp(argv[i], "--dimtime") == 0)
|
||||
{
|
||||
Settings::getInstance()->setInt("DIMTIME", atoi(argv[i + 1]) * 1000);
|
||||
i++; //skip the argument value
|
||||
}else if(strcmp(argv[i], "--windowed") == 0)
|
||||
{
|
||||
Settings::getInstance()->setBool("WINDOWED", true);
|
||||
}else if(strcmp(argv[i], "--scrape") == 0)
|
||||
{
|
||||
scrape_cmdline = true;
|
||||
}else if(strcmp(argv[i], "--help") == 0)
|
||||
{
|
||||
std::cout << "EmulationStation, a graphical front-end for ROM browsing.\n";
|
||||
std::cout << "Command line arguments:\n";
|
||||
std::cout << "-w [width in pixels] set screen width\n";
|
||||
std::cout << "-h [height in pixels] set screen height\n";
|
||||
std::cout << "--gamelist-only skip automatic game detection, only read from gamelist.xml\n";
|
||||
std::cout << "--ignore-gamelist ignore the gamelist (useful for troubleshooting)\n";
|
||||
std::cout << "--draw-framerate display the framerate\n";
|
||||
std::cout << "--no-exit don't show the exit option in the menu\n";
|
||||
std::cout << "--debug even more logging\n";
|
||||
std::cout << "--dimtime [seconds] time to wait before dimming the screen (default 30, use 0 for never)\n";
|
||||
std::cout << "--scrape scrape using command line interface\n";
|
||||
std::cout << "--windowed not fullscreen, should be used in conjunction with -w and -h\n";
|
||||
std::cout << "--help summon a sentient, angry tuba\n\n";
|
||||
std::cout << "More information available in README.md.\n";
|
||||
return false; //exit after printing help
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@ SystemView::SystemView(Window* window, SystemData* system) : GuiComponent(window
|
|||
|
||||
mHeaderImage(window),
|
||||
mHeaderText(window),
|
||||
mImage(window)
|
||||
mImage(window),
|
||||
mExtras(window)
|
||||
{
|
||||
setSize((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight());
|
||||
|
||||
|
@ -26,6 +27,7 @@ SystemView::SystemView(Window* window, SystemData* system) : GuiComponent(window
|
|||
mImage.setPosition(mSize.x() / 2, mSize.y() * 0.6f);
|
||||
mImage.setResize(0, mSize.y() * 0.8f, false);
|
||||
|
||||
addChild(&mExtras);
|
||||
addChild(&mImage);
|
||||
addChild(&mHeaderText);
|
||||
addChild(&mHeaderImage);
|
||||
|
@ -37,8 +39,10 @@ void SystemView::updateData()
|
|||
{
|
||||
using namespace ThemeFlags;
|
||||
|
||||
mExtras.setExtras(ThemeData::makeExtras(mSystem->getTheme(), "system", mWindow));
|
||||
|
||||
mHeaderImage.setImage("");
|
||||
mHeaderImage.applyTheme(mSystem->getTheme(), "system", "header", PATH);
|
||||
mHeaderImage.applyTheme(mSystem->getTheme(), "system", "header", ALL);
|
||||
|
||||
// header
|
||||
if(mHeaderImage.hasImage())
|
||||
|
@ -51,7 +55,7 @@ void SystemView::updateData()
|
|||
mHeaderText.setText(mSystem->getFullName());
|
||||
}
|
||||
|
||||
mImage.applyTheme(mSystem->getTheme(), "system", "system", PATH);
|
||||
mImage.applyTheme(mSystem->getTheme(), "system", "system", ALL);
|
||||
}
|
||||
|
||||
bool SystemView::input(InputConfig* config, Input input)
|
||||
|
|
|
@ -22,4 +22,5 @@ private:
|
|||
TextComponent mHeaderText;
|
||||
ImageComponent mHeaderImage;
|
||||
ImageComponent mImage;
|
||||
ThemeExtras mExtras;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue