diff --git a/forms/wildmonchart.ui b/forms/wildmonchart.ui
index 87d626ed..488e066e 100644
--- a/forms/wildmonchart.ui
+++ b/forms/wildmonchart.ui
@@ -58,6 +58,17 @@
+ -
+
+
+ ...
+
+
+
+ :/icons/help.ico:/icons/help.ico
+
+
+
@@ -66,7 +77,7 @@
0
-
+
Species Distribution
@@ -89,7 +100,7 @@
-
+
Level Distribution
@@ -227,6 +238,8 @@
-
+
+
+
diff --git a/include/ui/wildmonchart.h b/include/ui/wildmonchart.h
index 58371219..087eb3ea 100644
--- a/include/ui/wildmonchart.h
+++ b/include/ui/wildmonchart.h
@@ -64,6 +64,8 @@ private:
QChart::ChartTheme currentTheme() const;
void updateTheme();
void stopChartAnimation();
+
+ void showHelpDialog();
};
#endif // WILDMONCHART_H
diff --git a/resources/icons/help.ico b/resources/icons/help.ico
new file mode 100755
index 00000000..68f51bac
Binary files /dev/null and b/resources/icons/help.ico differ
diff --git a/resources/images.qrc b/resources/images.qrc
index 86d56cb2..7a2bc4d6 100644
--- a/resources/images.qrc
+++ b/resources/images.qrc
@@ -16,6 +16,7 @@
icons/folder_map_opened.ico
icons/folder_map.ico
icons/folder.ico
+ icons/help.ico
icons/map_edited.ico
icons/map_opened.ico
icons/map.ico
diff --git a/src/ui/wildmonchart.cpp b/src/ui/wildmonchart.cpp
index 9c1a17d5..a69f2f2b 100644
--- a/src/ui/wildmonchart.cpp
+++ b/src/ui/wildmonchart.cpp
@@ -5,7 +5,6 @@
#include "log.h"
// TODO: Draw species icons below legend icons?
-// TODO: Help button that explains the charts
static const QString baseWindowTitle = QString("Wild Pokémon Summary Charts");
@@ -28,6 +27,8 @@ WildMonChart::WildMonChart(QWidget *parent, const EncounterTableModel *table) :
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(Qt::Window);
+ connect(ui->button_Help, &QAbstractButton::clicked, this, &WildMonChart::showHelpDialog);
+
// Changing these settings changes which level distribution chart is shown
connect(ui->groupBox_Species, &QGroupBox::clicked, this, &WildMonChart::createLevelDistributionChart);
connect(ui->comboBox_Species, &QComboBox::currentTextChanged, this, &WildMonChart::createLevelDistributionChart);
@@ -408,6 +409,18 @@ void WildMonChart::stopChartAnimation() {
ui->chartView_SpeciesDistribution->chart()->setAnimationOptions(QChart::NoAnimation);
}
+void WildMonChart::showHelpDialog() {
+ static const QString text = "This window provides some visualizations of the data in your current Wild Pokémon tab";
+ static const QString informative = "The Species Distribution tab shows the cumulative encounter chance for each species "
+ "in the table. In other words, it answers the question \"For a given encounter of this type, "
+ "what is the likelihood that the pokémon encountered will be of that species?\"
"
+ "The Level Distribution tab..."; // TODO
+ QMessageBox msgBox(QMessageBox::Information, "porymap", text, QMessageBox::Close, this);
+ msgBox.setTextFormat(Qt::RichText);
+ msgBox.setInformativeText(informative);
+ msgBox.exec();
+}
+
void WildMonChart::closeEvent(QCloseEvent *event) {
porymapConfig.wildMonChartGeometry = saveGeometry();
QWidget::closeEvent(event);