Fix native game compilation

This commit is contained in:
Timothy Baldridge 2022-09-26 21:02:39 -06:00
parent 931733c49d
commit cfb928bfce
9 changed files with 24 additions and 8 deletions

View File

@ -1,9 +1,10 @@
### Changelog
#### Version - 3.0.1.6 - 9/??/2022
#### Version - 3.0.1.6 - 9/26/2022
* Fix Cyberpunk 2077 GoG recognition
* Add a CLI command `list-games` to list all games recognized by WJ and their versions/locations
* Fix Native Game compiler installs
* Fix Native Game Compiler installs
* Fix Native Game Compiler compilation
#### Version - 3.0.1.5 - 9/26/2022
* Fix MO2ArchiveName resolution

View File

@ -7,6 +7,8 @@ public abstract class ACompilationStep : ICompilationStep
{
protected ACompiler _compiler;
public bool Disabled { get; set; } = false;
public ACompilationStep(ACompiler compiler)
{
_compiler = compiler;

View File

@ -6,4 +6,6 @@ namespace Wabbajack.Compiler.CompilationSteps;
public interface ICompilationStep
{
ValueTask<Directive?> Run(RawSourceFile source);
bool Disabled { get; }
}

View File

@ -16,10 +16,12 @@ public class IgnoreDisabledMods : ACompilationStep
public IgnoreDisabledMods(ACompiler compiler) : base(compiler)
{
_mo2Compiler = (MO2Compiler) compiler;
//var alwaysEnabled = _mo2Compiler.ModInis.Where(f => HasFlagInNotes(f.Value, Consts.WABBAJACK_ALWAYS_ENABLE)).Select(f => f.Key).Distinct();
// TODO: Re-enable this
//var alwaysDisabled = _mo2Compiler.ModInis
// .Where(f => HasFlagInNotes(f.Value, Consts.WABBAJACK_ALWAYS_DISABLE)).Select(f => f.Key).Distinct();
if (!compiler.Settings.IsMO2Modlist)
{
Disabled = true;
return;
}
_allEnabledMods = _mo2Compiler._settings.AllProfiles
.SelectMany(p => _mo2Compiler._settings.Source.Combine("profiles", p, "modlist.txt").ReadAllLines())

View File

@ -18,6 +18,11 @@ public class IncludeThisProfile : ACompilationStep
public IncludeThisProfile(ACompiler compiler) : base(compiler)
{
_mo2Compiler = (MO2Compiler) compiler;
if (!compiler.Settings.IsMO2Modlist)
{
Disabled = true;
return;
}
_correctProfiles = _mo2Compiler._settings.AllProfiles
.Select(p => _mo2Compiler.MO2ProfileDir.Parent.Combine(p)).ToList();
}

View File

@ -48,6 +48,8 @@ public class CompilerSettings
[JsonIgnore]
public IEnumerable<string> AllProfiles => AdditionalProfiles.Append(Profile);
[JsonIgnore] public bool IsMO2Modlist => AllProfiles.Any(p => !string.IsNullOrWhiteSpace(p));
/// <summary>

View File

@ -314,6 +314,6 @@ public class MO2Compiler : ACompiler
if (!_settings.UseTextureRecompression)
steps = steps.Where(s => s is not MatchSimilarTextures).ToList();
return steps;
return steps.Where(s => !s.Disabled);
}
}

View File

@ -225,6 +225,7 @@ public static class GameRegistry
Game = Game.Dishonored,
NexusName = "dishonored",
MO2Name = "Dishonored",
MO2ArchiveName = "dishonored",
NexusGameId = 802,
SteamIDs = new[] {205100},
GOGIDs = new[] {1701063787},

View File

@ -215,9 +215,10 @@ public class NexusDownloader : ADownloader<Nexus>, IUrlDownloader
public override IEnumerable<string> MetaIni(Archive a, Nexus state)
{
var meta = state.Game.MetaData();
return new[]
{
$"gameName={state.Game.MetaData().MO2ArchiveName}", $"modID={state.ModID}", $"fileID={state.FileID}"
$"gameName={meta.MO2ArchiveName ?? meta.NexusName}", $"modID={state.ModID}", $"fileID={state.FileID}"
};
}
}