diff --git a/include/aoevidencedisplay.h b/include/aoevidencedisplay.h index df4a03778..c4f15af82 100644 --- a/include/aoevidencedisplay.h +++ b/include/aoevidencedisplay.h @@ -19,6 +19,7 @@ class AOEvidenceDisplay : public QLabel { void reset(); void combo_resize(int w, int h); + int last_evidence_index = -1; signals: void show_evidence_details(int index); @@ -27,7 +28,6 @@ class AOEvidenceDisplay : public QLabel { InterfaceLayer *evidence_movie; QPushButton *evidence_icon; AOSfxPlayer *sfx_player; - int last_evidence_index = -1; private slots: void show_done(); diff --git a/src/aoevidencedisplay.cpp b/src/aoevidencedisplay.cpp index ed27c0077..5c12a1448 100644 --- a/src/aoevidencedisplay.cpp +++ b/src/aoevidencedisplay.cpp @@ -66,6 +66,7 @@ void AOEvidenceDisplay::reset() evidence_movie->kill(); evidence_icon->hide(); this->clear(); + last_evidence_index = -1; } void AOEvidenceDisplay::show_done() { evidence_icon->show(); } diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 144371339..dd115025b 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2654,7 +2654,9 @@ void Courtroom::unpack_chatmessage(QStringList p_contents) evidence_presented = false; ui_vp_objection->stop(); chat_tick_timer->stop(); - ui_vp_evidence_display->reset(); + if (ui_vp_evidence_display->last_evidence_index != m_chatmessage[EVIDENCE_ID].toInt()) + ui_vp_evidence_display->reset(); + // This chat msg is not objection so we're not waiting on the objection animation to finish to display the character. if (!handle_objection()) handle_ic_message(); @@ -2748,7 +2750,7 @@ void Courtroom::log_chatmessage(QString f_message, int f_char_id, QString f_show } // If the evidence ID is in the valid range - if (f_evi_id > 0 && f_evi_id <= local_evidence_list.size()) { + if (f_evi_id != ui_vp_evidence_display->last_evidence_index && f_evi_id > 0 && f_evi_id <= local_evidence_list.size()) { blankpost = false; // Obtain the evidence name QString f_evi_name = local_evidence_list.at(f_evi_id - 1).name; @@ -3483,6 +3485,9 @@ void Courtroom::display_evidence_image() { QString side = m_chatmessage[SIDE]; int f_evi_id = m_chatmessage[EVIDENCE_ID].toInt(); + if (current_side == side && f_evi_id == ui_vp_evidence_display->last_evidence_index) + return; + if (f_evi_id > 0 && f_evi_id <= local_evidence_list.size()) { // shifted by 1 because 0 is no evidence per legacy standards QString f_image = local_evidence_list.at(f_evi_id - 1).image;