/// <summary> /// The event handler for the advanced options button clicked /// </summary> private async void AdvOptionsButton_Click(object sender, RoutedEventArgs e) { var selectedItem = ModelTypeComboBox.SelectedItem as ModComboBox; var mod = selectedItem.SelectedMod; var includedMod = new IncludedMods { Name = $"{Path.GetFileNameWithoutExtension(mod.fullPath)} ({((Category)ModListTreeView.SelectedItem).Name})", FullPath = mod.fullPath }; var itemModel = MakeItemModel(mod); var includedModsList = IncludedModsList.Items.Cast <IncludedMods>().ToList(); var mdl = new Mdl(_gameDirectory, XivDataFiles.GetXivDataFile(mod.datFile)); try { // TODO - Include Submesh ID ? // Do we even have any kind of UI To specify this in the wizard? // Submeshes are only used for Furniture anyways, so it might be a 'will not fix' bool success = await ImportModelView.ImportModel(itemModel, IOUtil.GetRaceFromPath(mod.fullPath), null, this, null, true); if (!success) { return; } } catch (Exception ex) { FlexibleMessageBox.Show(ex.Message, UIMessages.AdvancedImportErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var mdlData = ImportModelView.GetData(); if (includedModsList.Any(item => item.Name.Equals(includedMod.Name))) { if (FlexibleMessageBox.Show( string.Format(UIMessages.ExistingOption, includedMod.Name), UIMessages.OverwriteTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { _selectedModOption.Mods[mod.fullPath].ModDataBytes = mdlData; } } else { IncludedModsList.Items.Add(includedMod); _selectedModOption.Mods.Add(mod.fullPath, new ModData { Name = mod.name, Category = mod.category, FullPath = mod.fullPath, ModDataBytes = mdlData, }); } }
/// <summary> /// The event handler for the advanced options button clicked /// </summary> private async void AdvOptionsButton_Click(object sender, RoutedEventArgs e) { var selectedFile = ModelTypeComboBox.SelectedItem as FileEntry; var itemModel = (IItemModel)SelectedItem; var mdl = new Mdl(_gameDirectory, IOUtil.GetDataFileFromPath(selectedFile.Path)); try { // TODO - Include Submesh ID ? // Do we even have any kind of UI To specify this in the wizard? // Submeshes are only used for Furniture anyways, so it might be a 'will not fix' bool success = await ImportModelView.ImportModel(itemModel, IOUtil.GetRaceFromPath(selectedFile.Path), null, this, null, true); if (!success) { return; } } catch (Exception ex) { FlexibleMessageBox.Show(ex.Message, UIMessages.AdvancedImportErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var mdlData = ImportModelView.GetData(); AddFile(selectedFile, SelectedItem, mdlData); }