mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Removed RunIfGame Step in favor of inline conditional statements
This commit is contained in:
parent
791438eea6
commit
9feed217ef
@ -1,46 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Wabbajack.Common;
|
||||
|
||||
namespace Wabbajack.Lib.CompilationSteps
|
||||
{
|
||||
public class RunIfGame : ACompilationStep
|
||||
{
|
||||
private readonly Game _game;
|
||||
private readonly List<ICompilationStep> _microStack;
|
||||
|
||||
public RunIfGame(ACompiler compiler, Game game, List<ICompilationStep> microStack) : base(compiler)
|
||||
{
|
||||
_game = game;
|
||||
_microStack = microStack;
|
||||
}
|
||||
|
||||
public override Directive Run(RawSourceFile source)
|
||||
{
|
||||
return _compiler._vortexCompiler?.Game != _game ? null : _compiler._vortexCompiler.RunStack(_microStack, source);
|
||||
}
|
||||
|
||||
public override IState GetState()
|
||||
{
|
||||
return new State(_game, _microStack);
|
||||
}
|
||||
|
||||
[JsonArray("RunIfGame")]
|
||||
public class State : IState
|
||||
{
|
||||
public State(Game game, List<ICompilationStep> microStack)
|
||||
{
|
||||
Game = game;
|
||||
MicroStack = microStack;
|
||||
}
|
||||
|
||||
public Game Game { get; set; }
|
||||
public List<ICompilationStep> MicroStack { get; set; }
|
||||
|
||||
public ICompilationStep CreateStep(ACompiler compiler)
|
||||
{
|
||||
return new RunIfGame(compiler, Game, MicroStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -176,7 +176,7 @@ namespace Wabbajack.Lib
|
||||
IEnumerable<ICompilationStep> stack = MakeStack();
|
||||
|
||||
Info("Running Compilation Stack");
|
||||
List<Directive> results = AllFiles.PMap(f => RunStack(stack, f)).ToList();
|
||||
List<Directive> results = AllFiles.PMap(f => RunStack(stack.Where(s => s != null), f)).ToList();
|
||||
|
||||
IEnumerable<NoMatch> noMatch = results.OfType<NoMatch>().ToList();
|
||||
Info($"No match for {noMatch.Count()} files");
|
||||
@ -410,9 +410,11 @@ namespace Wabbajack.Lib
|
||||
//new IncludePropertyFiles(this),
|
||||
new IncludeVortexDeployment(this),
|
||||
new IncludeRegex(this, "^*\\.meta"),
|
||||
|
||||
Game == Game.DarkestDungeon ? new IncludeRegex(this, "project\\.xml$") : null,
|
||||
|
||||
new IgnoreStartsWith(this, " __vortex_staging_folder"),
|
||||
new IgnoreEndsWith(this, "__vortex_staging_folder"),
|
||||
new IgnoreEndsWith(this, "project.xml"), // darkest dungeon specific
|
||||
|
||||
new IgnoreGameFiles(this),
|
||||
|
||||
|
@ -93,7 +93,6 @@
|
||||
<Compile Include="CompilationSteps\IncludeAll.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeAllConfigs.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeDummyESPs.cs" />
|
||||
<Compile Include="CompilationSteps\RunIfGame.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeLootFiles.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeModIniData.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeOtherProfiles.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user