feat(RD): add texture pack downloader

This extends the resource pack downloader, with the custom behavior of
filtering the versions that shows up, to those <= 1.6. As always, Flame
is funky and requires a bit more workarounds than average.

This will also get a nice improvement when the Version parsing and
comparison PR gets merged! :D

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2023-01-29 18:07:49 -03:00
parent b724607e31
commit ada5e88eb9
22 changed files with 550 additions and 20 deletions

View File

@ -36,6 +36,7 @@ class QDialogButtonBox;
class ResourceDownloadTask;
class ResourceFolderModel;
class ResourcePackFolderModel;
class TexturePackFolderModel;
class ShaderPackFolderModel;
namespace ResourceDownload {
@ -129,6 +130,25 @@ class ResourcePackDownloadDialog final : public ResourceDownloadDialog {
BaseInstance* m_instance;
};
class TexturePackDownloadDialog final : public ResourceDownloadDialog {
Q_OBJECT
public:
explicit TexturePackDownloadDialog(QWidget* parent,
const std::shared_ptr<TexturePackFolderModel>& resource_packs,
BaseInstance* instance);
~TexturePackDownloadDialog() override = default;
//: String that gets appended to the texture pack download dialog title ("Download " + resourcesString())
[[nodiscard]] QString resourcesString() const override { return tr("texture packs"); }
[[nodiscard]] QString geometrySaveKey() const override { return "TPDownloadGeometry"; }
QList<BasePage*> getPages() override;
private:
BaseInstance* m_instance;
};
class ShaderPackDownloadDialog final : public ResourceDownloadDialog {
Q_OBJECT