New properties will now be included in the output

This commit is contained in:
erri120 2019-10-07 16:44:28 +02:00
parent a6d93d6feb
commit bcf4705816
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
5 changed files with 45 additions and 9 deletions

View File

@ -174,13 +174,17 @@ namespace Wabbajack
return new LambdaCommand(() => true, () => OpenModListProperties());
}
}
internal ModlistPropertiesWindow modlistPropertiesWindow;
private ModlistPropertiesWindow modlistPropertiesWindow;
internal string newImagePath;
public bool ChangedProperties;
private void OpenModListProperties()
{
if (UIReady) {
if (modlistPropertiesWindow == null)
{
modlistPropertiesWindow = new ModlistPropertiesWindow(this);
newImagePath = "";
ChangedProperties = false;
}
modlistPropertiesWindow.Show();
@ -339,6 +343,12 @@ namespace Wabbajack
HTMLReport = _modList.ReportHTML;
Location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
SplashScreenModName = modlist.Name;
SplashScreenAuthorName = modlist.Author;
_nexusSiteURL = modlist.Website;
SplashScreenSummary = modlist.Description;
//if(modlist.Image != null) SplashScreenImage = modlist.Image;
SlideShowElements = modlist.Archives.OfType<NexusMod>().Select(m => new SlideShowItem
{
ModName = NexusApiUtils.FixupSummary(m.ModName),
@ -459,7 +469,12 @@ namespace Wabbajack
{
var compiler = new Compiler(_mo2Folder)
{
MO2Profile = ModListName
MO2Profile = ModListName,
ModListName = ChangedProperties ? SplashScreenModName : null,
ModListAuthor = ChangedProperties ? SplashScreenAuthorName : null,
ModListDescription = ChangedProperties ? SplashScreenSummary : null,
ModListImage = ChangedProperties ? newImagePath : null,
ModListWebsite = ChangedProperties ? _nexusSiteURL : null
};
var th = new Thread(() =>
{

View File

@ -23,6 +23,7 @@ using Directory = Alphaleonis.Win32.Filesystem.Directory;
using File = Alphaleonis.Win32.Filesystem.File;
using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo;
using Path = Alphaleonis.Win32.Filesystem.Path;
using System.Windows.Media.Imaging;
namespace Wabbajack
{
@ -37,6 +38,7 @@ namespace Wabbajack
public string MO2Profile;
public string ModListName, ModListAuthor, ModListDescription, ModListWebsite, ModListImage;
public Compiler(string mo2_folder)
{
@ -280,7 +282,11 @@ namespace Wabbajack
GameType = GameRegistry.Games.Values.First(f => f.MO2Name == MO2Ini.General.gameName).Game,
Archives = SelectedArchives,
Directives = InstallDirectives,
Name = MO2Profile
Name = ModListName ?? MO2Profile,
Author = ModListAuthor ?? "",
Description = ModListDescription ?? "",
Image = ModListImage,
Website = ModListWebsite ?? ""
};
ValidateModlist.RunValidation(ModList);

View File

@ -13,10 +13,11 @@
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="450"/>
<ColumnDefinition Width="450"/>
<ColumnDefinition Width="430"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Grid.Row="0" Margin="5">
@ -30,18 +31,24 @@
</Button>
</Grid>
<Grid Grid.Column="1" Grid.Row="0" Margin="5">
<Grid Grid.Column="1" Grid.Row="0" Margin="0 5 0 5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="423*"/>
<ColumnDefinition Width="17*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="234"/>
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Text="ModList Name" Name="ModlistNameProperty" ToolTip="Change the name of your ModList" MaxLength="50" AcceptsTab="False" FontSize="15" FontWeight="Bold" Margin="0 0 0 5" />
<TextBox Grid.Row="0" Text="ModList Name" Name="ModlistNameProperty" ToolTip="Change the name of your ModList" MaxLength="50" AcceptsTab="False" FontSize="15" FontWeight="Bold" Margin="0,0,0,5"/>
<TextBox Grid.Row="1" Text="Author" Name="ModlistAuthorProperty" ToolTip="Change the name of the Author" MaxLength="50" AcceptsTab="False" FontSize="15" Margin="0 0 0 5" />
<TextBox Grid.Row="2" Text="Description (700 characters max)" Name="ModlistDescriptionProperty" ToolTip="Change the description" MaxLength="700" AcceptsReturn="True" TextWrapping="Wrap" AcceptsTab="False" FontSize="15" Margin="0 0 0 5" />
<TextBox Grid.Row="2" Text="Description (700 characters max)" Name="ModlistDescriptionProperty" ToolTip="Change the description" MaxLength="700" AcceptsReturn="True" TextWrapping="Wrap" AcceptsTab="False" FontSize="15" Margin="0,0,0,-23"/>
</Grid>
<Button Grid.Row="1" Grid.ColumnSpan="2" Click="SaveProperties_Click">
<TextBox Grid.ColumnSpan="2" Text="Website" Name="ModlistWebsiteProperty" ToolTip="Change the website" MaxLength="80" AcceptsReturn="False" AcceptsTab="False" FontSize="15" Margin="5,328,17,128"/>
<Button Grid.Row="2" Grid.ColumnSpan="2" Click="SaveProperties_Click">
<TextBlock Text="Save" FontSize="15" FontWeight="Bold"/>
</Button>
</Grid>

View File

@ -59,11 +59,16 @@ namespace Wabbajack
string modListName = ModlistNameProperty.Text;
string modListAuthor = ModlistAuthorProperty.Text;
string modListDescription = ModlistDescriptionProperty.Text;
string modListWebsite = ModlistWebsiteProperty.Text;
state.newImagePath = System.IO.Path.GetFileName(newBannerFile);
state.SplashScreenImage = splashScreen;
state.SplashScreenModName = modListName;
state.SplashScreenSummary = modListDescription;
state.SplashScreenAuthorName = modListAuthor;
state._nexusSiteURL = modListWebsite;
state.ChangedProperties = true;
Hide();
}

View File

@ -46,7 +46,10 @@ namespace Wabbajack
public void Build(Compiler c, ModList lst)
{
Text($"### {lst.Name} - Installation Summary");
Text($"### {lst.Name} by {lst.Author} - Installation Summary");
Text(lst.Description);
Text($"#### Website:");
NoWrapText($"[{lst.Website}]({lst.Website})");
var readme_file = Path.Combine(c.MO2ProfileDir, "readme.md");
if (File.Exists(readme_file))