|
|
@@ -11,7 +11,7 @@ using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Windows.Forms; |
|
|
|
|
|
|
|
namespace GCMM |
|
|
|
namespace TBMM |
|
|
|
{ |
|
|
|
partial class MainForm |
|
|
|
{ |
|
|
@@ -53,11 +53,11 @@ namespace GCMM |
|
|
|
} |
|
|
|
try |
|
|
|
{ |
|
|
|
string mmpath = "GCMM.exe"; |
|
|
|
string mmpath = "TBMM.exe"; |
|
|
|
if (File.Exists(mmpath)) |
|
|
|
{ |
|
|
|
var an = AssemblyName.GetAssemblyName(mmpath); |
|
|
|
gcmm.Version = an.Version; |
|
|
|
tbmm.Version = an.Version; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (BadImageFormatException) |
|
|
@@ -79,20 +79,21 @@ namespace GCMM |
|
|
|
var mod = new ModInfo |
|
|
|
{ |
|
|
|
Author = sp[0].Trim(), |
|
|
|
Name = sp[1].Trim() |
|
|
|
Name = sp[1].Trim(), |
|
|
|
LastUpdated = sp.Length > 2 ? DateTime.Parse(sp[2].Trim()) : default |
|
|
|
}; |
|
|
|
if (await FetchModInfo(mod, preview, true)) //If it's actually a mod |
|
|
|
AddUpdateModInList(mod); |
|
|
|
} |
|
|
|
} |
|
|
|
if (gcmm.LatestVersion == null) //Only check once |
|
|
|
if (tbmm.LatestVersion == null) //Only check once |
|
|
|
{ |
|
|
|
await FetchModInfo(gcipa, preview, false); |
|
|
|
await FetchModInfo(gcmm, preview, false); |
|
|
|
if (gcmm.Updatable) |
|
|
|
if (MessageBox.Show("There is a GCMM update available! Do you want to download it now? If yes, extract it over this installation.\n\n" + gcmm.UpdateDetails, "Mod Manager update", MessageBoxButtons.YesNo) |
|
|
|
await FetchModInfo(tbmm, preview, false); |
|
|
|
if (tbmm.Updatable) |
|
|
|
if (MessageBox.Show("There is a TBMM update available! Do you want to download it now? If yes, extract it over this installation.\n\n" + tbmm.UpdateDetails, "Mod Manager update", MessageBoxButtons.YesNo) |
|
|
|
== DialogResult.Yes) |
|
|
|
Process.Start(gcmm.DownloadURL); |
|
|
|
Process.Start(tbmm.DownloadURL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -134,7 +135,9 @@ namespace GCMM |
|
|
|
}); |
|
|
|
|
|
|
|
mod.DownloadURL = asset?["browser_download_url"]?.ToString(); |
|
|
|
mod.LastUpdated = (DateTime)release["published_at"]; |
|
|
|
var lastUpdated = (DateTime)release["published_at"]; |
|
|
|
if (mod.LastUpdated < lastUpdated) |
|
|
|
mod.LastUpdated = lastUpdated; //If there's a newer release than the last known working date |
|
|
|
|
|
|
|
var ver = verstr.Split('.').Select(str => int.Parse(str)).ToArray(); |
|
|
|
int getver(byte i) => ver.Length > i ? ver[i] : 0; //By default it sets values not present to -1, but we need them to be 0 |
|
|
@@ -189,7 +192,7 @@ namespace GCMM |
|
|
|
if (mod.LatestVersion != null && mod.Version != null && mod.Version < mod.LatestVersion) |
|
|
|
item.ForeColor = Color.Blue; |
|
|
|
else if (mod.LastUpdated != default && mod.LastUpdated < lastGameUpdateTime) |
|
|
|
item.ForeColor = Color.DarkOrange; |
|
|
|
item.ForeColor = Color.OrangeRed; |
|
|
|
else |
|
|
|
item.ForeColor = modlist.ForeColor; |
|
|
|
} |
|
|
|