-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from SubnauticaModding/QMM301BugFix
QModManager 3.0.1 bug fix
- Loading branch information
Showing
18 changed files
with
154 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.0 | ||
3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace QModManager.Patching | ||
{ | ||
internal interface IQModFactory | ||
{ | ||
/// <summary> | ||
/// Searches through all folders in the provided directory and returns an ordered list of mods to load.<para/> | ||
/// Mods that cannot be loaded will have an unsuccessful <see cref="QMod.Status"/> value. | ||
/// </summary> | ||
/// <param name="qmodsDirectory">The QMods directory</param> | ||
/// <returns>A new, sorted <see cref="List{QMod}"/> ready to be initialized or skipped.</returns> | ||
List<QMod> BuildModLoadingList(string qmodsDirectory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
namespace QMMTests | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using QModManager.API; | ||
using QModManager.API.ModLoading; | ||
using QModManager.Patching; | ||
|
||
[TestFixture] | ||
internal class QModFactoryTests | ||
{ | ||
[Test] | ||
public void CreateModStatusList_EarlyErrorsCombineWithSuccessfullMods() | ||
{ | ||
// Arange | ||
var earlyErrors = new List<QMod> | ||
{ | ||
new QMod {Id = "1", Status = ModStatus.CanceledByUser }, | ||
new QMod {Id = "2", Status = ModStatus.InvalidCoreInfo }, | ||
new QMod {Id = "3", Status = ModStatus.MissingAssemblyFile }, | ||
new QMod {Id = "4", Status = ModStatus.MissingDependency }, | ||
new QMod {Id = "5", Status = ModStatus.MissingPatchMethod }, | ||
}; | ||
|
||
var modsToLoad = new List<QMod> | ||
{ | ||
new QMod { Id = "6", Status = ModStatus.Success }, | ||
new QMod { Id = "7", Status = ModStatus.Success }, | ||
new QMod { Id = "8", Status = ModStatus.Success }, | ||
}; | ||
|
||
// Act | ||
List<QMod> combinedList = QModFactory.CreateModStatusList(earlyErrors, modsToLoad); | ||
|
||
Assert.AreEqual(earlyErrors.Count + modsToLoad.Count, combinedList.Count); | ||
|
||
foreach (QMod erroredMod in earlyErrors) | ||
Assert.IsTrue(combinedList.Contains(erroredMod)); | ||
|
||
foreach (QMod readyMod in modsToLoad) | ||
Assert.IsTrue(combinedList.Contains(readyMod)); | ||
} | ||
|
||
[TestCase("0", ModStatus.MissingDependency)] | ||
[TestCase("5", ModStatus.MissingDependency)] | ||
[TestCase("7", ModStatus.OutOfDateDependency)] | ||
public void CreateModStatusList_WhenMissingVersionDependencies_StatusUpdates(string missingOrOutdatedMod, ModStatus expectedStatus) | ||
{ | ||
// Arange | ||
var earlyErrors = new List<QMod> | ||
{ | ||
new QMod {Id = "5", Status = ModStatus.MissingPatchMethod }, | ||
}; | ||
|
||
var modToInspect = new QMod | ||
{ | ||
Id = "8", | ||
Status = ModStatus.Success, | ||
RequiredMods = new List<RequiredQMod> | ||
{ | ||
new RequiredQMod(missingOrOutdatedMod, new Version(1, 0, 2)) | ||
} | ||
}; | ||
|
||
var modsToLoad = new List<QMod> | ||
{ | ||
new QMod { Id = "6", Status = ModStatus.Success }, | ||
new QMod | ||
{ | ||
Id = "7", Status = ModStatus.Success, | ||
ParsedVersion = new Version(1, 0, 1) | ||
}, | ||
modToInspect | ||
}; | ||
|
||
// Act | ||
List<QMod> combinedList = QModFactory.CreateModStatusList(earlyErrors, modsToLoad); | ||
|
||
// Assert | ||
Assert.AreEqual(expectedStatus, modToInspect.Status); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters