Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
/ ModManager Public archive

Commit

Permalink
version 5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MatuxGG committed Jun 11, 2022
1 parent f3b383d commit 601095c
Show file tree
Hide file tree
Showing 26 changed files with 143 additions and 1,015 deletions.
2 changes: 1 addition & 1 deletion MakeExecutable.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "D:\visualstudio\ModManager5\Installer\CodeDependencies.iss"

#define MyAppName "ModManager"
#define MyAppVersion "5.0.8"
#define MyAppVersion "5.0.9"
#define MyAppPublisher "Matux"
#define MyAppURL "https://matux.fr"
#define MyAppExeName "ModManager5.exe"
Expand Down
32 changes: 0 additions & 32 deletions ModManager5/Classes/Account.cs

This file was deleted.

4 changes: 3 additions & 1 deletion ModManager5/Classes/Category.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
 using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -8,6 +9,7 @@ namespace ModManager5.Classes
{
public class Category
{
[JsonProperty(PropertyName = "sId")]
public string id;
public string name;
public string type;
Expand Down
7 changes: 4 additions & 3 deletions ModManager5/Classes/CategoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static void load()
{
Utils.log("Load START", "CategoryManager");
if (!ModManager.silent)
ModManagerUI.StatusLabel.Text = "Loading Mod Categories...";
string catlistURL = ModManager.apiURL + "/category/list";
ModManagerUI.StatusLabel.Text = Translator.get("Loading categories...");
string catlistURL = ModManager.apiURL + "/cat";
string cat = "";
try
{
Expand All @@ -26,9 +26,10 @@ public static void load()
cat = client.DownloadString(catlistURL);
}
}
catch
catch (Exception e)
{
Utils.logE("Load connection FAIL", "CategoryManager");
Utils.logEx(e, "CategoryManager");
MessageBox.Show("Mod Manager's server is unreacheable.\n" +
"\n" +
"There are many possible reasons for this :\n" +
Expand Down
38 changes: 23 additions & 15 deletions ModManager5/Classes/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void load()
{
Utils.log("Load config START", "ConfigManager");
if (!ModManager.silent)
ModManagerUI.StatusLabel.Text = "Loading Local Config...";
ModManagerUI.StatusLabel.Text = Translator.get("Loading Local Config...");
config = new Config();
if (File.Exists(path))
{
Expand Down Expand Up @@ -215,23 +215,31 @@ public static Boolean containsGameVersion(string version)
public static void logConfig()
{
Utils.log("Computer information", "ConfigManager");
ComputerInfo c = new ComputerInfo();
decimal ram = c.TotalPhysicalMemory;
ram = Math.Round(ram / (1024 * 1024 * 1024), 1);
Utils.log("- OS Version: " + c.OSFullName, "ConfigManager");
Utils.log("- OS Language: " + c.InstalledUICulture.Name, "ConfigManager");
Utils.log("- Processor: " + System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"), "ConfigManager");
Utils.log("- RAM: " + ram.ToString() + "Go", "ConfigManager");
Utils.log("- Drives:", "ConfigManager");
foreach (DriveInfo d in DriveInfo.GetDrives())
try
{
decimal free = d.AvailableFreeSpace;
decimal total = d.TotalSize;
free = Math.Round(free / (1024 * 1024 * 1024), 1);
total = Math.Round(total / (1024 * 1024 * 1024), 1);
ComputerInfo c = new ComputerInfo();
decimal ram = c.TotalPhysicalMemory;
ram = Math.Round(ram / (1024 * 1024 * 1024), 1);
Utils.log("- OS Version: " + c.OSFullName, "ConfigManager");
Utils.log("- OS Language: " + c.InstalledUICulture.Name, "ConfigManager");
Utils.log("- Processor: " + System.Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"), "ConfigManager");
Utils.log("- RAM: " + ram.ToString() + "Go", "ConfigManager");
Utils.log("- Drives:", "ConfigManager");
foreach (DriveInfo d in DriveInfo.GetDrives())
{
decimal free = d.AvailableFreeSpace;
decimal total = d.TotalSize;
free = Math.Round(free / (1024 * 1024 * 1024), 1);
total = Math.Round(total / (1024 * 1024 * 1024), 1);

Utils.log(" - Drive " + d.Name + ":" + free + "/" + total, "ConfigManager");
Utils.log(" - Drive " + d.Name + ":" + free + "/" + total, "ConfigManager");
}
} catch (Exception e)
{
Utils.logE("Loading computer info FAIL", "ConfigManager");
Utils.logEx(e, "ConfigManager");
}

}
}

Expand Down
10 changes: 6 additions & 4 deletions ModManager5/Classes/Dependency.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -8,15 +9,16 @@ namespace ModManager5.Classes
{
public class Dependency
{
[JsonProperty(PropertyName = "sId")]
public string id;
public string name;
public string isAvailable;
public string file;

public Dependency(string id, string name, string isAvailable)
public Dependency(string id, string name, string file)
{
this.id = id;
this.name = name;
this.isAvailable = isAvailable;
this.file = file;
}
}
}
7 changes: 4 additions & 3 deletions ModManager5/Classes/DependencyList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static void load()
{
Utils.log("Load START", "DependencyList");
if (!ModManager.silent)
ModManagerUI.StatusLabel.Text = "Loading Dependencies...";
string dependenciesURL = ModManager.apiURL + "/dependency/list";
ModManagerUI.StatusLabel.Text = Translator.get("Loading Dependencies...");
string dependenciesURL = ModManager.apiURL + "/dep";
string dependencylist = "";
try
{
Expand All @@ -25,9 +25,10 @@ public static void load()
dependencylist = client.DownloadString(dependenciesURL);
}
}
catch
catch (Exception e)
{
Utils.logE("Load connection FAIL", "DependencyList");
Utils.logEx(e, "DependencyList");
MessageBox.Show("Mod Manager's server is unreacheable.\n" +
"\n" +
"There are many possible reasons for this :\n" +
Expand Down
15 changes: 10 additions & 5 deletions ModManager5/Classes/DownloadWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@ public static class DownloadWorker
public static ModManager thisModManager;
public static Boolean finished;
public static string thisSentence;
public static int thisOffset;
public static int thisPercent;

public static void load(ModManager modManager)
{
Utils.log("Load", "DownloadWorker");
thisModManager = modManager;
}

public static void download(string path, string destPath, string sentence)
public static void download(string path, string destPath, string sentence, int offset, int percent)
{
Utils.log("Download START", "DownloadWorker");
finished = false;
thisSentence = sentence;
thisOffset = offset;
thisPercent = percent;
thisModManager.Invoke((MethodInvoker)delegate
{
if (!ModManager.silent)
{
ModManagerUI.StatusLabel.Text = Translator.get(thisSentence).Replace("PERCENT", "0");
ModManagerUI.StatusLabel.Text = Translator.get(thisSentence).Replace("PERCENT", thisOffset.ToString() + "%");
}
});
WebClient client = new WebClient();
Expand All @@ -50,10 +54,10 @@ private static void client_DownloadProgressChanged(object sender, DownloadProgre
thisModManager.Invoke((MethodInvoker)delegate {
double bytesIn = double.Parse(e.BytesReceived.ToString());
double totalBytes = double.Parse(e.TotalBytesToReceive.ToString());
double percentage = bytesIn / totalBytes * 100;
double percentage = (bytesIn / totalBytes * thisPercent) + thisOffset;
if (!ModManager.silent)
{
string text = Translator.get(thisSentence).Replace("PERCENT", ((int)percentage).ToString());
string text = Translator.get(thisSentence).Replace("PERCENT", ((int)percentage).ToString() + "%");
if (ModManagerUI.StatusLabel.Text != text)
{
ModManagerUI.StatusLabel.Text = text;
Expand All @@ -66,7 +70,8 @@ private static void client_DownloadFileCompleted(object sender, AsyncCompletedEv
thisModManager.Invoke((MethodInvoker)delegate {
if (!ModManager.silent)
{
ModManagerUI.StatusLabel.Text = Translator.get(thisSentence).Replace("PERCENT", "100");
int currentPerc = thisOffset + thisPercent;
ModManagerUI.StatusLabel.Text = Translator.get(thisSentence).Replace("PERCENT", currentPerc.ToString() + "%");
}
finished = true;
});
Expand Down
22 changes: 0 additions & 22 deletions ModManager5/Classes/Faq.cs

This file was deleted.

58 changes: 0 additions & 58 deletions ModManager5/Classes/FaqList.cs

This file was deleted.

5 changes: 3 additions & 2 deletions ModManager5/Classes/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Language()
public void load()
{
Utils.log("Load START", "Language");
string translationsURL = ModManager.apiURL + "/translation/get/" + this.code;
string translationsURL = ModManager.apiURL + "/trans/" + this.code;
string tr = "";
try
{
Expand All @@ -42,9 +42,10 @@ public void load()
tr = client.DownloadString(translationsURL);
}
}
catch
catch (Exception e)
{
Utils.logE("Load connection FAIL", "Language");
Utils.logEx(e, "Language");
MessageBox.Show("Mod Manager's server is unreacheable.\n" +
"\n" +
"There are many possible reasons for this :\n" +
Expand Down
Loading

0 comments on commit 601095c

Please sign in to comment.