[RFC] MelonInfo constructor with `(int, int, int)` versioning
xKiraiChan opened this issue ยท 7 comments
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")]
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
and then you have to deal with V
, version
, Version
, ...
Why suggest a bandage fix over a better design?
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
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.