Techblox Mod Manager / Launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainForm.cs 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using GCMM.Properties;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.IO.Compression;
  9. using System.Linq;
  10. using System.Net;
  11. using System.Reflection;
  12. using System.Text.RegularExpressions;
  13. using System.Threading.Tasks;
  14. using System.Windows.Forms;
  15. namespace GCMM
  16. {
  17. public partial class MainForm : Form
  18. {
  19. public MainForm()
  20. {
  21. InitializeComponent();
  22. }
  23. private Dictionary<string, ModInfo> mods = new Dictionary<string, ModInfo>();
  24. private void Form1_Load(object sender, EventArgs e)
  25. {
  26. modlist.Items.Clear();
  27. UpdateButton(installbtn, false);
  28. modinfobox.Text = "";
  29. if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
  30. {
  31. Settings.Default.GamePath = GetGameFolder();
  32. if (string.IsNullOrWhiteSpace(Settings.Default.GamePath))
  33. Settings.Default.GamePath = SelectGameFolder();
  34. else
  35. MessageBox.Show("Found game at " + Settings.Default.GamePath);
  36. Settings.Default.Save();
  37. }
  38. if(string.IsNullOrWhiteSpace(Settings.Default.GamePath))
  39. {
  40. status.Text = "Status: Game not found";
  41. return;
  42. }
  43. CheckIfPatched();
  44. GetInstalledMods();
  45. GetAvailableMods();
  46. }
  47. private void playbtn_Click(object sender, EventArgs e)
  48. {
  49. if (playbtn.ForeColor == Color.Green) return; //Disabled
  50. PatchGame();
  51. }
  52. private void settingsbtn_Click(object sender, EventArgs e)
  53. {
  54. if (settingsbtn.ForeColor == Color.Green) return; //Disabled
  55. var sf = new SettingsForm();
  56. sf.ShowDialog(this);
  57. }
  58. private void modlist_SelectedIndexChanged(object sender, EventArgs e)
  59. {
  60. }
  61. }
  62. }