change: add enable/disable to resources

TIL that zip resource packs, when disabled, actually have the effect of
not showing up in the game at all. Since this can be useful to someone,
I moved the logic for it to the resources.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-08-13 11:58:39 -03:00
parent c3ceefbafb
commit e2ab2aea32
13 changed files with 231 additions and 168 deletions

View File

@ -54,8 +54,6 @@ public:
Mod(const QDir& mods_dir, const Metadata::ModStruct& metadata);
Mod(QString file_path) : Mod(QFileInfo(file_path)) {}
auto enabled() const -> bool { return m_enabled; }
auto details() const -> const ModDetails&;
auto name() const -> QString override;
auto version() const -> QString;
@ -71,8 +69,6 @@ public:
void setMetadata(std::shared_ptr<Metadata::ModStruct>&& metadata);
void setMetadata(const Metadata::ModStruct& metadata) { setMetadata(std::make_shared<Metadata::ModStruct>(metadata)); }
auto enable(bool value) -> bool;
[[nodiscard]] auto compare(Resource const& other, SortType type) const -> std::pair<int, bool> override;
[[nodiscard]] bool applyFilter(QRegularExpression filter) const override;
@ -83,6 +79,4 @@ public:
protected:
ModDetails m_local_details;
bool m_enabled = true;
};