diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-23 11:42:28 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-23 11:42:28 +0300 |
commit | 6613deca0fa3a49086e89bc05e047f05909f8c0c (patch) | |
tree | ff8407e02d9c3d59a02436a2ad083f241d87cc2e /launcher/minecraft/mod/Mod.h | |
parent | 718aca3d066fc24c03b7ac6d625d68829fcaa427 (diff) | |
parent | 8df5ab8aa7ec32ee3c44e2b57dc9c9f04e093d9d (diff) | |
download | PrismLauncher-6613deca0fa3a49086e89bc05e047f05909f8c0c.tar.gz PrismLauncher-6613deca0fa3a49086e89bc05e047f05909f8c0c.tar.bz2 PrismLauncher-6613deca0fa3a49086e89bc05e047f05909f8c0c.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into catpacks
Diffstat (limited to 'launcher/minecraft/mod/Mod.h')
-rw-r--r-- | launcher/minecraft/mod/Mod.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/Mod.h b/launcher/minecraft/mod/Mod.h index c4032538..d4e419f4 100644 --- a/launcher/minecraft/mod/Mod.h +++ b/launcher/minecraft/mod/Mod.h @@ -38,6 +38,10 @@ #include <QDateTime> #include <QFileInfo> #include <QList> +#include <QImage> +#include <QMutex> +#include <QPixmap> +#include <QPixmapCache> #include <optional> @@ -64,6 +68,15 @@ public: auto authors() const -> QStringList; auto status() const -> ModStatus; auto provider() const -> std::optional<QString>; + auto licenses() const -> const QList<ModLicense>&; + auto issueTracker() const -> QString; + + /** Get the intneral path to the mod's icon file*/ + QString iconPath() const { return m_local_details.icon_file; }; + /** Gets the icon of the mod, converted to a QPixmap for drawing, and scaled to size. */ + [[nodiscard]] QPixmap icon(QSize size, Qt::AspectRatioMode mode = Qt::AspectRatioMode::IgnoreAspectRatio) const; + /** Thread-safe. */ + void setIcon(QImage new_image) const; auto metadata() -> std::shared_ptr<Metadata::ModStruct>; auto metadata() const -> const std::shared_ptr<Metadata::ModStruct>; @@ -85,4 +98,13 @@ public: protected: ModDetails m_local_details; + + mutable QMutex m_data_lock; + + struct { + QPixmapCache::Key key; + bool was_ever_used = false; + bool was_read_attempt = false; + } mutable m_pack_image_cache_key; + }; |