Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
WoW Creator - Form1.vb

Form1.vb

Caricato da: Totem
Scarica il programma completo

  1. Public Class Form1
  2.  
  3.     Class Tooltip
  4.         Private _Area As Rectangle
  5.  
  6.         Public Property Area() As Rectangle
  7.             Get
  8.                 Return _Area
  9.             End Get
  10.             Set(ByVal value As Rectangle)
  11.                 _Area = value
  12.             End Set
  13.         End Property
  14.  
  15.         Public Sub Draw(ByVal G As Graphics)
  16.             Dim WAdjust, HAdjust As Byte
  17.  
  18.             WAdjust = IIf(Me.Area.Width Mod 2 = 0, 0, 1)
  19.             HAdjust = IIf(Me.Area.Height Mod 2 = 0, 1, 0)
  20.             Me.Area = New Rectangle(Me.Area.X, Me.Area.Y, Me.Area.Width + WAdjust, Me.Area.Height + HAdjust)
  21.  
  22.             'Sfondo
  23.             G.FillRectangle(New SolidBrush(Color.FromArgb(200, 22, 32, 59)), _
  24.                 New Rectangle(Area.X + 4, Area.Y + 5, Area.Width - 6, Area.Height - 10))
  25.             'Angoli superiori
  26.             G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1, Me.Area.Y, New Rectangle(64, 0, 12, 16), GraphicsUnit.Pixel)
  27.             G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1 + Me.Area.Width - 12, Me.Area.Y, New Rectangle(84, 0, 12, 16), GraphicsUnit.Pixel)
  28.             'Lato superiore
  29.             For X As Int16 = Me.Area.X + 15 To Me.Area.X - 1 + Me.Area.Width - 13 Step 2
  30.                 G.DrawImage(My.Resources.Tooltip, X, Me.Area.Y, New Rectangle(83, 0, 1, 16), GraphicsUnit.Pixel)
  31.             Next
  32.  
  33.             'Angoli inferiori
  34.             G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1, Me.Area.Y + Me.Area.Height - 20, New Rectangle(96, 0, 12, 16), GraphicsUnit.Pixel)
  35.             G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1 + Me.Area.Width - 12, Me.Area.Y + Me.Area.Height - 20, New Rectangle(116, 0, 12, 16), GraphicsUnit.Pixel)
  36.             'Lato inferiore
  37.             For X As Int16 = Me.Area.X + 15 To Me.Area.X - 1 + Me.Area.Width - 13 Step 2
  38.                 G.DrawImage(My.Resources.Tooltip, X, Me.Area.Y + Me.Area.Height - 20, New Rectangle(115, 0, 1, 16), GraphicsUnit.Pixel)
  39.             Next
  40.  
  41.             'Lato destro
  42.             For Y As Int16 = Me.Area.Y + 21 To Me.Area.Y + Me.Area.Height - 21 Step 2
  43.                 G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1, Y, New Rectangle(64, 14, 7, 1), GraphicsUnit.Pixel)
  44.             Next
  45.  
  46.             'Lasto sinistro
  47.             For Y As Int16 = Me.Area.Y + 21 To Me.Area.Y + Me.Area.Height - 21 Step 2
  48.                 G.DrawImage(My.Resources.Tooltip, Me.Area.X - 1 + Me.Area.Width - 5, Y, New RectangleF(57.2, 2, 7, 1), GraphicsUnit.Pixel)
  49.             Next
  50.         End Sub
  51.  
  52.         Sub New(ByVal X As Int32, ByVal Y As Int32, ByVal Width As Int32, ByVal Height As Int32)
  53.             Me.Area = New Rectangle(X, Y, Width, Height)
  54.         End Sub
  55.  
  56.         Sub New()
  57.  
  58.         End Sub
  59.     End Class
  60.  
  61.     Private QualityColors() As Color = _
  62.         {Color.FromArgb(255, 192, 192, 192), _
  63.         Color.FromArgb(255, 255, 255, 255), _
  64.         Color.FromArgb(255, 34, 239, 30), _
  65.         Color.FromArgb(255, 0, 112, 221), _
  66.         Color.FromArgb(255, 153, 50, 225), _
  67.         Color.FromArgb(255, 253, 124, 0), _
  68.         Color.FromArgb(255, 229, 204, 128)}
  69.     Private ItemNameFont As New Font("Friz Quadrata TT", 12, FontStyle.Regular)
  70.     Private ItemInfoFont As New Font("Friz Quadrata TT", 9, FontStyle.Regular)
  71.     Private TooltipIcon As Image
  72.  
  73.     Private Sub AddTooltipLine(ByVal G As Graphics, ByVal Line As String, ByVal Font As Font, ByVal Color As Color, ByVal Position As Point, ByRef MaxWidth As Int32, ByRef Y As Int32)
  74.         Dim Size As SizeF = G.MeasureString(Line, Font, 220)
  75.         If Size.Width > MaxWidth Then
  76.             MaxWidth = Size.Width
  77.         End If
  78.  
  79.         If MaxWidth < 190 Then
  80.             G.DrawString(Line, Font, New SolidBrush(Color), Position.X, Position.Y)
  81.             Y += 16
  82.         Else
  83.             Size = G.MeasureString(Line, Font, New SizeF(220, 400))
  84.             G.DrawString(Line, Font, New SolidBrush(Color), New RectangleF(Position.X, Position.Y, 220, 400))
  85.             If Size.Width > MaxWidth Then
  86.                 MaxWidth = Size.Width - 5
  87.             End If
  88.             Y += Size.Height
  89.             End If
  90.     End Sub
  91.  
  92.     Private Sub DrawEverything(ByVal G As Graphics, ByVal BackgroundImage As Image, ByVal BGSize As Size)
  93.         Static T As New Tooltip(30, 60, 204, 60)
  94.         Static MinY As Int16 = 68
  95.         Static MinX As Int16 = 37
  96.         Dim Y As Int16 = 86
  97.         Dim MaxWidth As Int16 = 60
  98.  
  99.         If chbTooltipManual.Checked Then
  100.             T.Area = New Rectangle(30, 60, nudWidth.Value, nudHeight.Value)
  101.         End If
  102.  
  103.         G.Clear(Color.White)
  104.         If BackgroundImage IsNot Nothing Then
  105.             G.DrawImage(BackgroundImage, 0, 0, BGSize.Width, BGSize.Height)
  106.         End If
  107.         T.Draw(G)
  108.  
  109.         G.TextContrast = 3
  110.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
  111.  
  112.         If TooltipIcon IsNot Nothing Then
  113.             G.DrawImage(TooltipIcon, 30, 17, 40, 40)
  114.         End If
  115.  
  116.         'ITEM ------------------------------------------------------------------------
  117.         If tabMain.SelectedIndex = 0 Then
  118.             Dim Size As SizeF = G.MeasureString(txtItemName.Text, ItemNameFont, 220)
  119.             G.DrawString(txtItemName.Text, ItemNameFont, New SolidBrush(QualityColors(cmbQuality.SelectedIndex)), MinX, MinY)
  120.             If Size.Width > MaxWidth Then
  121.                 MaxWidth = Size.Width
  122.             End If
  123.  
  124.             G.TextContrast = 2
  125.  
  126.             If cmbBind.SelectedIndex > 0 Then
  127.                 AddTooltipLine(G, cmbBind.SelectedItem, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  128.             End If
  129.  
  130.             If chbUnique.Checked Then
  131.                 AddTooltipLine(G, "Unique", ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  132.             End If
  133.  
  134.             Dim ArmorSkillY As Int16 = 0
  135.             If tabItemType.SelectedIndex = 0 Then
  136.                 ArmorSkillY = Y
  137.                 AddTooltipLine(G, cmbArmorSlot.SelectedItem, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  138.                 If nudArmor.Value > 0 Then
  139.                     AddTooltipLine(G, nudArmor.Value & " Armor", ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  140.                 End If
  141.             End If
  142.  
  143.             Dim WeaponSkillY, WeaponSpeedY As Int16
  144.             If tabItemType.SelectedIndex = 1 Then
  145.                 WeaponSkillY = Y
  146.                 AddTooltipLine(G, cmbWeaponSlot.SelectedItem, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  147.                 WeaponSpeedY = Y
  148.                 AddTooltipLine(G, String.Format("{0} - {1} Damage", nudMinDamage.Value, nudMaxDamage.Value), ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  149.                 AddTooltipLine(G, String.Format("({0:N1} damage per second)", ((nudMinDamage.Value + nudMaxDamage.Value) / 2) / nudSpeed.Value).Replace(",", "."), ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  150.             End If
  151.  
  152.             For Each Row As DataGridViewRow In dgvStats.Rows
  153.                 Try
  154.                     Dim StatValue As Int32 = Row.Cells(0).Value
  155.                     Dim StatType As String = Row.Cells(1).Value
  156.  
  157.                     If StatValue <> 0 And (Not String.IsNullOrEmpty(StatType)) Then
  158.                         AddTooltipLine(G, IIf(StatValue > 0, "+", "") & StatValue & " " & StatType, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  159.                     End If
  160.                 Catch ex As Exception
  161.  
  162.                 End Try
  163.             Next
  164.  
  165.             If tabItemType.SelectedIndex <= 1 Then
  166.                 If nudDurability.Value > 0 Then
  167.                     AddTooltipLine(G, String.Format("Durability {0}/{0}", nudDurability.Value), ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  168.                 End If
  169.                 If Not String.IsNullOrEmpty(txtRequires.Text) Then
  170.                     AddTooltipLine(G, "Requires " & txtRequires.Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  171.                 End If
  172.                 If lstClasses.CheckedItems.Count > 0 Then
  173.                     Dim Text As String = "Classes: "
  174.                     For I As Int16 = 0 To lstClasses.CheckedItems.Count - 1
  175.                         Text &= lstClasses.Items(lstClasses.CheckedIndices(I))
  176.                         If I < lstClasses.CheckedIndices.Count - 1 Then
  177.                             Text &= ", "
  178.                         End If
  179.                     Next
  180.                     AddTooltipLine(G, Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  181.                 End If
  182.             End If
  183.  
  184.             For Each Row As DataGridViewRow In dgvEffects.Rows
  185.                 Try
  186.                     Dim EffectType As String = Row.Cells(0).Value
  187.                     Dim Effect As String = Row.Cells(1).Value
  188.                     Dim Text As String = EffectType & " " & Effect
  189.  
  190.                     If (Not String.IsNullOrEmpty(EffectType)) And (Not String.IsNullOrEmpty(Effect)) Then
  191.                         AddTooltipLine(G, Text, ItemInfoFont, QualityColors(2), New Point(MinX, Y), MaxWidth, Y)
  192.                     End If
  193.                 Catch ex As Exception
  194.  
  195.                 End Try
  196.             Next
  197.  
  198.             If tabItemType.SelectedIndex = 2 Then
  199.                 If nudCharges.Value > 0 Then
  200.                     AddTooltipLine(G, nudCharges.Value & " Charges", ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  201.                 End If
  202.             End If
  203.  
  204.             If Not String.IsNullOrEmpty(txtYellowText.Text) Then
  205.                 AddTooltipLine(G, """" & txtYellowText.Text & """", ItemInfoFont, Color.FromArgb(255, 238, 196, 1), New Point(MinX, Y), MaxWidth, Y)
  206.             End If
  207.  
  208.             If chbTooltipManual.Checked = False Then
  209.                 If (Y > T.Area.Y + T.Area.Height - 6) Or (T.Area.Y + T.Area.Height - Y > 10) Or _
  210.                    (T.Area.Width - 19 < MaxWidth - 1 Or T.Area.Width - 19 > MaxWidth + 1) Then
  211.                     T.Area = New Rectangle(T.Area.X, T.Area.Y, MaxWidth + 19, Y - 60 + 6)
  212.                     DrawEverything(G, BackgroundImage, BGSize)
  213.                 End If
  214.             End If
  215.  
  216.             If tabItemType.SelectedIndex = 0 Then
  217.                 If cmbArmorSkill.SelectedIndex > 0 Then
  218.                     Dim ArmorSkillSize As SizeF = G.MeasureString(cmbArmorSkill.SelectedItem, ItemInfoFont)
  219.                     AddTooltipLine(G, cmbArmorSkill.SelectedItem, ItemInfoFont, Color.White, New Point(MinX + MaxWidth - ArmorSkillSize.Width - 3, ArmorSkillY), 0, 0)
  220.                 End If
  221.             End If
  222.  
  223.             If tabItemType.SelectedIndex = 1 Then
  224.                 If cmbWeaponSkill.SelectedIndex > 0 Then
  225.                     Dim WeaponSkillSize As SizeF = G.MeasureString(cmbWeaponSkill.SelectedItem, ItemInfoFont)
  226.                     AddTooltipLine(G, cmbWeaponSkill.SelectedItem, ItemInfoFont, Color.White, New Point(MinX + MaxWidth - WeaponSkillSize.Width + 7, WeaponSkillY), 0, 0)
  227.                 End If
  228.                 Dim Text As String = String.Format("Speed {0:N2}", nudSpeed.Value).Replace(",", ".")
  229.                 Dim WeaponSpeedSize As SizeF = G.MeasureString(Text, ItemInfoFont)
  230.                 AddTooltipLine(G, Text, ItemInfoFont, Color.White, New Point(MinX + MaxWidth - WeaponSpeedSize.Width + 7, WeaponSpeedY), 0, 0)
  231.             End If
  232.         End If
  233.  
  234.  
  235.         'SPELL -------------------------------------------------------------------------------------
  236.         If tabMain.SelectedIndex = 1 Then
  237.             Dim Size As SizeF = G.MeasureString(txtItemName.Text, ItemNameFont, 220)
  238.             Dim RankY As Int16 = MinY
  239.             G.DrawString(txtSpellName.Text, ItemNameFont, New SolidBrush(Color.White), MinX, MinY)
  240.             If Size.Width > MaxWidth Then
  241.                 MaxWidth = Size.Width
  242.             End If
  243.  
  244.             G.TextContrast = 2
  245.  
  246.             Dim RangeY, CooldownY As Int16
  247.             If chbCastable.Checked Then
  248.                 If nudSpellCost.Value > 0 Then
  249.                     RangeY = Y
  250.                     AddTooltipLine(G, nudSpellCost.Value & " " & txtSpellCost.Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  251.                 Else
  252.                     If nudRange.Value > 0 Then
  253.                         AddTooltipLine(G, nudRange.Value & " yd", ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  254.                     End If
  255.                 End If
  256.                 If Not String.IsNullOrEmpty(txtCastTime.Text) Then
  257.                     CooldownY = Y
  258.                     AddTooltipLine(G, txtCastTime.Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  259.                 Else
  260.                     If nudCooldown.Value > 0 Then
  261.                         Dim Unit As String = "sec"
  262.                         Select Case cmbCooldown.SelectedIndex
  263.                             Case 0
  264.                                 Unit = "sec"
  265.                             Case 1
  266.                                 Unit = "min"
  267.                             Case 2
  268.                                 Unit = "hr"
  269.                             Case 3
  270.                                 Unit = "days"
  271.                         End Select
  272.                         AddTooltipLine(G, nudCooldown.Value & " " & Unit & " cooldown", ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  273.                     End If
  274.                 End If
  275.             End If
  276.  
  277.             If Not String.IsNullOrEmpty(txtReagents.Text) Then
  278.                 AddTooltipLine(G, "Reagents: " & txtReagents.Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  279.             End If
  280.             If cmbWeaponReq.SelectedIndex > 0 Then
  281.                 AddTooltipLine(G, "Requires " & cmbWeaponReq.SelectedItem, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  282.             End If
  283.             If cmbStanceReq.SelectedIndex > 0 Then
  284.                 AddTooltipLine(G, "Requires " & cmbStanceReq.SelectedItem, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  285.             End If
  286.             If Not String.IsNullOrEmpty(txtOtherReq.Text) Then
  287.                 AddTooltipLine(G, "Requires " & txtOtherReq.Text, ItemInfoFont, Color.White, New Point(MinX, Y), MaxWidth, Y)
  288.             End If
  289.  
  290.             G.TextContrast = 0
  291.             AddTooltipLine(G, txtDescription.Text, ItemInfoFont, Color.FromArgb(255, 238, 196, 1), New Point(MinX, Y), MaxWidth, Y)
  292.             G.TextContrast = 2
  293.  
  294.             If chbTooltipManual.Checked = False Then
  295.                 If (Y > T.Area.Y + T.Area.Height - 6) Or (T.Area.Y + T.Area.Height - Y > 10) Or _
  296.                    (T.Area.Width - 19 < MaxWidth - 1 Or T.Area.Width - 19 > MaxWidth + 1) Then
  297.                     T.Area = New Rectangle(T.Area.X, T.Area.Y, MaxWidth + 19, Y - 60 + 6)
  298.                     DrawEverything(G, BackgroundImage, BGSize)
  299.                 End If
  300.             End If
  301.  
  302.             If rtbRank.Checked Then
  303.                 Dim Text As String = "Rank " & nudRank.Value
  304.                 Dim RankSize As SizeF = G.MeasureString(Text, ItemNameFont)
  305.                 AddTooltipLine(G, Text, ItemNameFont, QualityColors(0), New Point(MinX + MaxWidth - RankSize.Width + 7, RankY), 0, 0)
  306.             ElseIf rtbRacial.Checked Then
  307.                 Dim RacialSize As SizeF = G.MeasureString("Racial", ItemNameFont)
  308.                 AddTooltipLine(G, "Racial", ItemNameFont, QualityColors(0), New Point(MinX + MaxWidth - RacialSize.Width + 7, RankY), 0, 0)
  309.             End If
  310.  
  311.             If nudRange.Value > 0 And RangeY > 0 Then
  312.                 Dim Text As String = nudRange.Value & " yd"
  313.                 Dim RangeSize As SizeF = G.MeasureString(Text, ItemInfoFont)
  314.                 AddTooltipLine(G, Text, ItemInfoFont, Color.White, New Point(MinX + MaxWidth - RangeSize.Width + 3, RangeY), 0, 0)
  315.             End If
  316.  
  317.             If nudCooldown.Value > 0 And CooldownY > 0 Then
  318.                 Dim Unit As String = "sec"
  319.                 Select Case cmbCooldown.SelectedIndex
  320.                     Case 0
  321.                         Unit = "sec"
  322.                     Case 1
  323.                         Unit = "min"
  324.                     Case 2
  325.                         Unit = "hr"
  326.                     Case 3
  327.                         Unit = "days"
  328.                 End Select
  329.                 Dim Text As String = nudCooldown.Value & " " & Unit & " cooldown"
  330.                 Dim CooldownSize As SizeF = G.MeasureString(Text, ItemInfoFont)
  331.                 AddTooltipLine(G, Text, ItemInfoFont, Color.White, New Point(MinX + MaxWidth - CooldownSize.Width + 3, CooldownY), 0, 0)
  332.             End If
  333.         End If
  334.     End Sub
  335.  
  336.     Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtItemName.TextChanged, txtRequires.TextChanged, nudSpeed.ValueChanged, nudMaxDamage.ValueChanged, nudDurability.ValueChanged, nudArmor.ValueChanged, cmbWeaponSlot.SelectedIndexChanged, cmbWeaponSkill.SelectedIndexChanged, cmbQuality.SelectedIndexChanged, cmbBind.SelectedIndexChanged, cmbArmorSlot.SelectedIndexChanged, cmbArmorSkill.SelectedIndexChanged, chbUnique.CheckedChanged, txtYellowText.TextChanged, nudWidth.ValueChanged, nudHeight.ValueChanged, nudCharges.ValueChanged, txtSpellName.TextChanged, txtSpellCost.TextChanged, txtReagents.TextChanged, txtOtherReq.TextChanged, txtDescription.TextChanged, txtCastTime.TextChanged, rtbRacial.CheckedChanged, nudSpellCost.ValueChanged, nudRank.ValueChanged, nudRange.ValueChanged, nudCooldown.ValueChanged, cmbWeaponReq.SelectedIndexChanged, cmbStanceReq.SelectedIndexChanged, cmbCooldown.SelectedIndexChanged, chbCastable.TextChanged
  337.         imgPreview.Refresh()
  338.     End Sub
  339.  
  340.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  341.         txtItemName.Text = "Item Name"
  342.         cmbQuality.SelectedIndex = 1
  343.         cmbBind.SelectedIndex = 0
  344.         cmbArmorSlot.SelectedIndex = 0
  345.         cmbArmorSkill.SelectedIndex = 0
  346.         cmbWeaponSlot.SelectedIndex = 0
  347.         cmbWeaponSkill.SelectedIndex = 0
  348.     End Sub
  349.  
  350.     Private Sub dgvStats_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
  351.         If e.ColumnIndex = 1 Then
  352.             Dim Cell As DataGridViewCell = dgvStats.Rows(e.RowIndex).Cells(e.ColumnIndex)
  353.             If Cell.Value = "Custom..." Then
  354.                 Dim NewStat As String = InputBox("Insert the new custom stat's name:")
  355.  
  356.                 If Not String.IsNullOrEmpty(NewStat) Then
  357.                     DirectCast(dgvStats.Columns(1), DataGridViewComboBoxColumn).Items.Add(NewStat)
  358.                 End If
  359.             End If
  360.         End If
  361.         imgPreview.Refresh()
  362.     End Sub
  363.  
  364.     Private Sub imgPreview_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles imgPreview.Paint
  365.         DrawEverything(e.Graphics, imgPreview.Image, imgPreview.Size)
  366.     End Sub
  367.  
  368.     Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
  369.         AddHandler dgvStats.CellValueChanged, AddressOf dgvStats_CellValueChanged
  370.     End Sub
  371.  
  372.     Private Sub tabItemType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tabItemType.SelectedIndexChanged
  373.         grpEquippable.Enabled = (tabItemType.SelectedIndex <= 1)
  374.         imgPreview.Refresh()
  375.     End Sub
  376.  
  377.     Private Sub nudMinDamage_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudMinDamage.ValueChanged
  378.         nudMaxDamage.Minimum = nudMinDamage.Value + 1
  379.     End Sub
  380.  
  381.     Private Sub btnBrowseIcon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseIcon.Click
  382.         Dim Open As New OpenFileDialog
  383.         Open.Filter = "Immagini|*.jpg;*.bmp;*.png;*.gif;*.tga;*.wmf"
  384.         If Open.ShowDialog = Windows.Forms.DialogResult.OK Then
  385.             TooltipIcon = Image.FromFile(Open.FileName)
  386.         End If
  387.     End Sub
  388.  
  389.     Private Sub cmbBackground_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbBackground.SelectedIndexChanged
  390.         imgPreview.Image = My.Resources.ResourceManager.GetObject(cmbBackground.SelectedItem)
  391.     End Sub
  392.  
  393.     Private Sub btnSaveImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveImage.Click
  394.         Dim Save As New SaveFileDialog
  395.         Save.Filter = "PNG|*.png|JPEG|*.jpg|Bitamp|*.bmp|GIF|*.gif"
  396.         If Save.ShowDialog = Windows.Forms.DialogResult.OK Then
  397.             Dim Buffer As New Bitmap(imgPreview.Image, imgPreview.Width, imgPreview.Height)
  398.             Dim BufferGraphics As Graphics = Graphics.FromImage(Buffer)
  399.             DrawEverything(BufferGraphics, IIf(chbIncludeBg.Checked, imgPreview.Image, Nothing), imgPreview.Size)
  400.             Buffer.Save(Save.FileName)
  401.             BufferGraphics.Dispose()
  402.         End If
  403.     End Sub
  404.  
  405.     Private Sub chbTooltipManual_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbTooltipManual.CheckedChanged
  406.         grpManualTooltip.Enabled = chbTooltipManual.Checked
  407.         imgPreview.Refresh()
  408.     End Sub
  409.  
  410.     Private Sub lstClasses_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles lstClasses.ItemCheck
  411.         imgPreview.Refresh()
  412.     End Sub
  413.  
  414.     Private Sub dgvEffects_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvEffects.CellValueChanged
  415.         imgPreview.Refresh()
  416.     End Sub
  417.  
  418.     Private Sub rtbRank_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtbRank.CheckedChanged
  419.         nudRank.Enabled = rtbRank.Checked
  420.     End Sub
  421.  
  422.     Private Sub chbCastable_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbCastable.CheckedChanged
  423.         grpCastable.Enabled = chbCastable.Checked
  424.     End Sub
  425. End Class