aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2022-01-08 15:28:30 -0600
committerGitHub <noreply@github.com>2022-01-08 15:28:30 -0600
commit6b064ddb42bec54448c297f5bfc3225480da4067 (patch)
tree91997094514ad4717c3b93da502e95455a670a3d
parentb519dbaae30644373d2906b6bdc95ac56f2c5768 (diff)
parent7389b5071b72ee9dec9f1cad20fb4563b25c6a2c (diff)
Merge pull request #632 from AttorneyOnline/fix/background-loop
Don't restart background if background is unchanged
-rw-r--r--src/aolayer.cpp6
-rw-r--r--src/courtroom.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/aolayer.cpp b/src/aolayer.cpp
index a5e1d9bd..ba7f2cb4 100644
--- a/src/aolayer.cpp
+++ b/src/aolayer.cpp
@@ -153,6 +153,12 @@ void BackgroundLayer::load_image(QString p_filename)
qDebug() << "[BackgroundLayer] BG loaded: " << p_filename;
#endif
QString final_path = ao_app->get_image_suffix(ao_app->get_background_path(p_filename));
+
+ if (final_path == last_path) {
+ // Don't restart background if background is unchanged
+ return;
+ }
+
start_playback(final_path);
play();
}
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 0bc4f25f..3fb691e9 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1377,8 +1377,6 @@ void Courtroom::set_background(QString p_background, bool display)
ui_vp_objection->stop();
chat_tick_timer->stop();
ui_vp_evidence_display->reset();
- ui_vp_background->kill();
- ui_vp_desk->kill();
QString f_side = current_side;
if (current_side == "")
f_side = ao_app->get_char_side(current_char);