From 5abc685b47c7ebd9e8713c087f8c4f00d9c27396 Mon Sep 17 00:00:00 2001 From: Skye Deving <76892045+skyedeving@users.noreply.github.com> Date: Mon, 4 Jan 2021 19:49:40 -0600 Subject: [PATCH] Sort case evidence numerically before adding in inventories get displayed lexigraphically too but it is assumed to not matter --- include/courtroom.h | 1 + src/courtroom.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/courtroom.h b/include/courtroom.h index f05b15a..4e8d86f 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -58,6 +58,7 @@ #include //#include +#include #include class AOApplication; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 9518911..bcff915 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -3588,7 +3588,15 @@ void Courtroom::on_ooc_return_pressed() new AOPacket("DE#" + QString::number(i) + "#%")); } - foreach (QString evi, casefile.childGroups()) { + // sort the case_evidence numerically + QStringList case_evidence = casefile.childGroups(); + std::sort(case_evidence.begin(), case_evidence.end(), + [] (const QString &a, const QString &b) { + return a.toInt() < b.toInt(); + }); + + // load evidence + foreach (QString evi, case_evidence) { if (evi == "General") continue;