private void FormMain_Load(object sender, EventArgs e) { try { Icon = new Icon(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Thalassic.ico")); } catch { Log.Debug("Failed to load icon"); } _ = MessageBox.Show(new Form { TopMost = true }, "Thalassic will check for updates and then launch, this might take a moment."); Cursor = Cursors.WaitCursor; // Only check mirrors for new versions at app startup _rtw2VersionRegistry.Update(_modRegistry.Mirrors); rtw2Installation = new Rtw2Installation(_rtw2VersionRegistry.CurrentRtw2Version, Path.Combine(Program.Rtw2ExecutableDirectory, "Clean")); _modRegistry.Update(true); RefreshRtw2InstallData(); UpdateListViews(); Cursor = Cursors.Default; }
private void FormMain_Load(object sender, EventArgs e) { try { Icon = new Icon(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aurora.ico")); } catch { Log.Debug("Failed to load icon"); } _ = MessageBox.Show(new Form { TopMost = true }, "AuroraLoader will check for updates and then launch, this might take a moment."); Cursor = Cursors.WaitCursor; CheckEnableMods.Enabled = true; ComboSelectExecutableMod.Enabled = false; ListDatabaseMods.Enabled = false; CheckEnablePoweruserMods.Enabled = false; ButtonMultiplayer.Enabled = false; // Only check mirrors for new versions at app startup _auroraVersionRegistry.Update(_modRegistry.Mirrors); auroraInstallation = new AuroraInstallation(_auroraVersionRegistry.CurrentAuroraVersion, Path.Combine(Program.AuroraLoaderExecutableDirectory, "Clean")); _modRegistry.Update(_auroraVersionRegistry.CurrentAuroraVersion, true); RefreshAuroraInstallData(); UpdateListViews(); Cursor = Cursors.Default; }
/// <summary> /// Call this to update the list of mods in the Manage tab /// Note that this implies a mod registry update /// </summary> public void UpdateManageModsListView() { _modRegistry.Update(); ListManageMods.BeginUpdate(); ListManageMods.Clear(); ListManageMods.AllowColumnReorder = true; ListManageMods.FullRowSelect = true; ListManageMods.Dock = DockStyle.Top; ListManageMods.View = View.Details; ListManageMods.Columns.Add("Name"); ListManageMods.Columns.Add("Type"); ListManageMods.Columns.Add("Aurora Version"); ListManageMods.Columns.Add("Installed"); ListManageMods.Columns.Add("Latest"); foreach (var mod in _modRegistry.Mods) { if (mod.Name != "AuroraLoader") { var li = new ListViewItem(new string[] { mod.Name, mod.Type.ToString(), mod.Installation?.TargetAuroraVersion.ToString() == "1" ? "Any" : mod.Installation?.TargetAuroraVersion.ToString(), mod.Installation?.Version.ToString(), mod.Listing?.LatestVersion.ToString() ?? "Not found" }); ListManageMods.Items.Add(li); } } ListManageMods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); ListManageMods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); ButtonInstallOrUpdate.Enabled = false; ListManageMods.EndUpdate(); ListManageMods.Focus(); if (ListManageMods.Items.Count > 0) { ListManageMods.Items[0].Selected = true; } else { ButtonConfigureMod.Enabled = false; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Log.Clear(); Log.Debug("Start logging"); if (!File.Exists(Path.Combine(AuroraLoaderExecutableDirectory, "aurora.exe"))) { Log.Debug("Aurora not installed"); var dialog = MessageBox.Show("Aurora not installed. Download and install? This might take a while.", "Install Aurora", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { InstallAurora(); } else { Application.Exit(); return; } } // TODO would love to set up dependency injection var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile(path: "appsettings.json", optional: true, reloadOnChange: true) .Build(); var mirrorRegistry = new MirrorRegistry(configuration); var auroraVersionRegistry = new AuroraVersionRegistry(configuration, mirrorRegistry); var localRegistry = new LocalModRegistry(configuration); var remoteRegistry = new RemoteModRegistry(configuration, mirrorRegistry); var modRegistry = new ModRegistry(configuration, localRegistry, remoteRegistry); modRegistry.Update(); Application.Run(new FormMain(configuration, auroraVersionRegistry, modRegistry)); }
private void FormModDownload_Load(object sender, EventArgs e) { _rtw2VersionRegistry.Update(_modRegistry.Mirrors); _modRegistry.Update(true); UpdateManageModsListView(); }