private void buttonUpdateItemStats_Click(object sender, EventArgs e) { var updatingPlayerItemsScreen = new UpdatingPlayerItemsScreen(_playerItemDao); updatingPlayerItemsScreen.ShowDialog(); _itemViewUpdateTrigger?.Invoke(); }
private void buttonSelect_Click(object sender, EventArgs e) { // find selected checkbox // if selected != Properties.Settings.Default.LocalizationFile var cb = _checkboxes.FirstOrDefault(m => m.Checked); if (cb != null) { var package = cb.Tag.ToString(); if (package != Properties.Settings.Default.LocalizationFile) { Properties.Settings.Default.LocalizationFile = package; Properties.Settings.Default.Save(); if (!string.IsNullOrEmpty(Properties.Settings.Default.LocalizationFile)) { var loader = new LocalizationLoader(); GlobalSettings.Language = loader.LoadLanguage(package, new EnglishLanguage(new Dictionary <string, string>())); // TODO: Grab tags from loader and save to sql _itemTagDao.Save(loader.GetItemTags(), new ProgressTracker()); UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(_playerItemDao); x.ShowDialog(); } // Load the GD one else { // Override timestamp to force an update GlobalSettings.InitializeLanguage(string.Empty, new Dictionary <string, string>()); // TODO: Not ideal, will need a restart foreach (var location in _paths) { if (!string.IsNullOrEmpty(location) && Directory.Exists(location)) { _parsingService.Update(location, string.Empty); _parsingService.Execute(); break; } else { Logger.Warn("Could not find the Grim Dawn install location"); } } // Update item stats as well UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(_playerItemDao); x.ShowDialog(); } } } this.Close(); }
private void buttonUpdateItemStats_Click(object sender, EventArgs e) { UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(_playerItemDao); x.ShowDialog(); if (_itemViewUpdateTrigger != null) { _itemViewUpdateTrigger(); } }
private void buttonSelect_Click(object sender, EventArgs e) { // find selected checkbox // if selected != Properties.Settings.Default.LocalizationFile var cb = Checkboxes.Where(m => m.Checked).FirstOrDefault(); if (cb != null) { var package = cb.Tag.ToString(); if (package != Properties.Settings.Default.LocalizationFile) { Properties.Settings.Default.LocalizationFile = package; Properties.Settings.Default.Save(); if (!string.IsNullOrEmpty(Properties.Settings.Default.LocalizationFile)) { var loader = new LocalizationLoader(); GlobalSettings.Language = loader.LoadLanguage(package); // TODO: Grab tags from loader and save to sql databaseItemDao.Save(loader.GetItemTags()); UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(playerItemDao); x.ShowDialog(); } // Load the GD one else { // Override timestamp to force an update GlobalSettings.Language = new EnglishLanguage(); string location = GrimDawnDetector.GetGrimLocation(); if (!string.IsNullOrEmpty(location) && Directory.Exists(location)) { ParsingDatabaseScreen parserUi = new ParsingDatabaseScreen(databaseSettingDao, this.parser, location, string.Empty, true, true); parserUi.ShowDialog(); } else { logger.Warn("Could not find the Grim Dawn install location"); } // Update item stats as well UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(playerItemDao); x.ShowDialog(); } } } this.Close(); }
/// <summary> /// Sets the "last database update" timestamp to 0 to force an update /// Queues a database update, followed by an item stat update. /// </summary> public void ForceDatabaseUpdate(string location, string modLocation) { if (!string.IsNullOrEmpty(location) && Directory.Exists(location)) { _parsingService.Update(location, modLocation); _parsingService.Execute(); } else { Logger.Warn("Could not find the Grim Dawn install location"); } // Update item stats as well var updatingPlayerItemsScreen = new UpdatingPlayerItemsScreen(_playerItemDao); updatingPlayerItemsScreen.ShowDialog(); _itemViewUpdateTrigger?.Invoke(); }
/// <summary> /// Sets the "last database update" timestamp to 0 to force an update /// Queues a database update, followed by an item stat update. /// </summary> public void ForceDatabaseUpdate(string location, bool isVanilla) { // Override timestamp to force an update _databaseSettingDao.UpdateDatabaseTimestamp(0); var paths = GrimDawnDetector.GetGrimLocations(); if (!string.IsNullOrEmpty(location) && Directory.Exists(location) && _arzParser.NeedUpdate(location)) { ParsingDatabaseScreen parser = new ParsingDatabaseScreen( _databaseSettingDao, _arzParser, location, Properties.Settings.Default.LocalizationFile, false, !isVanilla); parser.ShowDialog(); //databaseSettingDao.UpdateCurrentDatabase(location); UpdateListview(paths); } else { Logger.Warn("Could not find the Grim Dawn install location"); } // Update item stats as well UpdatingPlayerItemsScreen x = new UpdatingPlayerItemsScreen(_playerItemDao); x.ShowDialog(); if (_itemViewUpdateTrigger != null) { _itemViewUpdateTrigger(); } }