Added Readme to output

This commit is contained in:
erri120 2019-10-11 14:56:55 +02:00
parent ec6e40e8bc
commit ed3b46e99b
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
2 changed files with 28 additions and 8 deletions

View File

@ -33,7 +33,7 @@ namespace Wabbajack
public string MO2Profile;
public string ModListName, ModListAuthor, ModListDescription, ModListWebsite, ModListImage;
public string ModListName, ModListAuthor, ModListDescription, ModListWebsite, ModListImage, ModListReadme;
public Compiler(string mo2_folder)
{
@ -280,6 +280,7 @@ namespace Wabbajack
Name = ModListName ?? MO2Profile,
Author = ModListAuthor ?? "",
Description = ModListDescription ?? "",
Readme = ModListReadme ?? "",
Image = ModListImage ?? "",
Website = ModListWebsite ?? ""
};
@ -675,12 +676,26 @@ namespace Wabbajack
{
return source =>
{
if (source.AbsolutePath != ModListImage) return null;
if (!File.Exists(ModListImage)) return null;
var files = new HashSet<string>
{
ModListImage, ModListReadme
};
if (!files.Any(f => source.AbsolutePath.Equals(f))) return null;
if (!File.Exists(source.AbsolutePath)) return null;
var isBanner = source.AbsolutePath == ModListImage;
//var isReadme = source.AbsolutePath == ModListReadme;
var result = source.EvolveTo<PropertyFile>();
result.Type = PropertyType.Banner;
result.SourceDataID = IncludeFile(File.ReadAllBytes(ModListImage));
ModListImage = result.SourceDataID;
result.SourceDataID = IncludeFile(File.ReadAllBytes(source.AbsolutePath));
if (isBanner)
{
result.Type = PropertyType.Banner;
ModListImage = result.SourceDataID;
}
else
{
result.Type = PropertyType.Readme;
ModListReadme = result.SourceDataID;
}
return result;
};
}

View File

@ -65,7 +65,7 @@ namespace Wabbajack
public string Description;
/// <summary>
/// Image of the ModList
/// Hash of the banner-image
/// </summary>
public string Image;
@ -74,6 +74,11 @@ namespace Wabbajack
/// </summary>
public string Website;
/// <summary>
/// Hash of the readme
/// </summary>
public string Readme;
/// <summary>
/// Content Report in HTML form
/// </summary>
@ -111,7 +116,7 @@ namespace Wabbajack
public string SourceDataID;
}
public enum PropertyType { Banner }
public enum PropertyType { Banner, Readme }
/// <summary>
/// File meant to be extracted before the installation