aboutsummaryrefslogtreecommitdiff
path: root/src/Overlay.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-08 03:18:16 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-08 03:18:16 +0100
commit3d6354c642244cde272c328a31c72a0adba54999 (patch)
tree8a57ab0eb5a0e44edbb7842fa6207a5fe015407e /src/Overlay.cpp
parentefb5fc53c164612dfb53a68e432be87185e45175 (diff)
m
Diffstat (limited to 'src/Overlay.cpp')
-rw-r--r--src/Overlay.cpp17
1 files changed, 11 insertions, 6 deletions
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));