diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-02-08 03:18:16 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-02-08 03:18:16 +0100 |
commit | 3d6354c642244cde272c328a31c72a0adba54999 (patch) | |
tree | 8a57ab0eb5a0e44edbb7842fa6207a5fe015407e | |
parent | efb5fc53c164612dfb53a68e432be87185e45175 (diff) |
m
-rw-r--r-- | include/Overlay.hpp | 1 | ||||
-rw-r--r-- | src/Overlay.cpp | 17 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/Overlay.hpp b/include/Overlay.hpp index b14db09..4fbf54e 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -80,6 +80,7 @@ namespace gsr { void update_notification_process_status(); void save_video_in_current_game_directory(const char *video_filepath, NotificationType notification_type); + void on_replay_saved(const char *replay_saved_filepath); void update_gsr_replay_save(); void update_gsr_process_status(); diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 6637350..47f41a9 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -1484,6 +1484,16 @@ namespace gsr { show_notification(text.c_str(), 3.0, mgl::Color(255, 255, 255), get_color_theme().tint_color, notification_type); } + void Overlay::on_replay_saved(const char *replay_saved_filepath) { + replay_save_show_notification = false; + if(config.replay_config.save_video_in_game_folder) { + save_video_in_current_game_directory(replay_saved_filepath, NotificationType::REPLAY); + } else { + const std::string text = "Saved replay to '" + filepath_get_filename(replay_saved_filepath) + "'"; + show_notification(text.c_str(), 3.0, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::REPLAY); + } + } + void Overlay::update_gsr_replay_save() { if(replay_save_show_notification && replay_save_clock.get_elapsed_time_seconds() >= replay_saving_notification_timeout_seconds) { replay_save_show_notification = false; @@ -1500,12 +1510,7 @@ namespace gsr { if(replay_saved_filepath[line_len - 1] == '\n') replay_saved_filepath[line_len - 1] = '\0'; - if(config.replay_config.save_video_in_game_folder) { - save_video_in_current_game_directory(replay_saved_filepath, NotificationType::REPLAY); - } else { - const std::string text = "Saved replay to '" + filepath_get_filename(replay_saved_filepath) + "'"; - show_notification(text.c_str(), 3.0, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::REPLAY); - } + on_replay_saved(replay_saved_filepath); } else if(gpu_screen_recorder_process_output_fd > 0) { char buffer[1024]; read(gpu_screen_recorder_process_output_fd, buffer, sizeof(buffer)); |