aboutsummaryrefslogtreecommitdiff
path: root/game/menus/ButtonReplaySubScript.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-08 16:17:39 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-08 16:17:39 +0100
commit424da5eb1500d90389d939cd0b3e6e75d729578d (patch)
tree991094effc4a5261e5d2ab0771fdd38e95eca94f /game/menus/ButtonReplaySubScript.cpp
parente2f9c0bcaf22aa73689305faca70f2ec4682f55c (diff)
delete replay
Diffstat (limited to 'game/menus/ButtonReplaySubScript.cpp')
-rw-r--r--game/menus/ButtonReplaySubScript.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/game/menus/ButtonReplaySubScript.cpp b/game/menus/ButtonReplaySubScript.cpp
index 9308350..ddd9fa4 100644
--- a/game/menus/ButtonReplaySubScript.cpp
+++ b/game/menus/ButtonReplaySubScript.cpp
@@ -16,6 +16,9 @@ void ButtonReplaySubScript::init() {
this->subscribe<EndGameEvent>([this](const EndGameEvent & e) {
return this->set_recording();
});
+ this->subscribe<DeleteRecordingEvent>([this](const DeleteRecordingEvent & e) {
+ return this->delete_recording();
+ });
replay.record_start();
}
@@ -28,3 +31,8 @@ bool ButtonReplaySubScript::set_recording() {
this->recording = replay.record_end();
return false;
}
+
+bool ButtonReplaySubScript::delete_recording() {
+ replay.release(this->recording);
+ return false;
+}