Skip to content

Commit

Permalink
Version check (#36)
Browse files Browse the repository at this point in the history
* comparing OWML versions again
  • Loading branch information
amazingalek committed Dec 30, 2019
1 parent 26c2596 commit 7ebe337
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions OWML.Common/IModManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public interface IModManifest
string Author { get; }
string Name { get; }
string Version { get; }
string OWMLVersion { get; }
string AssemblyPath { get; }
string UniqueName { get; }
string FolderPath { get; set; }
Expand Down
9 changes: 6 additions & 3 deletions OWML.Launcher/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ namespace OWML.Launcher
{
public class App
{
private const string Version = "0.3.1";

private readonly string[] _filesToCopy = { "UnityEngine.CoreModule.dll", "Assembly-CSharp.dll" };

public void Run()
{
Console.WriteLine("Started OWML.");
Console.WriteLine($"Started OWML version {Version}");

var config = GetConfig();

Expand Down Expand Up @@ -84,8 +86,9 @@ private void ShowModList(IModFinder modFinder)
Console.WriteLine("Found mods:");
foreach (var manifest in manifests)
{
var stateText = manifest.Enabled ? "" : "(disabled)";
Console.WriteLine($"* {manifest.UniqueName} ({manifest.Version}) {stateText}");
var stateText = manifest.Enabled ? "" : " (disabled)";
var versionText = manifest.OWMLVersion == Version ? "" : $" (Warning: made for other version of OWML: {manifest.OWMLVersion})";
Console.WriteLine($"* {manifest.UniqueName} ({manifest.Version}){stateText}{versionText}");
}
}

Expand Down
1 change: 0 additions & 1 deletion OWML.ModHelper/ModBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ public void Init(IModHelper modHelper)
ModHelper = modHelper;
DontDestroyOnLoad(gameObject);
}

}
}
3 changes: 3 additions & 0 deletions OWML.ModHelper/ModManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class ModManifest : IModManifest
[JsonProperty("version")]
public string Version { get; private set; }

[JsonProperty("owmlVersion")]
public string OWMLVersion { get; private set; }

[JsonProperty("enabled")]
public bool Enabled { get; private set; }

Expand Down
1 change: 1 addition & 0 deletions OWML.SampleMods/OWML.EnableDebugMode/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "EnableDebugMode",
"uniqueName": "Alek.EnableDebugMode",
"version": "0.2",
"owmlVersion": "0.3.1",
"enabled": false
}
1 change: 1 addition & 0 deletions OWML.SampleMods/OWML.LightBramble/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "LightBramble",
"uniqueName": "Alek.LightBramble",
"version": "0.1",
"owmlVersion": "0.3.1",
"enabled": false
}
1 change: 1 addition & 0 deletions OWML.SampleMods/OWML.LoadCustomAssets/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "LoadCustomAssets",
"uniqueName": "Alek.LoadCustomAssets",
"version": "0.3",
"owmlVersion": "0.3.1",
"enabled": false
}
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Each mod is defined in a manifest.json file:
|name|The name of the mod.|
|uniqueName|Usually {author}.{uniqueName}.|
|version|The version number.|
|owmlVersion|The version of OWML the mod was built for.|
|enabled|Whether or not the mod will be loaded.|

## Compatibility
Expand Down

0 comments on commit 7ebe337

Please sign in to comment.