From 76e5fd4834c865c0d8cb4b1c48214ad3cc0b06a3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 23 Aug 2024 16:32:37 -0400 Subject: [PATCH] Add summary charts help button --- forms/wildmonchart.ui | 19 ++++++++++++++++--- include/ui/wildmonchart.h | 2 ++ resources/icons/help.ico | Bin 0 -> 2271 bytes resources/images.qrc | 1 + src/ui/wildmonchart.cpp | 15 ++++++++++++++- 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100755 resources/icons/help.ico 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 @@
QtCharts
- + + + 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 0000000000000000000000000000000000000000..68f51bac41f5c0f5b1c9580bc9ee012c480aadc6 GIT binary patch literal 2271 zcmV<52q5=~P)g4LrApCOKh#d!=@; zWh)jmd$6Fz1B<30m&?O2a>yBZ#FIL%`6e(lI*GHF{V=k6kCdF)6#UzZgQO?_RRAc} zPw)GaqFG*e`iT`-yRrp#3*fW^b{l!iTJr@V`^e^iNZi0gB!dvinZ6r1dc2>3{3ZDQ z)|cpd?tTDhmD@h_Em_!5|J+ln(O9FRsvJ0RDU1`n{ zUW=t|RT#OMM87YL&pz+Rs6R9|vG=JKx~AU?0IhuM{^2c;uV`4mZUGuSz%_pYzx(JM z!qXXOiVRtiDBse|%Xtxvy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7m=xH zWT!?BM2`RQJ$l3ilq+3roFuKDAM882cu`Yz=b}11wz>&dN5dEiMoFPOlV9c$o&h|R zOz#V8T1nB-ztt`WjrTI_I(!jhGzsW{^COMJED# zwrwOEBP3CCFH~;pmJCnZL~r+}>4x=BPDRr8(J3A-Dwem^iYivbFd^3DW;FK&(qbc{ zZl?{kvBE(;%ll)7u=5*eEI5h^}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);