mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Detect resources incompatible with the MC version
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
157ae6fb72
commit
e2d503456f
5 changed files with 48 additions and 4 deletions
|
|
@ -43,6 +43,8 @@
|
|||
#include "MetadataHandler.h"
|
||||
#include "QObjectPtr.h"
|
||||
|
||||
class BaseInstance;
|
||||
|
||||
enum class ResourceType {
|
||||
UNKNOWN, //!< Indicates an unspecified resource type.
|
||||
ZIPFILE, //!< The resource is a zip file containing the resource's class files.
|
||||
|
|
@ -119,6 +121,13 @@ class Resource : public QObject {
|
|||
void setMetadata(std::shared_ptr<Metadata::ModStruct>&& metadata);
|
||||
void setMetadata(const Metadata::ModStruct& metadata) { setMetadata(std::make_shared<Metadata::ModStruct>(metadata)); }
|
||||
|
||||
/**
|
||||
* Returns whether the resource is compatible with the instance.
|
||||
* This is initially true, and may be updated when calling determineCompat with an instance.
|
||||
*/
|
||||
bool isCompatible() const { return m_isCompatible; }
|
||||
void determineCompat(const BaseInstance* inst);
|
||||
|
||||
/** Compares two Resources, for sorting purposes, considering a ascending order, returning:
|
||||
* > 0: 'this' comes after 'other'
|
||||
* = 0: 'this' is equal to 'other'
|
||||
|
|
@ -188,6 +197,8 @@ class Resource : public QObject {
|
|||
/* Whether the resource is enabled (e.g. shows up in the game) or not. */
|
||||
bool m_enabled = true;
|
||||
|
||||
bool m_isCompatible = true;
|
||||
|
||||
/* Used to keep trach of pending / concluded actions on the resource. */
|
||||
bool m_is_resolving = false;
|
||||
bool m_is_resolved = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue