Added --no-exit switch.

This switch will keep ES from displaying the "Exit" option in the menu.
This commit is contained in:
Aloshi 2012-12-18 09:20:13 -06:00
parent 529c3a24c7
commit af36932f30
3 changed files with 23 additions and 2 deletions

View file

@ -49,7 +49,7 @@ EmulationStation will return once your system's command terminates (i.e. your em
**Keyboard mappings:**
```
Up - Scroll up
Down - Scroll down
@ -71,9 +71,20 @@ F1 - Open the restart/shutdown system menu
F2 - Open the fast select dialog
F4 - Close EmulationStation (should work as long as ES hasn't frozen)
```
Unfortunately, there is no built-in way to change keyboard mappings - if you need to, check out `src/InputManager.cpp`. There's a switch statement with a list of keys; it should be pretty simple to change them.
You can use `--help` to view a list of command-line options. Briefly outlined here:
```
-w [width] - specify resolution width.
-h [height] - specify resolution height.
--gamelist-only - only display games defined in a gamelist.xml file.
--ignore-gamelist - do not parse any gamelist.xml files.
--draw-framerate - draw the framerate.
--no-exit - do not display 'exit' in the ES menu.
```
Writing an es_systems.cfg
=========================
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.

View file

@ -2,6 +2,9 @@
#include <iostream>
#include <SDL/SDL.h>
//defined in main.cpp
extern bool DONTSHOWEXIT;
GuiMenu::GuiMenu(GuiComponent* parent)
{
mParent = parent;
@ -71,7 +74,9 @@ void GuiMenu::populateList()
//if you want to do something special within ES, override your command in the executeComand() method
mList->addObject("Restart", "sudo shutdown -r now", 0x0000FFFF);
mList->addObject("Shutdown", "sudo shutdown -h now", 0x0000FFFF);
mList->addObject("Exit", "exit", 0xFF0000FF); //a special case; pushes an SDL quit event to the event stack instead of being called by system()
if(!DONTSHOWEXIT)
mList->addObject("Exit", "exit", 0xFF0000FF); //a special case; pushes an SDL quit event to the event stack instead of being called by system()
}
void GuiMenu::onRender()

View file

@ -20,6 +20,7 @@
bool PARSEGAMELISTONLY = false;
bool IGNOREGAMELIST = false;
bool DRAWFRAMERATE = false;
bool DONTSHOWEXIT = false;
namespace fs = boost::filesystem;
@ -48,6 +49,9 @@ int main(int argc, char* argv[])
}else if(strcmp(argv[i], "--draw-framerate") == 0)
{
DRAWFRAMERATE = true;
}else if(strcmp(argv[i], "--no-exit") == 0)
{
DONTSHOWEXIT = true;
}else if(strcmp(argv[i], "--help") == 0)
{
std::cout << "EmulationStation, a graphical front-end for ROM browsing.\n";
@ -57,6 +61,7 @@ int main(int argc, char* argv[])
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 << "--help summon a sentient, angry tuba\n\n";
std::cout << "More information available in README.md.\n";
return 0;