MelonLoader

MelonLoader

242 Downloads

[RFC] MelonInfo constructor with `(int, int, int)` versioning

xKiraiChan opened this issue ยท 7 comments

commented

MelonLoader's preferred versioning system is SemVer, which commonly uses 3 integers delimited by periods.
Some creators have accidentally put a v into their version number not expecting ML to add one.
Using an integer tuple would prevent this.

Since this would be an override, it shouldn't break old mods using the old constructor.

Additionally, this would allow in the future for MelonLoader to check if a dependency's version meets the minimum that a mod requires.

Example:

[assembly: MelonInfo(typeof(...), "Name", "1.2.3", "Author", "Link")]
could be converted to
[assembly: MelonInfo(typeof(...), "Name", (1, 2, 3), "Author", "Link")]

commented

Additionally, MelonLoader does not support a null version (but used to), but strings are able to be empty or \x1b[1D
If versioning is going to be enforced it would be easier using integral types

commented

version.Replace("v", string.Empty)
problem solved

commented

and then you have to deal with V, version, Version, ...

Why suggest a bandage fix over a better design?

commented

This could be a thing. Maybe not implemented this way and not replacing the string function (since we can have semvers like 1.2.3-testing2), but I like the idea

commented

Why not (int, int, int) or (int, int, int, string), then the string just gets appended to the end when it is written to console or printed?

Ex: [assembly: MelonInfo(typeof(...), "Name", (1, 2, 3, "-beta"), "Author", "Link")] which would print version as 1.2.3-beta. The string parameter could be called comment, branch, or something along those lines.

Edit: It may also be helpful to add a method into MelonUtils that converts SemVer strings into the int/string representation of it.

commented

This is now added in the latest alpha-development nightly build.

commented

Moving this back to v0.6.0 as the recent attempt for v0.5.7 caused Melon compilation issues.