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;
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace fs = boost::filesystem;
|
|||
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++)
|
||||
{
|
||||
|
@ -75,13 +73,12 @@ bool parseArgs(int argc, char* argv[], unsigned int* width, unsigned int* height
|
|||
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 << "--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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -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