aboutsummaryrefslogtreecommitdiff
path: root/game/preview
diff options
context:
space:
mode:
authorheavydemon21 <48092678+heavydemon21@users.noreply.github.com>2025-01-10 14:44:59 +0100
committerGitHub <noreply@github.com>2025-01-10 14:44:59 +0100
commit798237b661e8e49284e78ffb1a16599cf6a46a6d (patch)
tree8f4881cf4abc58774625383620cf82fa55b9d1f0 /game/preview
parentbb2db93bfb8dd7e080d2708548eae660e6b33913 (diff)
parentd1cebcca2018ed4ef47ad125e45aafd018a2ab2e (diff)
Merge pull request #125 from lonkaars/niels/game
missile alerts
Diffstat (limited to 'game/preview')
-rw-r--r--game/preview/PreviewReplaySubScript.cpp19
-rw-r--r--game/preview/PreviewReplaySubScript.h1
-rw-r--r--game/preview/PreviewStartRecSubScript.cpp1
-rw-r--r--game/preview/PreviewStopRecSubScript.cpp1
4 files changed, 10 insertions, 12 deletions
diff --git a/game/preview/PreviewReplaySubScript.cpp b/game/preview/PreviewReplaySubScript.cpp
index 51c27aa..580a608 100644
--- a/game/preview/PreviewReplaySubScript.cpp
+++ b/game/preview/PreviewReplaySubScript.cpp
@@ -21,17 +21,16 @@ void PreviewReplaySubScript::init() {
this->subscribe<StartPreviewRecording>([this](const StartPreviewRecording & e) {
return this->start_recording();
});
-
}
bool PreviewReplaySubScript::on_button_press(const ButtonPressEvent & e) {
- if(DISABLE_REPLAY)return false;
+ if (DISABLE_REPLAY) return false;
replay.play(this->recording);
return false;
}
-bool PreviewReplaySubScript::start_recording(){
- if(DISABLE_REPLAY)return false;
- if(record_saved){
+bool PreviewReplaySubScript::start_recording() {
+ if (DISABLE_REPLAY) return false;
+ if (record_saved) {
this->stop_recording();
this->delete_recording();
}
@@ -41,16 +40,16 @@ bool PreviewReplaySubScript::start_recording(){
}
bool PreviewReplaySubScript::stop_recording() {
- if(DISABLE_REPLAY)return false;
- if(this->record_started)this->recording = replay.record_end();
+ if (DISABLE_REPLAY) return false;
+ if (this->record_started) this->recording = replay.record_end();
this->record_saved = true;
return false;
}
bool PreviewReplaySubScript::delete_recording() {
- if(DISABLE_REPLAY)return false;
- if(this->record_started) this->stop_recording();
- if(this->record_saved)replay.release(this->recording);
+ if (DISABLE_REPLAY) return false;
+ if (this->record_started) this->stop_recording();
+ if (this->record_saved) replay.release(this->recording);
this->record_saved = false;
return false;
}
diff --git a/game/preview/PreviewReplaySubScript.h b/game/preview/PreviewReplaySubScript.h
index ca5bd08..59b78c3 100644
--- a/game/preview/PreviewReplaySubScript.h
+++ b/game/preview/PreviewReplaySubScript.h
@@ -17,6 +17,7 @@ private:
bool start_recording();
bool stop_recording();
bool delete_recording();
+
private:
bool record_saved = false;
bool record_started = false;
diff --git a/game/preview/PreviewStartRecSubScript.cpp b/game/preview/PreviewStartRecSubScript.cpp
index 194f849..8a2f54c 100644
--- a/game/preview/PreviewStartRecSubScript.cpp
+++ b/game/preview/PreviewStartRecSubScript.cpp
@@ -12,7 +12,6 @@ void PreviewStartRecSubScript::init() {
this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent & e) {
return this->on_button_press(e);
});
-
}
bool PreviewStartRecSubScript::on_button_press(const ButtonPressEvent & e) {
diff --git a/game/preview/PreviewStopRecSubScript.cpp b/game/preview/PreviewStopRecSubScript.cpp
index c674a8b..a229da8 100644
--- a/game/preview/PreviewStopRecSubScript.cpp
+++ b/game/preview/PreviewStopRecSubScript.cpp
@@ -12,7 +12,6 @@ void PreviewStopRecSubScript::init() {
this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent & e) {
return this->on_button_press(e);
});
-
}
bool PreviewStopRecSubScript::on_button_press(const ButtonPressEvent & e) {