Untitled

 avatar
unknown
plain_text
3 years ago
2.6 kB
1
Indexable
Private Sub CreateNewCommandTextP()

        'special command (uses standard or edit prefix)
        If GunaCheckBox_PBead.Checked Then
            TextBox_PCommand.Text = "$ci 286"
        End If

        If Not GunaRadioButton_PLong.Checked AndAlso Not GunaRadioButton_PShort.Checked AndAlso Not GunaRadioButton_PMagic.Checked OrElse ComboBox_PItem.SelectedIndex = -1 Then Return
        Dim CommandTextP = "$ci "

        'set item selection
        Select Case True
            Case GunaRadioButton_PLong.Checked : CommandTextP &= PLong(ComboBox_PItem.SelectedIndex)
            Case GunaRadioButton_PShort.Checked : CommandTextP &= PShort(ComboBox_PItem.SelectedIndex)
            Case GunaRadioButton_PMagic.Checked : CommandTextP &= PMagic(ComboBox_PItem.SelectedIndex)
        End Select
        If GunaCheckBox_PAdd.Checked Then
            CreateNewCommandTextPAdd()
        End If
        'show command
        TextBox_PCommand.Text = CommandTextP

        'edit command
        If GunaCheckBox_PE.Checked Then
            TextBox_PCommand.Text = "$edit " + TextBox_PName.Text + " " + CommandTextP
        End If

    End Sub

    Private Sub CreateNewCommandTextPAdd()

        If Not GunaRadioButton_PLong.Checked AndAlso Not GunaRadioButton_PShort.Checked AndAlso Not GunaRadioButton_PMagic.Checked OrElse ComboBox_PItem.SelectedIndex = -1 Then Return
        Dim CommandTextPAdd = "$AddPartner "

        Select Case True
            Case GunaRadioButton_PLong.Checked : CommandTextPAdd &= PAddLong(ComboBox_PItem.SelectedIndex)
            Case GunaRadioButton_PShort.Checked : CommandTextPAdd &= PAddShort(ComboBox_PItem.SelectedIndex)
            Case GunaRadioButton_PMagic.Checked : CommandTextPAdd &= PAddMagic(ComboBox_PItem.SelectedIndex)
        End Select

        If TextBox_PLevel.Text = "0" Then
            TextBox_PLevel.Text = "1"
            If TextBox_PLevel.Text = "" Then
                TextBox_PLevel.Text = "1"
            End If
        End If
        If TextBox_PLevel.Text > "0" Then
            CommandTextPAdd &= " " + TextBox_PLevel.Text
        End If

        If GunaCheckBox_PAdd.Checked Then
            TextBox_PCommand.Text = CommandTextPAdd
        End If

        'show command
        TextBox_PCommand.Text = CommandTextPAdd

        'edit command
        If GunaCheckBox_PAdd.Checked AndAlso GunaCheckBox_PE.Checked Then
            TextBox_PCommand.Text = "$edit " + TextBox_PName.Text + " " + CommandTextPAdd
        End If

    End Sub