diff options
Diffstat (limited to 'api/logic/minecraft/MinecraftProfile.cpp')
-rw-r--r-- | api/logic/minecraft/MinecraftProfile.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/api/logic/minecraft/MinecraftProfile.cpp b/api/logic/minecraft/MinecraftProfile.cpp index 46235a18..c04669c1 100644 --- a/api/logic/minecraft/MinecraftProfile.cpp +++ b/api/logic/minecraft/MinecraftProfile.cpp @@ -80,7 +80,7 @@ void MinecraftProfile::clear() m_traits.clear(); m_jarMods.clear(); mojangDownloads.clear(); - m_problemSeverity = ProblemSeverity::PROBLEM_NONE; + m_problemSeverity = ProblemSeverity::None; } void MinecraftProfile::clearPatches() @@ -273,9 +273,9 @@ QVariant MinecraftProfile::data(const QModelIndex &index, int role) const auto severity = patch->getProblemSeverity(); switch (severity) { - case PROBLEM_WARNING: + case ProblemSeverity::Warning: return "warning"; - case PROBLEM_ERROR: + case ProblemSeverity::Error: return "error"; default: return QVariant(); @@ -491,20 +491,29 @@ void MinecraftProfile::applyLibrary(LibraryPtr library) { return; } + + QList<LibraryPtr> * list = &m_libraries; + if(library->isNative()) + { + list = &m_nativeLibraries; + } + + auto libraryCopy = Library::limitedCopy(library); + // find the library by name. - const int index = findLibraryByName(m_libraries, library->rawName()); + const int index = findLibraryByName(*list, library->rawName()); // library not found? just add it. if (index < 0) { - m_libraries.append(Library::limitedCopy(library)); + list->append(libraryCopy); return; } - auto existingLibrary = m_libraries.at(index); + + auto existingLibrary = list->at(index); // if we are higher it means we should update if (Version(library->version()) > Version(existingLibrary->version())) { - auto libraryCopy = Library::limitedCopy(library); - m_libraries.replace(index, libraryCopy); + list->replace(index, libraryCopy); } } @@ -581,6 +590,11 @@ const QList<LibraryPtr> & MinecraftProfile::getLibraries() const return m_libraries; } +const QList<LibraryPtr> & MinecraftProfile::getNativeLibraries() const +{ + return m_nativeLibraries; +} + void MinecraftProfile::getLibraryFiles(const QString& architecture, QStringList& jars, QStringList& nativeJars, const QString& overridePath) const { QStringList native32, native64; @@ -590,6 +604,10 @@ void MinecraftProfile::getLibraryFiles(const QString& architecture, QStringList& { lib->getApplicableFiles(currentSystem, jars, nativeJars, native32, native64, overridePath); } + for (auto lib : getNativeLibraries()) + { + lib->getApplicableFiles(currentSystem, jars, nativeJars, native32, native64, overridePath); + } if(architecture == "32") { nativeJars.append(native32); @@ -621,6 +639,11 @@ void MinecraftProfile::installJarMods(QStringList selectedFiles) m_strategy->installJarMods(selectedFiles); } +void MinecraftProfile::installVersion(BaseVersionPtr version) +{ + // TODO: implement +} + /* * TODO: get rid of this. Get rid of all order numbers. */ |