private void InventoryIcon_Click(object sender, RoutedEventArgs e) { try { DrawablesGenerator generator = new DrawablesGenerator(imagePath); generator = DrawableUtilities.SetUpGenerator(generator, "0", "0", tbxIgnoreColor.Text); DrawablesOutput output = generator.Generate(); (new OutputWindow("Inventory Icon:", DrawableUtilities.GenerateInventoryIcon(output))).Show(); } catch (FormatException) { MessageBox.Show("Invalid format. Did you provide a correct ignore color code? (hexadecimal RRGGBB or RRGGBBAA)"); } catch (ArgumentNullException) { MessageBox.Show("Argument may not be null. Did you select a valid image?"); } catch (DrawableException exc) { MessageBox.Show(exc.Message); return; } }
private void Command_Click(object sender, RoutedEventArgs e) { try { DrawablesGenerator generator = new DrawablesGenerator(imagePath); generator = DrawableUtilities.SetUpGenerator(generator, tbxHandX.Text, tbxHandY.Text, tbxIgnoreColor.Text); generator.ReplaceWhite = true; DrawablesOutput output = generator.Generate(); Exporter exporter = GetExporter(output); (new OutputWindow("Item Command:", exporter.GetCommand(chkAddWeaponGroup.IsChecked.HasValue && chkAddWeaponGroup.IsChecked.Value ? "weapon" : null, chkAddInventoryIcon.IsChecked.Value), false)).Show(); } catch (JsonReaderException exc) { MessageBox.Show("The template does not appear to be valid JSON.\n\nException:\n" + exc.Message); } catch (ArgumentNullException) { MessageBox.Show("Argument may not be null. Did you select a valid image?"); } catch (ArgumentException exc) { MessageBox.Show("Illegal argument:\n" + exc.Message); } catch (FormatException) { MessageBox.Show("Could not convert hand offsets to numbers."); } catch (Exception exc) { MessageBox.Show("Uncaught exception:\n" + exc.Message); } }
private void SingleTextureDirectives_Click(object sender, RoutedEventArgs e) { try { DrawablesGenerator generator = new DrawablesGenerator(imagePath); bool fade = chkFade.IsChecked.Value; generator = DrawableUtilities.SetUpGenerator(generator, tbxHandX.Text, tbxHandY.Text, tbxIgnoreColor.Text); generator.ReplaceBlank = !fade; generator.ReplaceWhite = true; DrawablesOutput output = generator.Generate(); int j = 64; int.TryParse(tbxSourceImageSize.Text, out j); (new OutputWindow("Single Texture Directives:", DrawableUtilities.GenerateSingleTextureDirectives(output, j, fade), false)).Show(); } catch (FormatException) { MessageBox.Show("Invalid format. Did you provide a correct ignore color code? (hexadecimal RRGGBB or RRGGBBAA)"); } catch (ArgumentNullException) { MessageBox.Show("Argument may not be null. Did you select a valid image?"); } catch (DrawableException exc) { MessageBox.Show(exc.Message); return; } }