2022-11-13 08:15:05 +00:00
|
|
|
|
Module ConsoleAPI
|
2022-11-23 14:30:54 +00:00
|
|
|
|
Public StayAtChapter As Boolean = False 'If this set to true, then intro for chapters are mostly going to be in
|
2024-01-18 08:06:39 +00:00
|
|
|
|
Public NewBackground As System.ComponentModel.BackgroundWorker
|
2022-11-16 01:28:22 +00:00
|
|
|
|
|
|
|
|
|
Public Sub Console_Windowed()
|
|
|
|
|
Console.WindowState = FormWindowState.Normal
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub Console_Full()
|
|
|
|
|
Console.FormBorderStyle = FormBorderStyle.None
|
|
|
|
|
Console.WindowState = FormWindowState.Maximized
|
|
|
|
|
End Sub
|
|
|
|
|
|
2022-11-19 00:25:02 +00:00
|
|
|
|
Public Sub Console_Interpreters()
|
|
|
|
|
If Console.ShouldChange = True Then
|
|
|
|
|
Console.ChangeInterpreter = True
|
|
|
|
|
Console.ShouldChange = False
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
2022-11-13 08:15:05 +00:00
|
|
|
|
Public Sub NewLine(str As String)
|
|
|
|
|
Console.TextBox1.Text = Console.TextBox1.Text & Environment.NewLine & str
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub AddLine(str As String)
|
|
|
|
|
Console.TextBox1.Text = Console.TextBox1.Text & str
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub ResetLine(str As String)
|
|
|
|
|
Console.TextBox1.Text = str
|
|
|
|
|
End Sub
|
|
|
|
|
|
2022-11-14 03:25:13 +00:00
|
|
|
|
Public Sub Undeveloped()
|
|
|
|
|
NewLine("Oopsie! It's only for newer version")
|
|
|
|
|
End Sub
|
|
|
|
|
|
2022-11-13 08:15:05 +00:00
|
|
|
|
Public Sub TextRebind()
|
|
|
|
|
Console.TextBox1.Select(Console.TextBox1.Text.Length, 0)
|
|
|
|
|
Console.TextBox1.ScrollToCaret()
|
|
|
|
|
End Sub
|
2022-11-13 14:22:42 +00:00
|
|
|
|
|
|
|
|
|
Public Sub TextRebindBehind()
|
|
|
|
|
'Console.TextBox1.Select(Console.TextBox1.Lines.Length - 1, 0)
|
|
|
|
|
Console.TextBox1.Select(Console.TextBox1.Lines.Length - 1, 0)
|
|
|
|
|
Console.TextBox1.ScrollToCaret()
|
|
|
|
|
End Sub
|
2024-01-18 08:06:39 +00:00
|
|
|
|
|
|
|
|
|
Public Function NewBackgroundWorker(WorkSub As System.ComponentModel.DoWorkEventHandler, ProgressSub As System.ComponentModel.ProgressChangedEventHandler, CompleteSub As System.ComponentModel.RunWorkerCompletedEventHandler)
|
|
|
|
|
NewLine("NewBW")
|
|
|
|
|
NewBackground = New ComponentModel.BackgroundWorker
|
|
|
|
|
NewBackground.WorkerReportsProgress = True
|
|
|
|
|
NewBackground.WorkerSupportsCancellation = True
|
|
|
|
|
AddHandler NewBackground.DoWork, WorkSub
|
|
|
|
|
AddHandler NewBackground.ProgressChanged, ProgressSub
|
|
|
|
|
AddHandler NewBackground.RunWorkerCompleted, CompleteSub
|
|
|
|
|
NewBackground.RunWorkerAsync()
|
|
|
|
|
|
|
|
|
|
'Return NewBackground
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Sub StopBackgroundWorker(WhichBackgroundWorker As System.ComponentModel.BackgroundWorker)
|
|
|
|
|
If WhichBackgroundWorker IsNot Nothing AndAlso WhichBackgroundWorker.WorkerSupportsCancellation Then
|
|
|
|
|
' Request cancellation
|
|
|
|
|
NewLine("CloseBW")
|
|
|
|
|
WhichBackgroundWorker.CancelAsync()
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
2022-11-13 08:15:05 +00:00
|
|
|
|
End Module
|