diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-10 14:17:38 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2025-01-10 14:17:38 +0100 |
commit | 52c838538d2271134a2c5a128074ea9c2ed1d4a3 (patch) | |
tree | fd85a4193f88ec48c77d6fbfd90e909ac3a5855c /game/menus/ButtonReplaySubScript.cpp | |
parent | 15a958a7f327bb2e81e7d445f1499ec78c7f5839 (diff) | |
parent | bb2db93bfb8dd7e080d2708548eae660e6b33913 (diff) |
Merge branch 'master' into niels/game
Diffstat (limited to 'game/menus/ButtonReplaySubScript.cpp')
-rw-r--r-- | game/menus/ButtonReplaySubScript.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/game/menus/ButtonReplaySubScript.cpp b/game/menus/ButtonReplaySubScript.cpp index 9308350..55e718d 100644 --- a/game/menus/ButtonReplaySubScript.cpp +++ b/game/menus/ButtonReplaySubScript.cpp @@ -1,4 +1,5 @@ #include "ButtonReplaySubScript.h" +#include "Config.h" #include "MenusConfig.h" #include "../Events.h" @@ -16,15 +17,27 @@ 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(); + }); + if(DISABLE_REPLAY)return; replay.record_start(); } bool ButtonReplaySubScript::on_button_press(const ButtonPressEvent & e) { + if(DISABLE_REPLAY)return false; replay.play(this->recording); return false; } bool ButtonReplaySubScript::set_recording() { + if(DISABLE_REPLAY)return false; this->recording = replay.record_end(); return false; } + +bool ButtonReplaySubScript::delete_recording() { + if(DISABLE_REPLAY)return false; + replay.release(this->recording); + return false; +} |