diff options
author | flow <thiagodonato300@gmail.com> | 2022-04-02 20:08:37 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-04-15 08:49:43 -0300 |
commit | 76dfb7825ade6554095ac3a09b3accdbd4db5138 (patch) | |
tree | fbe03978afee836e377f159e196183c28a88fb8e /launcher/ui/pages/modplatform/flame | |
parent | 5cb0e750936f09513b98a8b0fd57746ca18dc8bc (diff) | |
download | PrismLauncher-76dfb7825ade6554095ac3a09b3accdbd4db5138.tar.gz PrismLauncher-76dfb7825ade6554095ac3a09b3accdbd4db5138.tar.bz2 PrismLauncher-76dfb7825ade6554095ac3a09b3accdbd4db5138.zip |
fix: 'All' filter working and get around CF API capabilities
Diffstat (limited to 'launcher/ui/pages/modplatform/flame')
-rw-r--r-- | launcher/ui/pages/modplatform/flame/FlameModPage.cpp | 19 | ||||
-rw-r--r-- | launcher/ui/pages/modplatform/flame/FlameModPage.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp index 864ae8e6..5398bda3 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp @@ -67,6 +67,25 @@ auto FlameModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString min return ver.mcVersion.contains(mineVer); } +// We override this so that it refreshes correctly, otherwise it wouldn't show +// any mod on the mod list, because the CF API does not support it :( +void FlameModPage::filterMods() +{ + filter_dialog.execWithInstance(static_cast<MinecraftInstance*>(m_instance)); + + int prev_size = m_filter->versions.size(); + m_filter = filter_dialog.getFilter(); + int new_size = m_filter->versions.size(); + + if(new_size <= 1 && new_size != prev_size) + listModel->refresh(); + + if(ui->versionSelectionBox->count() > 0){ + ui->versionSelectionBox->clear(); + updateModVersions(); + } +} + // I don't know why, but doing this on the parent class makes it so that // other mod providers start loading before being selected, at least with // my Qt, so we need to implement this in every derived class... diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.h b/launcher/ui/pages/modplatform/flame/FlameModPage.h index dc58fd7f..7078e889 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModPage.h +++ b/launcher/ui/pages/modplatform/flame/FlameModPage.h @@ -56,5 +56,7 @@ class FlameModPage : public ModPage { auto validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, QString loaderVer = "") const -> bool override; + void filterMods() override; + auto shouldDisplay() const -> bool override; }; |