aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/Mod.h
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-07-01 13:05:55 +0100
committerGitHub <noreply@github.com>2023-07-01 13:05:55 +0100
commit7138425c8581e19d36ee62e1193a5b7184eb0089 (patch)
treed29efcad3353603c6ac1eb64708a92e616c00ecc /launcher/minecraft/mod/Mod.h
parent05d2c1f0b06519eba9cc5ad22848106b49f9bd15 (diff)
parentc523765c197cf63d6830d205f1554cd73e38109e (diff)
downloadPrismLauncher-7138425c8581e19d36ee62e1193a5b7184eb0089.tar.gz
PrismLauncher-7138425c8581e19d36ee62e1193a5b7184eb0089.tar.bz2
PrismLauncher-7138425c8581e19d36ee62e1193a5b7184eb0089.zip
Merge branch 'develop' into better-component-installation
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/minecraft/mod/Mod.h')
-rw-r--r--launcher/minecraft/mod/Mod.h22
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;
+
};