aboutsummaryrefslogtreecommitdiff
path: root/src/evidence.cpp
diff options
context:
space:
mode:
authorRosemary Witchaven <32779090+in1tiate@users.noreply.github.com>2022-05-21 09:21:34 -0500
committerGitHub <noreply@github.com>2022-05-21 16:21:34 +0200
commit94dbdf73e06c95144efc88fb6a74ddb517613186 (patch)
tree8d03f68720cbd99db43132c4535f9873e14d376c /src/evidence.cpp
parent8657f7c2a2fbcbce52b744de50159ac5cdcc0ae8 (diff)
Feature: Clicking the evidence icon when it's presented by a player will show the details of that evidence (#760)
* Add click-to-view evidence icons * Fix the clicky icon not being functional if the presented evidence comes from a different page from the first Co-authored-by: in1tiate <radwoodward@vikings.grayson.edu> Co-authored-by: Alex Noir <Varsash@gmail.com>
Diffstat (limited to 'src/evidence.cpp')
-rw-r--r--src/evidence.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/evidence.cpp b/src/evidence.cpp
index 084a79ce..a34f5fe1 100644
--- a/src/evidence.cpp
+++ b/src/evidence.cpp
@@ -370,6 +370,19 @@ void Courtroom::set_evidence_page()
}
}
+void Courtroom::show_evidence(int f_real_id)
+{
+ // Make sure we're in the global evidence list
+ evidence_switch(true);
+ // Set the evidence page properly
+ current_evidence_page = f_real_id / max_evidence_on_page;
+ set_evidence_page();
+ // Display the target evidence using the local ID
+ int p_id = f_real_id - (max_evidence_on_page * current_evidence_page);
+ on_evidence_double_clicked(p_id);
+}
+
+
void Courtroom::on_evidence_name_edited()
{
if (current_evidence >= local_evidence_list.size())
@@ -464,6 +477,7 @@ void Courtroom::on_evidence_double_clicked(int p_id)
ui_evidence_image_name->setReadOnly(false);
ui_evidence_image_name->setToolTip(tr("Click to edit..."));
+ ui_evidence->show();
ui_evidence_overlay->show();
ui_evidence_ok->hide();