Skip to content

Commit

Permalink
Game Load: added a convenient button in Load Game to open your saves …
Browse files Browse the repository at this point in the history
…folder

(cherry-picked from commit 802bbe8)
  • Loading branch information
Vultraz committed Oct 7, 2018
1 parent 0c63222 commit 1dd00c3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -35,6 +35,7 @@
### User Interface
* Swapped the position and formatting of game names and titles in the MP lobby.
* Made Faction Select button's purpose more clear in MP Staging.
* Added a convenient button in Load Game to open your saves folder.
### WML engine
* Support formula= key in [variable] ConditionalWML
* Support to_location in [move_unit], taking a location ID
Expand Down
15 changes: 15 additions & 0 deletions data/gui/window/game_load.cfg
Expand Up @@ -557,6 +557,21 @@
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "left"

[button]
id = "browse_saves_folder"
definition = "action_browse"

tooltip = _ "Open saves folder"
[/button]

[/column]

[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_alignment = "right"

[button]
Expand Down
5 changes: 5 additions & 0 deletions src/gui/dialogs/game_load.cpp
Expand Up @@ -16,6 +16,7 @@

#include "gui/dialogs/game_load.hpp"

#include "desktop/open.hpp"
#include "filesystem.hpp"
#include "formula/string_utils.hpp"
#include "gettext.hpp"
Expand Down Expand Up @@ -147,6 +148,10 @@ void game_load::pre_show(window& window)
std::bind(&game_load::delete_button_callback,
this, std::ref(window)));

connect_signal_mouse_left_click(
find_widget<button>(&window, "browse_saves_folder", false),
std::bind(&desktop::open_object, filesystem::get_saves_dir()));

display_savegame(window);
}

Expand Down

0 comments on commit 1dd00c3

Please sign in to comment.