Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Imports System.Text.RegularExpressions
- Public Class Form1
- Dim source As String
- Dim contents As String
- Dim sounds As String
- Private Sub DeumosButton1_Click(sender As System.Object, e As System.EventArgs) Handles DeumosButton1.Click
- Me.Close()
- End Sub
- Private Sub DeumosButton2_Click(sender As System.Object, e As System.EventArgs) Handles DeumosButton2.Click
- Me.WindowState = FormWindowState.Minimized
- End Sub
- Private Sub DeumosButton3_Click(sender As System.Object, e As System.EventArgs) Handles DeumosButton3.Click
- OpenFileDialog1.ShowDialog()
- End Sub
- Private Sub OpenFileDialog1_FileOk(sender As System.Object, e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
- source = OpenFileDialog1.FileName
- DeumosTextBox1.Text = source
- contents = File.ReadAllText(source)
- End Sub
- Private Sub DeumosButton4_Click(sender As System.Object, e As System.EventArgs) Handles DeumosButton4.Click
- If DeumosTextBox1.Text = "" Then
- MessageBox.Show("The box in the top of the program cannot be empty!", "Voices Adder", MessageBoxButtons.OK, MessageBoxIcon.Error)
- Else
- Try
- If Regex.IsMatch(DeumosTextBox4.Text, "(.*)\/(.*)?(.*)?\/(.*)?\.wav?") = False Then
- MessageBox.Show("That is not a valid voice path.", "Voices Adder", MessageBoxButtons.OK, MessageBoxIcon.Error)
- Else
- If DeumosRadioButton1.Checked = True Then
- File.WriteAllText(source, contents + vbNewLine + "openAura.schema:AddVoice(""Combine"", """ + DeumosTextBox2.Text + """, """ + DeumosTextBox3.Text + """, """ + DeumosTextBox4.Text + """);")
- DeumosTextBox2.Text = ""
- DeumosTextBox3.Text = ""
- DeumosTextBox4.Text = ""
- Else
- File.WriteAllText(source, contents + vbNewLine + "Clockwork.schema:AddVoice(""Combine"", """ + DeumosTextBox2.Text + """, """ + DeumosTextBox3.Text + """, """ + DeumosTextBox4.Text + """);")
- DeumosTextBox2.Text = ""
- DeumosTextBox3.Text = ""
- DeumosTextBox4.Text = ""
- End If
- End If
- Catch ex As Exception
- MessageBox.Show("The path specified in the top of the program does not seem to be valid.", "Voices Adder", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End If
- End Sub
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- DeumosRadioButton1.Checked = True
- If File.Exists(Application.StartupPath + "\sounds.txt" = False) Then
- MessageBox.Show("The sounds.txt file is missing from the program's startup path! This program and the sounds.txt file must be in the same folder.", "Voices Adder", MessageBoxButtons.OK, MessageBoxIcon.Error)
- Me.Close()
- Else
- sounds = File.ReadAllText(Application.StartupPath + "\sounds.txt")
- End If
- End Sub
- Private Sub Form1_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
- MessageBox.Show("Created by Duck from TurtleSoup Gaming.", "Voices Adder", MessageBoxButtons.OK, MessageBoxIcon.Information)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement