Skip to content

Commit e582096

Browse files
committed
Fix versions again.
1 parent 58047d4 commit e582096

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

000-ModManager/Manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ModManifest>
22
<ManifestUrl>https://raw.githubusercontent.com/FilUnderscore/ModManager/dev/000-ModManager/Manifest.xml</ManifestUrl>
3-
<Version>1.0.4</Version>
3+
<Version>1.0.5</Version>
44
<GameVersion ReleaseType="Alpha" Major="21" Minor="0" Build="324" />
55
</ModManifest>

000-ModManager/ModInfo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<ModInfo>
33
<Name value="ModManager" />
4-
<Version value="1.0.4" />
4+
<Version value="1.0.5" />
55
<DisplayName value="Mod Manager"/>
66
<Description value="Smarter way to manage your mods." />
77
<Author value="FilUnderscore" />

Source/Mod/Info/ModInfo.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,33 @@ public sealed class ModInfo
1212
public IModVersion Version { get; private set; }
1313
public string Website { get; private set; }
1414

15-
public ModInfo(global::Mod mod) : this(mod.Path, mod.Name, mod.DisplayName, mod.Description, mod.Author, Parse(mod.Version), mod.Website)
15+
public ModInfo(global::Mod mod) : this(mod.Path, mod.Name, mod.DisplayName, mod.Description, mod.Author, new ModVersion(mod.Version), mod.Website)
1616
{
1717
}
1818

1919
public ModInfo(string path, string name, string displayName, string description, string author, IModVersion version, string website)
2020
{
2121
this.Path = path;
2222
this.Name = name;
23-
this.DisplayName = displayName;
23+
this.DisplayName = string.IsNullOrEmpty(displayName) ? name : displayName;
2424
this.Description = description;
2525
this.Author = author;
2626
this.Version = version;
2727
this.Website = website;
2828
}
2929

30-
private static IModVersion Parse(System.Version version)
30+
private sealed class ModVersion : IModVersion
3131
{
32-
if (version != null)
33-
{
34-
IModVersion modVersion = SemVer.Parse(version.ToString());
35-
36-
if (modVersion == null)
37-
modVersion = SemVer.Parse($"{version.Major}.{version.Minor}.{version.Build}-rev.{version.Revision}");
32+
private readonly System.Version version;
3833

39-
return modVersion;
40-
}
41-
else
34+
public ModVersion(System.Version version)
4235
{
43-
return new UndefinedModVersion();
36+
this.version = version;
4437
}
45-
}
4638

47-
private sealed class UndefinedModVersion : IModVersion
48-
{
4939
public override string ToString()
5040
{
51-
return "Undefined";
41+
return this.version != null ? this.version.ToString() : "Undefined";
5242
}
5343
}
5444
}

0 commit comments

Comments
 (0)