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

Add sysconfig platform #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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