Skip to content

Commit

Permalink
feat(ui): Added a main menu button to open the saves folder (endless-…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrovw authored Dec 9, 2023
1 parent 1e802eb commit 5c81384
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions data/_ui/interfaces.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,13 @@ interface "load menu"
button d "_Delete"
center -285 155
dimensions 90 30

sprite "ui/wide button"
center -435 195
active
button o "_Open Saves"
center -435 195
dimensions 120 30

active if "pilot alive"
button a "_Add Snapshot"
Expand Down
8 changes: 8 additions & 0 deletions source/Files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,14 @@ void Files::OpenUserPluginFolder()



// Open this user's save file directory in their native file explorer.
void Files::OpenUserSavesFolder()
{
OpenFolder(savePath);
}



void Files::LogErrorToFile(const string &message)
{
if(!errorLog)
Expand Down
2 changes: 2 additions & 0 deletions source/Files.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class Files {

// Open this user's plugins directory in their native file explorer.
static void OpenUserPluginFolder();
// Open this user's save file directory in their native file explorer.
static void OpenUserSavesFolder();

// Logging to the error-log. Actual calls should be done through Logger
// and not directly here to ensure that other logging actions also
Expand Down
2 changes: 2 additions & 0 deletions source/LoadPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ bool LoadPanel::KeyDown(SDL_Keycode key, Uint16 mod, const Command &command, boo
"Any progress will be lost, unless you have saved other snapshots. "
"Are you sure you want to do that?"));
}
else if(key == 'o')
Files::OpenUserSavesFolder();
else if(key == 'b' || command.Has(Command::MENU) || (key == 'w' && (mod & (KMOD_CTRL | KMOD_GUI))))
GetUI()->Pop(this);
else if((key == SDLK_DOWN || key == SDLK_UP) && !files.empty())
Expand Down

0 comments on commit 5c81384

Please sign in to comment.