Skip to content

Commit

Permalink
Bump version number
Browse files Browse the repository at this point in the history
- Also add check to see if newer version is actually a newer version so dev builds can show the notification
  • Loading branch information
silent-destroyer committed Oct 21, 2024
1 parent acd3823 commit db6025f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion src/Patches/TitleVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public static void Initialize() {
StreamReader Reader = new StreamReader(response.GetResponseStream());
string JsonResponse = Reader.ReadToEnd();
dynamic Releases = JsonConvert.DeserializeObject<dynamic>(JsonResponse);
UpdateAvailable = Releases[0]["tag_name"].ToString() != PluginInfo.VERSION && !DevBuild;
UpdateVersion = Releases[0]["tag_name"].ToString();
UpdateAvailable = isNewerVersion(UpdateVersion);
} catch (Exception e) {
TunicLogger.LogInfo(e.Message);
}
Expand Down Expand Up @@ -64,5 +64,20 @@ public static void Initialize() {
TitleButtons = GameObject.Find("_GameGUI(Clone)/Title Canvas/Title Screen Root/Button Group/");
}

private static bool isNewerVersion(string newVersion) {
string currentVersion = PluginInfo.VERSION;
if (currentVersion == newVersion && DevBuild) {
return true;
}
string[] newSplit = newVersion.Split('.');
string[] currentSplit = currentVersion.Split('.');
for(int i = 0; i < currentSplit.Length; i++) {
if (int.Parse(newSplit[i]) > int.Parse(currentSplit[i])) {
return true;
}
}
return false;
}

}
}
2 changes: 1 addition & 1 deletion src/PluginInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace TunicRandomizer {
public class PluginInfo {
public const string NAME = "Tunic Randomizer";
public const string VERSION = "4.0.1";
public const string VERSION = "4.0.2";
public const string GUID = "silentdestroyer.tunic.randomizer";
}
}

0 comments on commit db6025f

Please sign in to comment.