Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Resume Mode #15

Draft
wants to merge 9 commits into
base: knulli
Choose a base branch
from
Draft
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ Makefile
CPackConfig.cmake
CPackSourceConfig.cmake

# VS Code
/.vscode
*.code-workspace
/.vs/

# batocera
# po backup
*.po~
/.vs/
*.sqlite
.DS_Store
.DS_Store
10 changes: 10 additions & 0 deletions es-app/src/FileData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,16 @@ bool FileData::launchGame(Window* window, LaunchGameOptions options)
if (command.empty())
return false;

// KNULLI - QUICK RESUME MODE >>>
std::string quickResumeCommand = getlaunchCommand(false);
if (!quickResumeCommand.empty() && SystemConf::getInstance()->getBool("global.quickresume") == true)
{
SystemConf::getInstance()->set("global.bootgame.path", getFullPath());
SystemConf::getInstance()->set("global.bootgame.cmd", quickResumeCommand);
SystemConf::getInstance()->saveSystemConf();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, here you set the bootgame when launching a game... but where do you un-set it? Do you have a solution for that, yet? Or is this already taken care of anyway?

}
// KNULLI - QUICK RESUME MODE <<<

AudioManager::getInstance()->deinit();
VolumeControl::getInstance()->deinit();

Expand Down
8 changes: 8 additions & 0 deletions es-app/src/guis/GuiMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2743,6 +2743,14 @@ void GuiMenu::openGamesSettings()
s->addWithDescription(_("SHOW SAVESTATE MANAGER"), _("Display savestate manager before launching a game."), showSaveStates);
s->addSaveFunc([showSaveStates] { SystemConf::getInstance()->set("global.savestates", showSaveStates->getSelected()); });

// KNULLI - QUICK RESUME MODE >>>
// QUICK RESUME MODE
t0b10-r3tr0 marked this conversation as resolved.
Show resolved Hide resolved
auto quickresume_enabled = std::make_shared<SwitchComponent>(mWindow);
quickresume_enabled->setState(SystemConf::getInstance()->get("global.quickresume") == "1");
s->addWithDescription(_("QUICK RESUME MODE"), _("If shutdown during gameplay, boots directly into game on next startup. Works with Auto Save/Load on supported emulators."), quickresume_enabled);
s->addSaveFunc([quickresume_enabled] { SystemConf::getInstance()->set("global.quickresume", quickresume_enabled->getState() ? "1" : ""); });
// KNULLI - QUICK RESUME MODE <<<

s->addGroup(_("DEFAULT GLOBAL SETTINGS"));

// Screen ratio choice
Expand Down