mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added WABBAJACK_ALWAYS_DISABLE flag
This commit is contained in:
parent
04d69299ec
commit
4bf1e943a2
@ -43,6 +43,7 @@ namespace Wabbajack.Common
|
|||||||
|
|
||||||
public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE";
|
public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE";
|
||||||
public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE";
|
public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE";
|
||||||
|
public static string WABBAJACK_ALWAYS_DISABLE = "WABBAJACK_ALWAYS_DISABLE";
|
||||||
public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE";
|
public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE";
|
||||||
|
|
||||||
public static string GAME_PATH_MAGIC_BACK = "{--||GAME_PATH_MAGIC_BACK||--}";
|
public static string GAME_PATH_MAGIC_BACK = "{--||GAME_PATH_MAGIC_BACK||--}";
|
||||||
|
@ -15,13 +15,16 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
public IgnoreDisabledMods(ACompiler compiler) : base(compiler)
|
public IgnoreDisabledMods(ACompiler compiler) : base(compiler)
|
||||||
{
|
{
|
||||||
_mo2Compiler = (MO2Compiler) compiler;
|
_mo2Compiler = (MO2Compiler) compiler;
|
||||||
var alwaysEnabled = _mo2Compiler.ModInis.Where(f => IsAlwaysEnabled(f.Value)).Select(f => f.Key).Distinct();
|
var alwaysEnabled = _mo2Compiler.ModInis.Where(f => HasFlagInNotes(f.Value, Consts.WABBAJACK_ALWAYS_ENABLE)).Select(f => f.Key).Distinct();
|
||||||
|
var alwaysDisabled = _mo2Compiler.ModInis
|
||||||
|
.Where(f => HasFlagInNotes(f.Value, Consts.WABBAJACK_ALWAYS_DISABLE)).Select(f => f.Key).Distinct();
|
||||||
|
|
||||||
_allEnabledMods = _mo2Compiler.SelectedProfiles
|
_allEnabledMods = _mo2Compiler.SelectedProfiles
|
||||||
.SelectMany(p => _mo2Compiler.MO2Folder.Combine("profiles", p, "modlist.txt").ReadAllLines())
|
.SelectMany(p => _mo2Compiler.MO2Folder.Combine("profiles", p, "modlist.txt").ReadAllLines())
|
||||||
.Where(line => line.StartsWith("+") || line.EndsWith("_separator"))
|
.Where(line => line.StartsWith("+") || line.EndsWith("_separator"))
|
||||||
.Select(line => line.Substring(1).RelativeTo(_mo2Compiler.MO2ModsFolder))
|
.Select(line => line.Substring(1).RelativeTo(_mo2Compiler.MO2ModsFolder))
|
||||||
.Concat(alwaysEnabled)
|
.Concat(alwaysEnabled)
|
||||||
|
.Except(alwaysDisabled)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,18 +38,17 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsAlwaysEnabled(dynamic data)
|
public static bool HasFlagInNotes(dynamic data, string flag)
|
||||||
{
|
{
|
||||||
if (data == null)
|
if (data == null)
|
||||||
return false;
|
return false;
|
||||||
if (data.General != null && data.General.notes != null &&
|
if (data.General != null && data.General.notes != null &&
|
||||||
data.General.notes.Contains(
|
data.General.notes.Contains(
|
||||||
Consts.WABBAJACK_ALWAYS_ENABLE))
|
flag))
|
||||||
return true;
|
return true;
|
||||||
if (data.General != null && data.General.comments != null &&
|
|
||||||
data.General.comments.Contains(Consts.WABBAJACK_ALWAYS_ENABLE))
|
return data.General != null && data.General.comments != null &&
|
||||||
return true;
|
data.General.comments.Contains(flag);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace Wabbajack.Lib.CompilationSteps
|
|||||||
|
|
||||||
private async Task<byte[]> ReadAndCleanModlist(AbsolutePath absolutePath)
|
private async Task<byte[]> ReadAndCleanModlist(AbsolutePath absolutePath)
|
||||||
{
|
{
|
||||||
var alwaysEnabled = _mo2Compiler.ModInis.Where(f => IgnoreDisabledMods.IsAlwaysEnabled(f.Value))
|
var alwaysEnabled = _mo2Compiler.ModInis.Where(f => IgnoreDisabledMods.HasFlagInNotes(f.Value, Consts.WABBAJACK_ALWAYS_ENABLE))
|
||||||
.Select(f => f.Key)
|
.Select(f => f.Key)
|
||||||
.Select(f => f.FileName.ToString())
|
.Select(f => f.FileName.ToString())
|
||||||
.Distinct();
|
.Distinct();
|
||||||
|
Loading…
Reference in New Issue
Block a user