Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/KKManager.Core/Data/Zipmods/Manifest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Sideloader.AutoResolver;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Xml;
Expand All @@ -19,6 +20,8 @@ namespace Sideloader
/// <summary>
/// Contains data about the loaded manifest.xml
/// </summary>
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Manifest
{
/// <summary>
Expand Down Expand Up @@ -86,6 +89,7 @@ public string Description
/// Parsed contents of the manifest.xml.
/// </summary>
public XDocument ManifestDocument => manifestDocument;
[Browsable(false)]
public XElement ManifestDocumentRoot => ManifestDocument.Root;
// /// <summary>
// /// Raw contents of the manifest.xml.
Expand All @@ -102,6 +106,7 @@ public string Description
/// <summary>
/// Games the mod is made for. If specified, the mod will only load for those games. If not specified will load on any game.
/// </summary>
[TypeConverter(typeof(ListTypeConverter))]
public List<string> Games
{
get => ManifestDocumentRoot.Elements().Where(x => x.Name.ToString().Equals("game", StringComparison.OrdinalIgnoreCase)).Select(x => x.Value.Trim()).Where(x => x.Length > 0).ToList();
Expand All @@ -115,10 +120,13 @@ public List<string> Games
/// <summary>
/// List of all migration info for this mod
/// </summary>
[TypeConverter(typeof(ListTypeConverter))]
public List<MigrationInfo> MigrationList { get; }

#if AI || HS2
[TypeConverter(typeof(ListTypeConverter))]
[Key(10)] public List<HeadPresetInfo> HeadPresetList { get; }
[TypeConverter(typeof(ListTypeConverter))]
[Key(11)] public List<FaceSkinInfo> FaceSkinList { get; }
#endif

Expand Down
26 changes: 25 additions & 1 deletion src/KKManager.Core/Data/Zipmods/MigrationInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using MessagePack;
using System.ComponentModel;
using MessagePack;

namespace Sideloader.AutoResolver
{
/// <summary>
/// Data about the migration to be performed
/// </summary>
[MessagePackObject]
[ReadOnly(true)]
public class MigrationInfo
{
/// <summary>
Expand Down Expand Up @@ -56,5 +58,27 @@ public MigrationInfo(MigrationType migrationType, string guidOld, string guidNew
GUIDOld = guidOld;
GUIDNew = guidNew;
}

public override string ToString()
{
var sb = new System.Text.StringBuilder();
sb.AppendFormat("migrationType=\"{0}\"", MigrationType);

if (!string.IsNullOrEmpty(Category))
sb.AppendFormat(" category=\"{0}\"", Category);

if (!string.IsNullOrEmpty(GUIDOld))
sb.AppendFormat(" guidOld=\"{0}\"", GUIDOld);

if (!string.IsNullOrEmpty(GUIDNew))
sb.AppendFormat(" guidNew=\"{0}\"", GUIDNew);

if (IDOld != 0 || IDNew != 0)
{
sb.AppendFormat(" idOld=\"{0}\"", IDOld);
sb.AppendFormat(" idNew=\"{0}\"", IDNew);
}
return sb.ToString();
}
}
}
1 change: 0 additions & 1 deletion src/KKManager.Core/Data/Zipmods/SideloaderModInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public SideloaderModInfo(FileInfo location, Manifest manifest, List<Func<Image>>
}
}

[Browsable(false)]
public Manifest Manifest { get; }

[Browsable(false)]
Expand Down
15 changes: 12 additions & 3 deletions src/KKManager/Windows/Content/SideloaderModsWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 45 additions & 24 deletions src/KKManager/Windows/Content/SideloaderModsWindow.resx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
<data name="olvColumnGames.Width" type="System.Int32, mscorlib">
<value>90</value>
</data>
<data name="olvColumnFilename.DisplayIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="olvColumnFilename.Text" xml:space="preserve">
<value>File name</value>
</data>
Expand All @@ -170,12 +173,24 @@
<data name="olvColumnPath.Width" type="System.Int32, mscorlib">
<value>200</value>
</data>
<data name="olvColumnWebsite.DisplayIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="olvColumnWebsite.Text" xml:space="preserve">
<value>Website</value>
</data>
<data name="olvColumnWebsite.Width" type="System.Int32, mscorlib">
<value>123</value>
</data>
<data name="olvColumnContentType.DisplayIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="olvColumnContentType.Text" xml:space="preserve">
<value>Contents Kind</value>
</data>
<data name="olvColumnContentType.Width" type="System.Int32, mscorlib">
<value>104</value>
</data>
<data name="objectListView1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
Expand Down Expand Up @@ -204,6 +219,30 @@
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>891, 25</value>
</data>
<data name="toolStrip1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="toolStrip1.Text" xml:space="preserve">
<value>toolStrip1</value>
</data>
<data name="&gt;&gt;toolStrip1.Name" xml:space="preserve">
<value>toolStrip1</value>
</data>
<data name="&gt;&gt;toolStrip1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStrip1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;toolStrip1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
Expand Down Expand Up @@ -336,30 +375,6 @@
<data name="toolStripTextBoxSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 25</value>
</data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>891, 25</value>
</data>
<data name="toolStrip1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="toolStrip1.Text" xml:space="preserve">
<value>toolStrip1</value>
</data>
<data name="&gt;&gt;toolStrip1.Name" xml:space="preserve">
<value>toolStrip1</value>
</data>
<data name="&gt;&gt;toolStrip1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStrip1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;toolStrip1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down Expand Up @@ -426,6 +441,12 @@
<data name="&gt;&gt;olvColumnWebsite.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Version=2.9.1.1072, Culture=neutral, PublicKeyToken=b1c5bf581481bcd4</value>
</data>
<data name="&gt;&gt;olvColumnContentType.Name" xml:space="preserve">
<value>olvColumnContentType</value>
</data>
<data name="&gt;&gt;olvColumnContentType.Type" xml:space="preserve">
<value>BrightIdeasSoftware.OLVColumn, ObjectListView, Version=2.9.1.1072, Culture=neutral, PublicKeyToken=b1c5bf581481bcd4</value>
</data>
<data name="&gt;&gt;toolStripButton1.Name" xml:space="preserve">
<value>toolStripButton1</value>
</data>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading