From fa5a0b44e3cba99f14cc88a92f66ad1f1084d786 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 16 Jun 2021 08:26:58 +0300 Subject: [PATCH 62/62] Ruledit: Add enabler count to stats See osdn #42176 Signed-off-by: Marko Lindqvist --- tools/ruledit/tab_misc.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/ruledit/tab_misc.cpp b/tools/ruledit/tab_misc.cpp index d3f7d19d19..5a7d68612f 100644 --- a/tools/ruledit/tab_misc.cpp +++ b/tools/ruledit/tab_misc.cpp @@ -115,7 +115,7 @@ tab_misc::tab_misc(ruledit_gui *ui_in) : QWidget() stats = new QTableWidget(this); stats->setColumnCount(8); - stats->setRowCount(6); + stats->setRowCount(7); item = new QTableWidgetItem(QString::fromUtf8(RQ_("?stat:Terrains"))); stats->setItem(0, 0, item); item = new QTableWidgetItem("-"); @@ -140,6 +140,10 @@ tab_misc::tab_misc(ruledit_gui *ui_in) : QWidget() stats->setItem(5, 0, item); item = new QTableWidgetItem("-"); stats->setItem(5, 1, item); + item = new QTableWidgetItem(QString::fromUtf8(RQ_("?stat:Enablers"))); + stats->setItem(6, 0, item); + item = new QTableWidgetItem("-"); + stats->setItem(6, 1, item); item = new QTableWidgetItem(QString::fromUtf8(RQ_("?stat:Buildings"))); stats->setItem(0, 3, item); item = new QTableWidgetItem("-"); @@ -319,6 +323,14 @@ void tab_misc::refresh_stats() } unit_type_re_active_iterate_end; stats->item(row++, 1)->setText(QString::number(count)); + count = 0; + action_iterate(act) { + action_enabler_list_re_iterate(action_enablers_for_action(act), enabler) { + count++; + } action_enabler_list_re_iterate_end; + } action_iterate_end; + stats->item(row++, 1)->setText(QString::number(count)); + // Second column row = 0; count = 0; -- 2.30.2