sync profileXML with Launcher

pull/9/head
Miepee 4 years ago
parent 3cc9e9b02e
commit 2ade37c70a

@ -9,7 +9,7 @@ public partial class ModPacker : Form
{
public ModPacker()
{
profile = new ModProfileXML("", 1, "", "", "", false, "", false, false, ""); // (1, "", "", false, "default", false, false);
profile = new ModProfileXML();
Title = "AM2R ModPacker " + version;
// Currently broken as I don't know how to do this from Rider

@ -328,7 +328,7 @@ public partial class ModPacker : Form
profile.Version = versionTextBox.Text;
profile.UsesCustomMusic = musicCheckBox.Checked.Value;
profile.UsesYYC = yycCheckBox.Checked.Value;
profile.Android = apkCheckBox.Checked.Value;
profile.SupportsAndroid = apkCheckBox.Checked.Value;
profile.ProfileNotes = modNotesTextBox.Text;
profile.OperatingSystem = operatingSystem.ToString();
if (customSaveCheckBox.Checked.Value && customSaveTextBox.Text != "")

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Nullable>disable</Nullable>
<LangVersion>10</LangVersion>
</PropertyGroup>

@ -104,7 +104,7 @@ public static class Core
}
// Create game.droid patch and wrapper if Android is supported
if (profile.Android)
if (profile.SupportsAndroid)
{
string tempAndroid = Directory.CreateDirectory(tempPath + "/android").FullName;

@ -2,64 +2,82 @@
namespace AM2RModPackerLib.XML;
//TODO: sync this with the launcher xml, a bunch more comments are in there.
/// <summary>
/// Class that handles how the modmeta settings are saved as XML.
/// Class that handles how the mod settings are saved as XML.
/// </summary>
[Serializable]
[XmlRoot("message")]
public class ModProfileXML
{
/// <summary>Indicates the Operating system the mod was made for.</summary>
[XmlAttribute("OperatingSystem")]
public string OperatingSystem
{ get; set; }
/// <summary>Indicates the xml version the mod was made in.</summary>
[XmlAttribute("XMLVersion")]
public int XMLVersion
{ get; set; }
/// <summary>Indicates the version of the mod.</summary>
[XmlAttribute("Version")]
public string Version
{ get; set; }
/// <summary>Indicates the mod's name.</summary>
[XmlAttribute("Name")]
public string Name
{ get; set; }
/// <summary>Indicates the mod's author.</summary>
[XmlAttribute("Author")]
public string Author
{ get; set; }
/// <summary>Indicates whether or not the mod uses custom music.</summary>
[XmlAttribute("UsesCustomMusic")]
public bool UsesCustomMusic
{ get; set; }
/// <summary>Indicates the save location of the mod.</summary>
[XmlAttribute("SaveLocation")]
public string SaveLocation
{ get; set; }
/// <summary>Indicates whether or not the mod supports Android.</summary>
[XmlAttribute("SupportsAndroid")]
public bool Android
public bool SupportsAndroid
{ get; set; }
/// <summary>Indicates whether or not the mod was compiled with YYC.</summary>
[XmlAttribute("UsesYYC")]
public bool UsesYYC
{ get; set; }
/// <summary>Indicates if the mod is installable. This is only <see langword="false"/> for archival community updates mods.</summary>
[XmlAttribute("Installable")]
public bool Installable
{ get; set; }
/// <summary>Indicates any notes that the mod author deemed worthy to share about his mod.</summary>
[XmlAttribute("ProfileNotes")]
public string ProfileNotes
{ get; set; }
// TODO: this should fill in sensible default values
/// <summary>Creates a <see cref="ModProfileXML"/> with a default set of attributes.</summary>
public ModProfileXML()
{ }
{
XMLVersion = 1;
Installable = true;
}
public ModProfileXML(string operatingSystem, int xmlVersion, string version, string name, string author, bool usesCustomMusic, string saveLocation, bool android, bool usesYYC, string profileNotes, bool installable = true)
/// <summary>
/// Creates a <see cref="ModProfileXML"/> with a custom set of attributes.
/// </summary>
/// <param name="operatingSystem">The operating system the mod was made on.</param>
/// <param name="xmlVersion">The xml version the mod was created with.</param>
/// <param name="version">The version of the mod.</param>
/// <param name="name">The mod name.</param>
/// <param name="author">The mod author.</param>
/// <param name="usesCustomMusic">Whether or not the mod uses custom music.</param>
/// <param name="saveLocation">The save location of the mod.</param>
/// <param name="android">Whether or not the mod works for android.</param>
/// <param name="usesYYC">Whether or not the mod was made with YYC.</param>
/// <param name="installable">Whether or not the mod is installable.</param>
/// <param name="profileNotes">The notes of the mod.</param>
public ModProfileXML(string operatingSystem, int xmlVersion, string version, string name, string author,
bool usesCustomMusic, string saveLocation, bool android, bool usesYYC,
bool installable, string profileNotes)
{
OperatingSystem = operatingSystem;
XMLVersion = xmlVersion;
@ -68,9 +86,9 @@ public class ModProfileXML
Author = author;
UsesCustomMusic = usesCustomMusic;
SaveLocation = saveLocation;
Android = android;
SupportsAndroid = android;
UsesYYC = usesYYC;
ProfileNotes = profileNotes;
Installable = installable;
ProfileNotes = profileNotes;
}
}
Loading…
Cancel
Save