diff options
author | flow <thiagodonato300@gmail.com> | 2022-04-13 19:16:36 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-23 14:42:22 -0300 |
commit | b30b88716e67de93ea1c97d9dfd02a41af5428f3 (patch) | |
tree | df418d6c9c2b9519e57113714addbe456bca3e3b /launcher/modplatform/packwiz/Packwiz.h | |
parent | dca4ea5ceaa30f1285570d2bf32ea112118b9204 (diff) | |
download | PrismLauncher-b30b88716e67de93ea1c97d9dfd02a41af5428f3.tar.gz PrismLauncher-b30b88716e67de93ea1c97d9dfd02a41af5428f3.tar.bz2 PrismLauncher-b30b88716e67de93ea1c97d9dfd02a41af5428f3.zip |
feat: add very early mod.toml packwiz support
Also use it as a on-disk format for storing mod metadata. This will be
used later on to make better mod managment.
Diffstat (limited to 'launcher/modplatform/packwiz/Packwiz.h')
-rw-r--r-- | launcher/modplatform/packwiz/Packwiz.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/launcher/modplatform/packwiz/Packwiz.h b/launcher/modplatform/packwiz/Packwiz.h new file mode 100644 index 00000000..64b95e7a --- /dev/null +++ b/launcher/modplatform/packwiz/Packwiz.h @@ -0,0 +1,43 @@ +#pragma once + +#include <QString> +#include <QUrl> +#include <QVariant> + +namespace ModPlatform { +enum class Provider; +class IndexedPack; +class IndexedVersion; +} // namespace ModPlatform + +class QDir; + +class Packwiz { + public: + struct Mod { + QString name; + QString filename; + // FIXME: make side an enum + QString side = "both"; + + // [download] + QUrl url; + // FIXME: make hash-format an enum + QString hash_format; + QString hash; + + // [update] + ModPlatform::Provider provider; + QVariant file_id; + QVariant project_id; + }; + + /* Generates the object representing the information in a mod.toml file via its common representation in the launcher */ + static auto createModFormat(QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) -> Mod; + + /* Updates the mod index for the provided mod. + * This creates a new index if one does not exist already + * TODO: Ask the user if they want to override, and delete the old mod's files, or keep the old one. + * */ + static void updateModIndex(QDir& index_dir, Mod& mod); +}; |