Public Class SP
'######################################################## SPECIALIST CARDS ########################################################
'Make SPFun "Public" to use
Private ReadOnly SPFun As New List(Of String)
Private Sub GunaRadioButton_SPFun_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_SPFun.CheckedChanged
If Not GunaRadioButton_SPFun.Checked Then Return
'Read File & Split SPFun
Dim lines As String() = System.IO.File.ReadAllLines("Files\SPs\Fun.txt")
SPFun.Clear()
ComboBox_SPItem.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPItem.Items.Add(parts(0))
SPFun.Add(parts(1))
Next
ComboBox_SPItem.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
End Sub
'Make SPSwordsman "Public" to use
Private ReadOnly SPSwordsman As New List(Of String)
Private Sub GunaRadioButton_SPSwordsman_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_SPSwordsman.CheckedChanged
If Not GunaRadioButton_SPSwordsman.Checked Then Return
'Read File & Split SPSwordsman
Dim lines As String() = System.IO.File.ReadAllLines("Files\SPs\Swordsman.txt")
SPSwordsman.Clear()
ComboBox_SPItem.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPItem.Items.Add(parts(0))
SPSwordsman.Add(parts(1))
Next
ComboBox_SPItem.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
End Sub
'Make SPArcher "Public" to use
Private ReadOnly SPArcher As New List(Of String)
Private Sub GunaRadioButton_SPArcher_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_SPArcher.CheckedChanged
If Not GunaRadioButton_SPArcher.Checked Then Return
'Read File & Split SPArcher
Dim lines As String() = System.IO.File.ReadAllLines("Files\SPs\Archer.txt")
SPArcher.Clear()
ComboBox_SPItem.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPItem.Items.Add(parts(0))
SPArcher.Add(parts(1))
Next
ComboBox_SPItem.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
End Sub
'Make SPMage "Public" to use
Private ReadOnly SPMage As New List(Of String)
Private Sub GunaRadioButton_SPMage_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_SPMage.CheckedChanged
If Not GunaRadioButton_SPMage.Checked Then Return
'Read File & Split SPMage
Dim lines As String() = System.IO.File.ReadAllLines("Files\SPs\Mage.txt")
SPMage.Clear()
ComboBox_SPItem.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPItem.Items.Add(parts(0))
SPMage.Add(parts(1))
Next
ComboBox_SPItem.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
End Sub
'Make SPMartialArtist "Public" to use
Private ReadOnly SPMartialArtist As New List(Of String)
Private Sub GunaRadioButton_SPMartialArtist_CheckedChanged(sender As Object, e As EventArgs) Handles GunaRadioButton_SPMartialArtist.CheckedChanged
If Not GunaRadioButton_SPMartialArtist.Checked Then Return
'Read File & Split SPMartialArtist
Dim lines As String() = System.IO.File.ReadAllLines("Files\SPs\Martial Artist.txt")
SPMartialArtist.Clear()
ComboBox_SPItem.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPItem.Items.Add(parts(0))
SPMartialArtist.Add(parts(1))
Next
ComboBox_SPItem.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
End Sub
'Make SPWC "Public" to use
Private ReadOnly SPWC As New List(Of String)
Private Sub GunaCheckBox_SPWC_CheckedChanged(sender As Object, e As EventArgs) Handles GunaCheckBox_SPWC.CheckedChanged
If Not GunaCheckBox_SPWC.Checked Then Return
'Read File & Split SPWC
Dim lines As String() = System.IO.File.ReadAllLines("Files\SP Wings Command\All.txt")
SPWC.Clear()
ComboBox_SPWC.Items.Clear()
TextBox_SPCommand.Clear()
For Each line As String In lines
Dim parts As String() = line.Split(","c)
ComboBox_SPWC.Items.Add(parts(0))
SPWC.Add(parts(1))
Next
ComboBox_SPWC.SelectedIndex = -1
'<<<------>>>
CreateNewCommandTextSP()
GunaImageButton_ClipSP.Visible = False
If GunaCheckBox_SPWC.Checked Then
Label_SPWC.Visible = True
ComboBox_SPWC.Visible = True
CreateNewCommandTextSP()
Else
ComboBox_SPWC.SelectedIndex = -1
Label_SPWC.Visible = False
ComboBox_SPWC.Visible = False
End If
End Sub
'######################################################## COMMAND FEATURE ########################################################
Private Sub CreateNewCommandTextSP()
If Not GunaRadioButton_SPFun.Checked AndAlso Not GunaRadioButton_SPSwordsman.Checked AndAlso Not GunaRadioButton_SPArcher.Checked AndAlso Not GunaRadioButton_SPMage.Checked AndAlso Not GunaRadioButton_SPMartialArtist.Checked OrElse ComboBox_SPItem.SelectedIndex = -1 OrElse ComboBox_SPUpgrade.SelectedIndex = -1 Then Return
Dim CommandTextSP = "$ci "
Select Case True
Case GunaRadioButton_SPFun.Checked : CommandTextSP &= SPFun(ComboBox_SPItem.SelectedIndex)
Case GunaRadioButton_SPSwordsman.Checked : CommandTextSP &= SPSwordsman(ComboBox_SPItem.SelectedIndex)
Case GunaRadioButton_SPArcher.Checked : CommandTextSP &= SPArcher(ComboBox_SPItem.SelectedIndex)
Case GunaRadioButton_SPMage.Checked : CommandTextSP &= SPMage(ComboBox_SPItem.SelectedIndex)
Case GunaRadioButton_SPMartialArtist.Checked : CommandTextSP &= SPMartialArtist(ComboBox_SPItem.SelectedIndex)
Case GunaCheckBox_SPWC.Checked : CommandTextSP &= SPWC(ComboBox_SPWC.SelectedIndex)
End Select
If ComboBox_SPUpgrade.SelectedItem.ToString <> "0" Then
CommandTextSP &= " " & ComboBox_SPUpgrade.SelectedItem.ToString
End If
CommandTextSP &= ComboBox_SPWC.SelectedItem
If GunaCheckBox_SPWC.Checked Then
TextBox_SPCommand.Text = CommandTextSP & " " & ComboBox_SPWC.SelectedIndex
End If
If GunaCheckBox_SPE.Checked Then
TextBox_SPCommand.Text = "$edit " + TextBox_SPName.Text + " " + CommandTextSP
Else
TextBox_SPCommand.Text = CommandTextSP
End If
If GunaCheckBox_SPCH.Checked Then
TextBox_SPCommand.Text = "$ci 287"
End If
If GunaCheckBox_SPCH.Checked And GunaCheckBox_SPE.Checked Then
TextBox_SPCommand.Text = "$edit " + TextBox_SPName.Text + " " + "$ci 287"
End If
End Sub
Private Sub ComboBox_SPItem_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_SPItem.SelectedIndexChanged
CreateNewCommandTextSP()
End Sub
Private Sub ComboBox_SPUpgrade_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_SPUpgrade.SelectedIndexChanged
CreateNewCommandTextSP()
End Sub
Private Sub ComboBox_SPWC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_SPWC.SelectedIndexChanged
CreateNewCommandTextSP()
End Sub
Private Sub GunaCheckBox_SPCH_CheckedChanged(sender As Object, e As EventArgs) Handles GunaCheckBox_SPCH.CheckedChanged
If GunaCheckBox_SPCH.Checked Then
TextBox_SPName.Clear()
TextBox_SPCommand.Text = "$ci 287"
Else
GunaImageButton_ClipSP.Visible = False
End If
If GunaCheckBox_SPCH.Checked Then
Label_SPUpgrade.Visible = False
ComboBox_SPUpgrade.Visible = False
Label_SPItem.Visible = False
ComboBox_SPItem.Visible = False
TextBox_SPCommand.Clear()
Else
Label_SPUpgrade.Visible = True
ComboBox_SPUpgrade.Visible = True
Label_SPItem.Visible = True
ComboBox_SPItem.Visible = True
TextBox_SPCommand.Clear()
End If
If GunaCheckBox_SPCH.Checked AndAlso GunaCheckBox_SPE.Checked Then
TextBox_SPName.Clear()
TextBox_SPCommand.Text = "$edit " + TextBox_SPName.Text + " " + "$ci 287 "
Else
TextBox_SPCommand.Clear()
TextBox_SPName.Clear()
CreateNewCommandTextSP()
End If
End Sub
Private Sub GunaCheckBox_SPE_CheckedChanged(sender As Object, e As EventArgs) Handles GunaCheckBox_SPE.CheckedChanged
If GunaCheckBox_SPE.Checked Then
TextBox_SPName.Clear()
Label_SPName.Visible = True
TextBox_SPName.Visible = True
Else
TextBox_SPName.Clear()
Label_SPName.Visible = False
TextBox_SPName.Visible = False
End If
If GunaCheckBox_SPCH.Checked And GunaCheckBox_SPE.Checked Then
TextBox_SPName.Clear()
TextBox_SPCommand.Text = "$edit " + TextBox_SPName.Text + " " + "$ci 287 "
Else
CreateNewCommandTextSP()
End If
End Sub
Private Sub TextBox_SPName_TextChanged(sender As Object, e As EventArgs) Handles TextBox_SPName.TextChanged
If GunaCheckBox_SPCH.Checked AndAlso GunaCheckBox_SPE.Checked Then
TextBox_SPCommand.Text = "$edit " + TextBox_SPName.Text + " " + "$ci 287 "
Else
CreateNewCommandTextSP()
End If
End Sub
'######################################################## SHOW & HIDE SPECIALIST CARDS ICONS ########################################################
Private Sub TextBox_SPCommand_TextChanged(sender As Object, e As EventArgs) Handles TextBox_SPCommand.TextChanged
'When Empty don't show Clipboard Icon
If TextBox_SPCommand.Text = "" Then
GunaImageButton_ClipSP.Visible = False
End If
'<<<------>>>
'Show Clipboard Icon & Hide Checkmark Icon
GunaImageButton_ClipSP.Visible = True
GunaImageButton_CheckmarkSP.Visible = False
'<<<------>>>
End Sub
Private Sub GunaImageButton_ClipSP_Click(sender As Object, e As EventArgs) Handles GunaImageButton_ClipSP.Click
'No SP Clipboard when TextBox is Empty
If TextBox_SPCommand.Text = "" Then
Exit Sub
End If
'<<<------>>>
'Clipboard Function
Clipboard.SetText(TextBox_SPCommand.Text)
'<<<------>>>
End Sub
Private Sub GunaImageButton_ClipSP_MouseClick(sender As Object, e As MouseEventArgs) Handles GunaImageButton_ClipSP.MouseClick
'SP Hide Clipboard Icon & Show Checkmark Icon
GunaImageButton_ClipSP.Visible = False
GunaImageButton_CheckmarkSP.Visible = True
'<<<------>>>
End Sub
End Class