mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added Readme to output
This commit is contained in:
parent
ec6e40e8bc
commit
ed3b46e99b
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user