From f036fcbc0ff56dbab185d42c40f748e9c097bf22 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 24 Jan 2025 00:42:33 +0100 Subject: Add 'restart replay on save' option --- include/Config.hpp | 1 + include/GsrInfo.hpp | 17 ++++++ include/gui/SettingsPage.hpp | 2 + src/Config.cpp | 1 + src/GlobalHotkeysJoystick.cpp | 2 + src/GlobalHotkeysLinux.cpp | 6 +++ src/GsrInfo.cpp | 89 +++++++++++++++++++++++++++++++ src/Overlay.cpp | 5 ++ src/gui/GlobalSettingsPage.cpp | 10 ++-- src/gui/SettingsPage.cpp | 12 +++++ tools/gsr-global-hotkeys/keyboard_event.c | 4 +- 11 files changed, 144 insertions(+), 5 deletions(-) diff --git a/include/Config.hpp b/include/Config.hpp index 0d311b2..34c2010 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -90,6 +90,7 @@ namespace gsr { RecordOptions record_options; std::string turn_on_replay_automatically_mode = "dont_turn_on_automatically"; bool save_video_in_game_folder = false; + bool restart_replay_on_save = false; bool show_replay_started_notifications = true; bool show_replay_stopped_notifications = true; bool show_replay_saved_notifications = true; diff --git a/include/GsrInfo.hpp b/include/GsrInfo.hpp index 86df0b7..a8c0742 100644 --- a/include/GsrInfo.hpp +++ b/include/GsrInfo.hpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -24,6 +25,21 @@ namespace gsr { mgl::vec2i size; }; + struct GsrVersion { + uint8_t major = 0; + uint8_t minor = 0; + uint8_t patch = 0; + + bool operator>(const GsrVersion &other) const; + bool operator>=(const GsrVersion &other) const; + bool operator<(const GsrVersion &other) const; + bool operator<=(const GsrVersion &other) const; + bool operator==(const GsrVersion &other) const; + bool operator!=(const GsrVersion &other) const; + + std::string to_string() const; + }; + struct SupportedCaptureOptions { bool window = false; bool focused = false; @@ -40,6 +56,7 @@ namespace gsr { struct SystemInfo { DisplayServer display_server = DisplayServer::UNKNOWN; bool supports_app_audio = false; + GsrVersion gsr_version; }; enum class GpuVendor { diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index efa958e..8db3915 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -97,6 +97,7 @@ namespace gsr { std::unique_ptr create_replay_time(); std::unique_ptr create_start_replay_automatically(); std::unique_ptr create_save_replay_in_game_folder(); + std::unique_ptr create_restart_replay_on_save(); std::unique_ptr