diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
commit | ef0752972ae64002a02e66e430165f3e93c09c53 (patch) | |
tree | bb4337a52c9fe3b0c063cb3b3af5e411826a8d90 /launcher/minecraft/mod/Mod.h | |
parent | 3c9c39cb890252f94d0c50caa00de5439881d7f6 (diff) | |
parent | bcf45c74a1b0b3389c05927637bf8aa95b8e43cf (diff) | |
download | PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.gz PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.bz2 PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into export
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; + }; |