aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/Mod.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-08-13 11:58:39 -0300
committerflow <flowlnlnln@gmail.com>2022-08-20 10:49:54 -0300
commite2ab2aea32b6d48ee0c9f90442ed53c47e2e7d96 (patch)
tree76c2c9cb6ea122f497aee22e844500ae1037c84d /launcher/minecraft/mod/Mod.cpp
parentc3ceefbafbbeb3d31630ef329405ebaacdf9fce5 (diff)
downloadPrismLauncher-e2ab2aea32b6d48ee0c9f90442ed53c47e2e7d96.tar.gz
PrismLauncher-e2ab2aea32b6d48ee0c9f90442ed53c47e2e7d96.tar.bz2
PrismLauncher-e2ab2aea32b6d48ee0c9f90442ed53c47e2e7d96.zip
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>
Diffstat (limited to 'launcher/minecraft/mod/Mod.cpp')
-rw-r--r--launcher/minecraft/mod/Mod.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/launcher/minecraft/mod/Mod.cpp b/launcher/minecraft/mod/Mod.cpp
index 5e186471..39023f69 100644
--- a/launcher/minecraft/mod/Mod.cpp
+++ b/launcher/minecraft/mod/Mod.cpp
@@ -56,37 +56,6 @@ Mod::Mod(const QDir& mods_dir, const Metadata::ModStruct& metadata)
m_local_details.metadata = std::make_shared<Metadata::ModStruct>(std::move(metadata));
}
-auto Mod::enable(bool value) -> bool
-{
- if (m_type == ResourceType::UNKNOWN || m_type == ResourceType::FOLDER)
- return false;
-
- if (m_enabled == value)
- return false;
-
- QString path = m_file_info.absoluteFilePath();
- QFile file(path);
- if (value) {
- if (!path.endsWith(".disabled"))
- return false;
- path.chop(9);
-
- if (!file.rename(path))
- return false;
- } else {
- path += ".disabled";
-
- if (!file.rename(path))
- return false;
- }
-
- if (status() == ModStatus::NoMetadata)
- setFile(QFileInfo(path));
-
- m_enabled = value;
- return true;
-}
-
void Mod::setStatus(ModStatus status)
{
m_local_details.status = status;
@@ -108,10 +77,6 @@ std::pair<int, bool> Mod::compare(const Resource& other, SortType type) const
switch (type) {
default:
case SortType::ENABLED:
- if (enabled() && !cast_other->enabled())
- return { 1, type == SortType::ENABLED };
- if (!enabled() && cast_other->enabled())
- return { -1, type == SortType::ENABLED };
case SortType::NAME:
case SortType::DATE: {
auto res = Resource::compare(other, type);