TBMM/GCMM/MainForm.cs

70 lines
2 KiB
C#
Raw Normal View History

2020-06-15 19:11:05 +00:00
using GCMM.Properties;
using Newtonsoft.Json.Linq;
2020-06-15 19:11:05 +00:00
using System;
using System.Collections.Generic;
using System.Diagnostics;
2020-06-15 19:11:05 +00:00
using System.Drawing;
using System.IO;
using System.IO.Compression;
2020-06-15 19:11:05 +00:00
using System.Linq;
using System.Net;
using System.Reflection;
2020-06-15 19:11:05 +00:00
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GCMM
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private Dictionary<string, ModInfo> mods = new Dictionary<string, ModInfo>();
2020-06-15 19:11:05 +00:00
private void Form1_Load(object sender, EventArgs e)
{
modlist.Items.Clear();
UpdateButton(installbtn, false);
modinfobox.Text = "";
if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
{
Settings.Default.GamePath = GetGameFolder();
if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
Settings.Default.GamePath = SelectGameFolder();
else
MessageBox.Show("Found game at " + Settings.Default.GamePath);
Settings.Default.Save();
}
if(string.IsNullOrWhiteSpace(Settings.Default.GamePath))
{
status.Text = "Status: Game not found";
return;
}
CheckIfPatched();
GetInstalledMods();
GetAvailableMods();
2020-06-15 19:11:05 +00:00
}
private void playbtn_Click(object sender, EventArgs e)
{
if (playbtn.ForeColor == Color.Green) return; //Disabled
PatchGame();
2020-06-15 19:11:05 +00:00
}
private void settingsbtn_Click(object sender, EventArgs e)
{
if (settingsbtn.ForeColor == Color.Green) return; //Disabled
2020-06-15 19:11:05 +00:00
var sf = new SettingsForm();
sf.ShowDialog(this);
}
private void modlist_SelectedIndexChanged(object sender, EventArgs e)
{
}
2020-06-15 19:11:05 +00:00
}
}