aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/Mod.h
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-25 12:36:27 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-25 12:43:48 -0700
commitdf4fd7df7f98589c5dba85e4b5cdf0179a77faf5 (patch)
treeb382b0375a12d91305849f5dad41f4e0b04de8df /launcher/minecraft/mod/Mod.h
parentc8ff812ab89044890d88779e33f3c6f86c4b8f74 (diff)
parent1bd778d0ae27b3e87b800f773d5bc35708060c19 (diff)
downloadPrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.tar.gz
PrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.tar.bz2
PrismLauncher-df4fd7df7f98589c5dba85e4b5cdf0179a77faf5.zip
Merge remote-tracking branch 'upstream/develop' into refactor/net-split-headers-to-proxy-class
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;
+
};