mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Removed IncludeGenericGamePlugin
This commit is contained in:
parent
bfcb40bdcb
commit
0140a995b3
@ -1,46 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Wabbajack.Common;
|
|
||||||
|
|
||||||
namespace Wabbajack.Lib.CompilationSteps
|
|
||||||
{
|
|
||||||
public class IncludeGenericGamePlugin : ACompilationStep
|
|
||||||
{
|
|
||||||
private readonly bool _validGame;
|
|
||||||
private readonly string _pluginsFolder = string.Empty;
|
|
||||||
private readonly string _gameName = string.Empty;
|
|
||||||
|
|
||||||
public IncludeGenericGamePlugin(ACompiler compiler) : base(compiler)
|
|
||||||
{
|
|
||||||
if (!(compiler is MO2Compiler mo2Compiler))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (mo2Compiler.CompilingGame.NexusName == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_validGame = mo2Compiler.CompilingGame.IsGenericMO2Plugin;
|
|
||||||
_pluginsFolder = mo2Compiler.MO2Folder.Combine("plugins").ToString();
|
|
||||||
_gameName = $"game_{mo2Compiler.CompilingGame.NexusName}.py";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Regex regex = new Regex(@"^game_$");
|
|
||||||
|
|
||||||
public override async ValueTask<Directive?> Run(RawSourceFile source)
|
|
||||||
{
|
|
||||||
if (!_validGame)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (!source.AbsolutePath.ToString().StartsWith(_pluginsFolder))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if(!source.AbsolutePath.FileName.ToString().Equals(_gameName, StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var res = source.EvolveTo<InlineFile>();
|
|
||||||
res.SourceDataID = await _compiler.IncludeFile(await source.AbsolutePath.ReadAllBytesAsync());
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -591,7 +591,6 @@ namespace Wabbajack.Lib
|
|||||||
{
|
{
|
||||||
new IgnoreGameFilesIfGameFolderFilesExist(this),
|
new IgnoreGameFilesIfGameFolderFilesExist(this),
|
||||||
new IncludePropertyFiles(this),
|
new IncludePropertyFiles(this),
|
||||||
new IncludeGenericGamePlugin(this),
|
|
||||||
new IgnoreSaveFiles(this),
|
new IgnoreSaveFiles(this),
|
||||||
new IgnoreStartsWith(this,"logs\\"),
|
new IgnoreStartsWith(this,"logs\\"),
|
||||||
new IgnoreStartsWith(this, "downloads\\"),
|
new IgnoreStartsWith(this, "downloads\\"),
|
||||||
|
Loading…
Reference in New Issue
Block a user