Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
Add sysconfig platform to let user create custom scripts with certain…
Browse files Browse the repository at this point in the history
… extension in a specified "rom" directory.
  • Loading branch information
gillg committed Feb 9, 2017
1 parent 2765ba3 commit 49cc58e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
- Add new special platform ID for custom config scripts (eg. compatibility with retropiemenu)
- Ignore all known bios and devices for arcade/neogeo platform
- Fix Bug with small SHARE partition
- Add new Traditional Chinese Language
Expand Down
20 changes: 20 additions & 0 deletions SYSTEMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,23 @@ EmulationStation where:
<theme>psp</theme>
</system>
```

## System custom scripts / config

### [sysconfig]

You can create a "gamelist" which contains scripts.
You could imagine a script wraper to handle .sh .py, and others...
You could specify "sudo" in &lt;command&gt;, and imagine lot of things.
As for your games, you can add &lt;image&gt; in your gamelist.xml to add some icons.

``` xml
<system>
<name>myconfig</name>
<fullname>Configuration</fullname>
<path>/path/to/scripts</path>
<extension>.sh</extension>
<command>bash %ROM </dev/tty >/dev/tty</command>
<platform>sysconfig</platform>
</system>
```
2 changes: 2 additions & 0 deletions es-app/src/PlatformId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ namespace PlatformIds
"zx81",
"moonlight",

"sysconfig", //Specific external script handler for configuration

"ignore", // do not allow scraping for this system
"invalid"
};
Expand Down
2 changes: 2 additions & 0 deletions es-app/src/PlatformId.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ namespace PlatformIds
ZX_81,
MOONLIGHT,

SYSCONFIG, //Specific external script handler for configuration

PLATFORM_IGNORE, // do not allow scraping for this system
PLATFORM_COUNT
};
Expand Down
3 changes: 2 additions & 1 deletion es-app/src/guis/GuiMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ GuiMenu::GuiMenu(Window *window) : GuiComponent(window), mMenu(window, _("MAIN M
// For each activated system
std::vector<SystemData *> systems = SystemData::sSystemVector;
for (auto system = systems.begin(); system != systems.end(); system++) {
if ((*system) != SystemData::getFavoriteSystem()) {
if ((*system) != SystemData::getFavoriteSystem()
&& !(*system)->hasPlatformId(PlatformIds::SYSCONFIG)) {
ComponentListRow systemRow;
auto systemText = std::make_shared<TextComponent>(mWindow, (*system)->getFullName(),
Font::get(FONT_SIZE_MEDIUM),
Expand Down
2 changes: 1 addition & 1 deletion es-app/src/guis/GuiScraperStart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
mSystems = std::make_shared< OptionListComponent<SystemData*> >(mWindow, _("SCRAPE THESE SYSTEMS"), true);
for(auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++)
{
if(!(*it)->hasPlatformId(PlatformIds::PLATFORM_IGNORE))
if(!(*it)->hasPlatformId(PlatformIds::PLATFORM_IGNORE) && !(*it)->hasPlatformId(PlatformIds::SYSCONFIG))
mSystems->add((*it)->getFullName(), *it, !(*it)->getPlatformIds().empty());
}
mMenu.addWithLabel(_("SYSTEMS"), mSystems);
Expand Down
4 changes: 3 additions & 1 deletion es-app/src/views/SystemView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ void SystemView::onCursorChanged(const CursorState& state)
// also change the text after we've fully faded out
setAnimation(infoFadeOut, 0, [this, gameCount, favoritesCount, gameNoHiddenCount, hiddenCount] {
char strbuf[256];
if(favoritesCount == 0 && hiddenCount == 0) {
if (getSelected()->hasPlatformId(PlatformIds::SYSCONFIG)) {
snprintf(strbuf, 256, "%s", _("CONFIGURATION").c_str());
}else if(favoritesCount == 0 && hiddenCount == 0) {
snprintf(strbuf, 256, ngettext("%i GAME AVAILABLE", "%i GAMES AVAILABLE", gameNoHiddenCount).c_str(), gameNoHiddenCount);
}else if (favoritesCount != 0 && hiddenCount == 0) {
snprintf(strbuf, 256,
Expand Down

0 comments on commit 49cc58e

Please sign in to comment.