Don't load each mod data when auto-starting and other fixes
This commit is contained in:
parent
c11758a427
commit
0a36e1a0c6
4 changed files with 20 additions and 13 deletions
|
@ -50,10 +50,11 @@ You may also want to verify the game's files by clicking on the Validate game bu
|
||||||
|
|
||||||
private async void Form1_Load(object sender, EventArgs e)
|
private async void Form1_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
await LoadEverything();
|
if (mods.Values.All(mod => mod.LatestVersion == null)) //Not (fully) loaded yet
|
||||||
|
await LoadEverything(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task LoadEverything()
|
public async Task LoadEverything(bool evenMods)
|
||||||
{
|
{
|
||||||
if (Settings.Default.NeedsUpdate)
|
if (Settings.Default.NeedsUpdate)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +80,7 @@ You may also want to verify the game's files by clicking on the Validate game bu
|
||||||
if (MessageBox.Show("Do you want GCMM to change the game's launch settings so it can ensure the game is patched?\n\n" +
|
if (MessageBox.Show("Do you want GCMM to change the game's launch settings so it can ensure the game is patched?\n\n" +
|
||||||
"If you say yes, GCMM will do a quick check before the game is launched and patches if necessary. " +
|
"If you say yes, GCMM will do a quick check before the game is launched and patches if necessary. " +
|
||||||
"This way you (hopefully) won't see crashes after a Gamecraft update.\n\n" +
|
"This way you (hopefully) won't see crashes after a Gamecraft update.\n\n" +
|
||||||
"Note that this also means that if you (re)move GCMM without disabling this in the settings then you won't be able to launch Gamecraft.",
|
"Note that this also means that if you (re)move GCMM without disabling this in the settings then you won't be able to launch Gamecraft until you change the launch options in Steam.",
|
||||||
"GCMM auto-patching", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
"GCMM auto-patching", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||||
DetectConfigLocationAndAutoStart(steamPath, ref user);
|
DetectConfigLocationAndAutoStart(steamPath, ref user);
|
||||||
else
|
else
|
||||||
|
@ -103,7 +104,7 @@ You may also want to verify the game's files by clicking on the Validate game bu
|
||||||
DeleteEmptyPluginsDir(out bool pexists, out bool dexists);
|
DeleteEmptyPluginsDir(out bool pexists, out bool dexists);
|
||||||
if (!pexists && dexists)
|
if (!pexists && dexists)
|
||||||
unpatched.Checked = true; //It will call the event but that won't do anything
|
unpatched.Checked = true; //It will call the event but that won't do anything
|
||||||
await RefreshEverything();
|
await RefreshEverything(evenMods);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void playbtn_Click(object sender, EventArgs e)
|
private async void playbtn_Click(object sender, EventArgs e)
|
||||||
|
@ -272,14 +273,15 @@ You may also want to verify the game's files by clicking on the Validate game bu
|
||||||
|
|
||||||
private async void refreshbtn_Click(object sender, EventArgs e)
|
private async void refreshbtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
await RefreshEverything();
|
await RefreshEverything(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshEverything()
|
private async Task RefreshEverything(bool evenMods)
|
||||||
{
|
{
|
||||||
CheckIfPatched(); //Set from placeholder
|
CheckIfPatched(); //Set from placeholder
|
||||||
lastGameUpdateTime = await GetLastGameUpdateTime();
|
lastGameUpdateTime = await GetLastGameUpdateTime();
|
||||||
var mods = GetInstalledMods();
|
var mods = GetInstalledMods();
|
||||||
|
if (evenMods)
|
||||||
await GetAvailableMods();
|
await GetAvailableMods();
|
||||||
CheckUninstalledMods(mods);
|
CheckUninstalledMods(mods);
|
||||||
CheckIfPatched(); //Check after getting the available mods to show GCIPA updates
|
CheckIfPatched(); //Check after getting the available mods to show GCIPA updates
|
||||||
|
@ -289,7 +291,11 @@ You may also want to verify the game's files by clicking on the Validate game bu
|
||||||
{
|
{
|
||||||
if (CheckNoExe())
|
if (CheckNoExe())
|
||||||
return;
|
return;
|
||||||
if (MessageBox.Show("Validating the game's files is useful if the game doesn't start even without mods. Make sure to click Refresh once Steam finished verifying the game. The Steam window that shows the progress might open in the background. Note that you will need to patch the game again using the Play button in order to use mods.\n\nContinue?", "Verify game files", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
|
if (MessageBox.Show("Validating the game's files is useful if the game doesn't start even without mods." +
|
||||||
|
" Make sure to click Refresh once Steam finished verifying the game." +
|
||||||
|
" The Steam window that shows the progress might open in the background." +
|
||||||
|
" Note that if auto-patching isn't enabled then you will need to patch the game again using the Play button in order to use mods." +
|
||||||
|
"\n\nContinue?", "Verify game files", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
|
||||||
return;
|
return;
|
||||||
string exe = GetExe();
|
string exe = GetExe();
|
||||||
File.Delete(GamePath($@"\{exe.Replace(".exe", "")}_Data\Managed\IllusionInjector.dll")); //Used to check if game is patched
|
File.Delete(GamePath($@"\{exe.Replace(".exe", "")}_Data\Managed\IllusionInjector.dll")); //Used to check if game is patched
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace GCMM
|
||||||
{
|
{
|
||||||
string path = (string)key?.GetValue("SteamClientDll");
|
string path = (string)key?.GetValue("SteamClientDll");
|
||||||
path = path != null ? Directory.GetParent(path).FullName : null;
|
path = path != null ? Directory.GetParent(path).FullName : null;
|
||||||
return (path, (int)(key.GetValue("ActiveUser") ?? 0));
|
return (path, (int)(key?.GetValue("ActiveUser") ?? 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ namespace GCMM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
path += user;
|
path += "\\" + user;
|
||||||
path += @"\config\localconfig.vdf";
|
path += @"\config\localconfig.vdf";
|
||||||
if (path != null && user != 0 && File.Exists(path))
|
if (path != null && user != 0 && File.Exists(path))
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace GCMM
|
||||||
private static async void DealWithCommandLineAsync(string[] args)
|
private static async void DealWithCommandLineAsync(string[] args)
|
||||||
{
|
{
|
||||||
var form = new MainForm();
|
var form = new MainForm();
|
||||||
await form.LoadEverything();
|
await form.LoadEverything(false);
|
||||||
bool? shouldStay = null;
|
bool? shouldStay = null;
|
||||||
if (args[0] == "-start" && args.Length > 1)
|
if (args[0] == "-start" && args.Length > 1)
|
||||||
shouldStay = await form.PatchStartGame(args[1]);
|
shouldStay = await form.PatchStartGame(args[1]);
|
||||||
|
@ -45,7 +45,7 @@ namespace GCMM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Application.Exit();
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"GCMM": {
|
"GCMM": {
|
||||||
"commandName": "Project"
|
"commandName": "Project",
|
||||||
|
"commandLineArgs": "-start steam:\"\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue