private void buttonAseModelFix_Click(object sender, RoutedEventArgs e) { var fileDialog = new OpenFileDialog(); fileDialog.Filter = "ASE-models (*.ase)|*.ase"; if (fileDialog.ShowDialog() != true) { return; } var fileName = fileDialog.FileName; var fileType = Path.GetExtension(fileName).ToLower(); if (fileType != ".ase") { var dialogResult = MessageBox.Show( $"Filetype is \"{fileType}\" instead of \".ase\", proceed anyway?", "Incorrect filetype", MessageBoxButton.YesNo, MessageBoxImage.Question); if (dialogResult != MessageBoxResult.Yes) { return; } } var model = new AseModel(fileName); var reply = model.FixBitmaps(); Log(reply); }
public void ReplaceBitmapTest2() { var model = new AseModel(); var line = " *BITMAP \"textures/medieval_soc/woodplank_2\""; var result = model.ReplaceBitmap("", line); var expected = line; Assert.AreEqual(expected, result); }
public void GetMaterialTest() { var model = new AseModel(); var line = " *MATERIAL_NAME \"textures/medieval_soc/woodplank_2\""; var result = model.GetMaterial(line); var expected = "textures/medieval_soc/woodplank_2"; Assert.AreEqual(expected, result); }
public void ReplaceBitmapTest() { var model = new AseModel(); var material = "textures/medieval_soc/woodplank_2"; var line = " *BITMAP \"..\\textures\\medieval_soc\\woodplank_2.tga\""; var result = model.ReplaceBitmap(material, line); var expected = $" *BITMAP \"{material}\""; Assert.AreEqual(expected, result); }