diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-04-23 22:19:57 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-04-23 22:20:47 +0200 |
commit | 329ccdc970d31e2993226bac6bd784404357819d (patch) | |
tree | e7f3105f2305956d2cb82eefd5ca9e9324d772b9 /src/GlobalHotkeysJoystick.cpp | |
parent | b64b90d0b165a6364206fa6ee7918905afd76fe5 (diff) |
Save replay/streaming recording to correct location when saving to game folder. Add controller hotkey to save 1 min/10 min replayHEAD1.5.0master
Diffstat (limited to 'src/GlobalHotkeysJoystick.cpp')
-rw-r--r-- | src/GlobalHotkeysJoystick.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/GlobalHotkeysJoystick.cpp b/src/GlobalHotkeysJoystick.cpp index d005aa9..822a73a 100644 --- a/src/GlobalHotkeysJoystick.cpp +++ b/src/GlobalHotkeysJoystick.cpp @@ -7,6 +7,8 @@ namespace gsr { static constexpr int button_pressed = 1; + static constexpr int cross_button = 0; + static constexpr int triangle_button = 2; static constexpr int options_button = 9; static constexpr int playstation_button = 10; static constexpr int axis_up_down = 7; @@ -104,6 +106,20 @@ namespace gsr { it->second("save_replay"); } + if(save_1_min_replay) { + save_1_min_replay = false; + auto it = bound_actions_by_id.find("save_1_min_replay"); + if(it != bound_actions_by_id.end()) + it->second("save_1_min_replay"); + } + + if(save_10_min_replay) { + save_10_min_replay = false; + auto it = bound_actions_by_id.find("save_10_min_replay"); + if(it != bound_actions_by_id.end()) + it->second("save_10_min_replay"); + } + if(take_screenshot) { take_screenshot = false; auto it = bound_actions_by_id.find("take_screenshot"); @@ -186,10 +202,27 @@ namespace gsr { return; if((event.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) { - if(event.number == playstation_button) - playstation_button_pressed = event.value == button_pressed; - else if(playstation_button_pressed && event.number == options_button && event.value == button_pressed) - toggle_show = true; + switch(event.number) { + case playstation_button: { + playstation_button_pressed = event.value == button_pressed; + break; + } + case options_button: { + if(playstation_button_pressed && event.value == button_pressed) + toggle_show = true; + break; + } + case cross_button: { + if(playstation_button_pressed && event.value == button_pressed) + save_1_min_replay = true; + break; + } + case triangle_button: { + if(playstation_button_pressed && event.value == button_pressed) + save_10_min_replay = true; + break; + } + } } else if((event.type & JS_EVENT_AXIS) == JS_EVENT_AXIS && playstation_button_pressed) { const int trigger_threshold = 16383; const bool prev_up_pressed = up_pressed; |