diff --git a/forms/customscriptseditor.ui b/forms/customscriptseditor.ui index cc7dd4f1..e2efa2af 100644 --- a/forms/customscriptseditor.ui +++ b/forms/customscriptseditor.ui @@ -6,7 +6,7 @@ 0 0 - 540 + 582 355 @@ -33,21 +33,30 @@ - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised - QFrame::StyledPanel - - - QFrame::Raised + QFrame::Shape::StyledPanel + + 6 + + + 6 + + + 6 + + + 6 + @@ -91,9 +100,9 @@ - + - Qt::Horizontal + Qt::Orientation::Horizontal @@ -103,35 +112,33 @@ + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + ... + + + + :/icons/help.ico:/icons/help.ico + + + - - - - <html><head/><body><p><a href="https://huderlem.github.io/porymap/manual/scripting-capabilities.html"><span style=" text-decoration: underline; color:#0069d9;">Help</span></a></p></body></html> - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 5 - - - - @@ -142,32 +149,32 @@ - QAbstractItemView::NoEditTriggers + QAbstractItemView::EditTrigger::NoEditTriggers false - QAbstractItemView::DragOnly + QAbstractItemView::DragDropMode::DragOnly - Qt::IgnoreAction + Qt::DropAction::IgnoreAction - QAbstractItemView::ExtendedSelection + QAbstractItemView::SelectionMode::ExtendedSelection - Qt::ElideLeft + Qt::TextElideMode::ElideLeft - QListView::Free + QListView::Movement::Free - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok diff --git a/forms/projectsettingseditor.ui b/forms/projectsettingseditor.ui index dc6d730e..9aa521a8 100644 --- a/forms/projectsettingseditor.ui +++ b/forms/projectsettingseditor.ui @@ -125,7 +125,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -194,10 +194,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QSizePolicy::Maximum + QSizePolicy::Policy::Maximum @@ -276,10 +276,10 @@ .QFrame { border: 1px solid red; } - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -287,7 +287,6 @@ 12 - 75 true @@ -319,7 +318,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -338,7 +337,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -567,10 +566,10 @@ .QFrame { border: 1px solid red; } - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -578,7 +577,6 @@ 12 - 75 true @@ -693,7 +691,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -712,7 +710,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -783,10 +781,10 @@ .QFrame { border: 1px solid red; } - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -794,7 +792,6 @@ 12 - 75 true @@ -839,10 +836,10 @@ - Qt::Vertical + Qt::Orientation::Vertical - QSizePolicy::Maximum + QSizePolicy::Policy::Maximum @@ -924,10 +921,10 @@ - Qt::Vertical + Qt::Orientation::Vertical - QSizePolicy::MinimumExpanding + QSizePolicy::Policy::MinimumExpanding @@ -975,7 +972,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -1212,7 +1209,7 @@ true - Qt::NoTextInteraction + Qt::TextInteractionFlag::NoTextInteraction Use the dropbown and buttons to add behaviors to the list... @@ -1242,10 +1239,10 @@ .QFrame { border: 1px solid red; } - QFrame::StyledPanel + QFrame::Shape::StyledPanel - QFrame::Raised + QFrame::Shadow::Raised @@ -1253,7 +1250,6 @@ 12 - 75 true @@ -1316,7 +1312,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -1335,7 +1331,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -1372,18 +1368,13 @@ - + - <html><head/><body><p><a href="https://huderlem.github.io/porymap/manual/project-files.html#files"><span style=" text-decoration: underline; color:#0069d9;">Help</span></a></p></body></html> + ... - - Qt::RichText - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true + + + :/icons/help.ico:/icons/help.ico @@ -1419,7 +1410,7 @@ 0 0 533 - 440 + 428 @@ -1466,18 +1457,13 @@ - + - <html><head/><body><p><a href="https://huderlem.github.io/porymap/manual/project-files.html#identifiers"><span style=" text-decoration: underline; color:#0069d9;">Help</span></a></p></body></html> + ... - - Qt::RichText - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true + + + :/icons/help.ico:/icons/help.ico @@ -1513,7 +1499,7 @@ 0 0 533 - 440 + 428 @@ -1544,7 +1530,7 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok|QDialogButtonBox::StandardButton::RestoreDefaults diff --git a/include/ui/customscriptseditor.h b/include/ui/customscriptseditor.h index c93c7b7d..8d261570 100644 --- a/include/ui/customscriptseditor.h +++ b/include/ui/customscriptseditor.h @@ -49,6 +49,7 @@ private: void restoreWindowState(); void initShortcuts(); QObjectList shortcutableObjects() const; + void openManual(); private slots: void dialogButtonClicked(QAbstractButton *button); diff --git a/include/ui/projectsettingseditor.h b/include/ui/projectsettingseditor.h index 41affa8b..a0a26982 100644 --- a/include/ui/projectsettingseditor.h +++ b/include/ui/projectsettingseditor.h @@ -65,6 +65,8 @@ private: void updateMaskOverlapWarning(QLabel * warning, QList masks); QStringList getWarpBehaviorsList(); void setWarpBehaviorsList(QStringList list); + void openFilesHelp(); + void openIdentifiersHelp(); private slots: void dialogButtonClicked(QAbstractButton *button); diff --git a/src/ui/customscriptseditor.cpp b/src/ui/customscriptseditor.cpp index 40195d18..284ea333 100644 --- a/src/ui/customscriptseditor.cpp +++ b/src/ui/customscriptseditor.cpp @@ -23,6 +23,7 @@ CustomScriptsEditor::CustomScriptsEditor(QWidget *parent) : for (int i = 0; i < paths.length(); i++) this->displayScript(paths.at(i), enabled.at(i)); + connect(ui->button_Help, &QAbstractButton::clicked, this, &CustomScriptsEditor::openManual); connect(ui->button_CreateNewScript, &QAbstractButton::clicked, this, &CustomScriptsEditor::createNewScript); connect(ui->button_LoadScript, &QAbstractButton::clicked, this, &CustomScriptsEditor::loadScript); connect(ui->button_RefreshScripts, &QAbstractButton::clicked, this, &CustomScriptsEditor::userRefreshScripts); @@ -229,6 +230,11 @@ void CustomScriptsEditor::openSelectedScripts() { this->openScript(item); } +void CustomScriptsEditor::openManual() { + static const QUrl url("https://huderlem.github.io/porymap/manual/scripting-capabilities.html"); + QDesktopServices::openUrl(url); +} + // When the user refreshes the scripts we show a little tooltip as feedback. // We don't want this tooltip to display when we refresh programmatically, like when changes are saved. void CustomScriptsEditor::userRefreshScripts() { diff --git a/src/ui/projectsettingseditor.cpp b/src/ui/projectsettingseditor.cpp index ec476558..346591f4 100644 --- a/src/ui/projectsettingseditor.cpp +++ b/src/ui/projectsettingseditor.cpp @@ -37,6 +37,8 @@ ProjectSettingsEditor::~ProjectSettingsEditor() } void ProjectSettingsEditor::connectSignals() { + connect(ui->button_HelpFiles, &QAbstractButton::clicked, this, &ProjectSettingsEditor::openFilesHelp); + connect(ui->button_HelpIdentifiers, &QAbstractButton::clicked, this, &ProjectSettingsEditor::openIdentifiersHelp); connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &ProjectSettingsEditor::dialogButtonClicked); connect(ui->button_ImportDefaultPrefabs, &QAbstractButton::clicked, this, &ProjectSettingsEditor::importDefaultPrefabsClicked); connect(ui->comboBox_BaseGameVersion, &QComboBox::currentTextChanged, this, &ProjectSettingsEditor::promptRestoreDefaults); @@ -658,6 +660,16 @@ void ProjectSettingsEditor::dialogButtonClicked(QAbstractButton *button) { } } +void ProjectSettingsEditor::openFilesHelp() { + static const QUrl url("https://huderlem.github.io/porymap/manual/project-files.html#files"); + QDesktopServices::openUrl(url); +} + +void ProjectSettingsEditor::openIdentifiersHelp() { + static const QUrl url("https://huderlem.github.io/porymap/manual/project-files.html#identifiers"); + QDesktopServices::openUrl(url); +} + // Close event triggered by a project reload. User doesn't need any prompts, just close the window. void ProjectSettingsEditor::closeQuietly() { // Turn off flags that trigger prompts diff --git a/src/ui/wildmonchart.cpp b/src/ui/wildmonchart.cpp index 375edbf4..32ff9bc9 100644 --- a/src/ui/wildmonchart.cpp +++ b/src/ui/wildmonchart.cpp @@ -82,6 +82,7 @@ void WildMonChart::clearTableData() { ui->comboBox_Species->clear(); ui->comboBox_Group->clear(); ui->comboBox_Group->setEnabled(false); + ui->label_Group->setEnabled(false); } // Extract all the data from the table that we need for the charts @@ -152,7 +153,9 @@ void WildMonChart::readTable() { ui->comboBox_Species->addItems(getSpeciesNamesAlphabetical()); ui->comboBox_Group->clear(); ui->comboBox_Group->addItems(this->groupNames); - ui->comboBox_Group->setEnabled(usesGroupLabels()); + bool enableGroupSelection = usesGroupLabels(); + ui->comboBox_Group->setEnabled(enableGroupSelection); + ui->label_Group->setEnabled(enableGroupSelection); } void WildMonChart::refresh() { @@ -438,23 +441,33 @@ void WildMonChart::limitChartAnimation() { 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 " + + // Describe the Species Distribution tab + static const QString speciesTabInfo = + "The Species Distribution tab shows the cumulative encounter chance for each species " "in the table. In other words, it answers the question \"What is the likelihood of encountering " - "each species in a single encounter?\"" - "

" + "each species in a single encounter?\""; + + // Describe the Level Distribution tab + static const QString levelTabInfo = "The Level Distribution tab shows the chance of encountering each species at a particular level. " "In the top left under Group you can select which encounter group to show data for. " - "In the top right under Species you can select which species to show data for. " + "In the top right you can enable Individual Mode. When enabled data will be shown for only the selected species." "

" - "Individual Mode on the Level Distribution tab toggles whether data is shown for all species in the table. " - "The percentages will update to reflect whether you're showing all species or just that individual species. " "In other words, while Individual Mode is checked the chart is answering the question \"If a species x " "is encountered, what is the likelihood that it will be level y\", and while Individual Mode is not checked, " "it answers the question \"For a single encounter, what is the likelihood of encountering a species x at level y.\""; + + QString informativeText; + if (ui->tabWidget->currentWidget() == ui->tabSpecies) { + informativeText = speciesTabInfo; + } else if (ui->tabWidget->currentWidget() == ui->tabLevels) { + informativeText = levelTabInfo; + } + QMessageBox msgBox(QMessageBox::Information, "porymap", text, QMessageBox::Close, this); msgBox.setTextFormat(Qt::RichText); - msgBox.setInformativeText(informative); + msgBox.setInformativeText(informativeText); msgBox.exec(); }