2022-11-07 07:16:34 +00:00
Imports System . IO
2022-11-13 08:15:05 +00:00
Module TerminalExternalApps
2022-11-07 07:16:34 +00:00
Public KeyInput As Keys
2022-11-03 15:27:40 +00:00
2022-11-06 11:45:00 +00:00
Public Sub AppHost ( App As Object , UseToolBar As Boolean )
2022-11-03 15:27:40 +00:00
Select Case App
2022-11-05 15:24:30 +00:00
'Revisit Later
'Case "pause" 'Pause function
' Terminal.TextBox1.ReadOnly = True
' Terminal.DefaultPrompt = "Press any key to continue..."
' Terminal.CurrentInterpreter = "pause"
' FreezeText = Terminal.TextBox1.Text
' ShouldChange = True
2022-11-04 23:27:35 +00:00
Case " shiftoriumfx " 'ShiftoriumFX : Advanced Shiftorium
2022-11-13 08:15:05 +00:00
Console . DefaultPrompt = " Navigate> "
Console . CurrentInterpreter = " shiftoriumfx "
2022-11-04 22:36:43 +00:00
ShiftoriumFX_DisplayPackages ( )
2022-11-13 14:22:42 +00:00
NewLine ( Nothing )
NewLine ( " Type any package you want to investigate " )
2022-11-18 09:58:37 +00:00
Console . ShouldChange = True
2022-11-03 15:27:40 +00:00
End Select
2022-11-13 08:15:05 +00:00
If Console . ReleaseCursor = True Then
2022-11-07 07:16:34 +00:00
'Strings.OnceInfo(5) = Terminal.TrackPos
'Terminal.TrackPos = Nothing
2022-11-06 11:45:00 +00:00
End If
2022-11-03 15:27:40 +00:00
End Sub
2022-11-07 07:16:34 +00:00
Public Sub TerminateApp ( KeyInput As Keys )
2022-11-13 08:15:05 +00:00
Select Case Console . CurrentInterpreter
2022-11-07 07:16:34 +00:00
Case " textpad "
Dim BeforeCP As Integer = Strings . ComputerInfo ( 2 )
2022-11-13 08:15:05 +00:00
If File . Exists ( Console . CurrentDirectory & " \ " & command ) = True Then
Dim TextCompare As String = My . Computer . FileSystem . ReadAllText ( Console . CurrentDirectory & " \ " & command )
If Console . TextBox1 . Text = TextCompare Then
Console . TextBox1 . Text = Nothing
2022-11-07 07:16:34 +00:00
Else
2022-11-13 08:15:05 +00:00
SaveFile ( command )
2022-11-07 07:16:34 +00:00
TextPad_GenerateCP_SavedFile ( )
Dim AfterCP As Integer = Strings . ComputerInfo ( 2 ) - BeforeCP
2022-11-13 08:15:05 +00:00
Console . TextBox1 . Text = " You've got " & AfterCP & " Codepoints "
2022-11-07 07:16:34 +00:00
End If
Else
2022-11-13 08:15:05 +00:00
SaveFile ( command )
2022-11-07 07:16:34 +00:00
TextPad_GenerateCP_SavedFile ( )
Dim AfterCP As Integer = Strings . ComputerInfo ( 2 ) - BeforeCP
2022-11-13 08:15:05 +00:00
Console . TextBox1 . Text = " You've got " & AfterCP & " Codepoints "
2022-11-07 07:16:34 +00:00
End If
2022-11-13 08:15:05 +00:00
Console . ToolBarUse = False
Console . ChangeInterpreter = False
Console . ReleaseCursor = False
Console . CurrentInterpreter = " terminal "
2022-11-17 06:36:07 +00:00
Terminal_CheckFeature ( )
2022-11-13 08:15:05 +00:00
Terminal_AssignPrompt ( )
Terminal_PrintPrompt ( )
TextRebind ( )
2022-11-07 07:16:34 +00:00
Case Else
2022-11-13 08:15:05 +00:00
Console . ToolBarUse = False
Console . ChangeInterpreter = False
Console . ReleaseCursor = False
Console . CurrentInterpreter = " terminal "
2022-11-17 06:36:07 +00:00
Terminal_CheckFeature ( )
2022-11-13 08:15:05 +00:00
Terminal_AssignPrompt ( )
Terminal_PrintPrompt ( )
TextRebind ( )
2022-11-07 07:16:34 +00:00
End Select
2022-11-03 15:27:40 +00:00
End Sub
Public Sub DoChildCommand ( )
2022-11-13 08:15:05 +00:00
Select Case Console . CurrentInterpreter
2022-11-03 15:27:40 +00:00
Case " guess "
2022-11-13 08:15:05 +00:00
Select Case command
2022-11-03 15:27:40 +00:00
Case " exit "
2022-11-07 07:16:34 +00:00
TerminateApp ( Nothing )
2022-11-03 15:27:40 +00:00
Case Else
Try
GTN_CheckNumber ( )
Catch ex As Exception
2022-11-13 14:22:42 +00:00
NewLine ( " Invalid value! " )
2022-11-03 15:27:40 +00:00
End Try
End Select
2022-11-04 22:36:43 +00:00
Case " shiftoriumfx "
2022-11-13 08:15:05 +00:00
Select Case command
2022-11-05 15:24:30 +00:00
Case " "
2022-11-04 22:36:43 +00:00
Case " exit "
2022-11-07 07:16:34 +00:00
TerminateApp ( Nothing )
2022-11-04 22:36:43 +00:00
Case Else
ShiftoriumFX_DisplayPackages ( )
2022-11-13 14:22:42 +00:00
NewLine ( Nothing )
NewLine ( " Type any package you want to investigate " )
NewLine ( " Invalid package or bad command " )
2022-11-04 22:36:43 +00:00
End Select
2022-11-05 15:24:30 +00:00
Case " bc "
2022-11-13 08:15:05 +00:00
Select Case command
2022-11-05 15:24:30 +00:00
Case " jim "
2022-11-13 14:22:42 +00:00
NewLine ( " 69, the funni number " )
NewLine ( " gotcha! " )
2022-11-05 15:24:30 +00:00
Case " ojas "
2022-11-13 14:22:42 +00:00
NewLine ( " dis calculator is very gud " )
NewLine ( " it counts from another universe " )
2022-11-05 15:24:30 +00:00
Case " exit "
2022-11-07 07:16:34 +00:00
TerminateApp ( Nothing )
2022-11-05 15:24:30 +00:00
Case Else
2022-11-18 09:58:37 +00:00
BC_Calculate ( )
2022-11-05 15:24:30 +00:00
End Select
2022-11-20 09:43:01 +00:00
Case " mathquiz "
Select Case command
Case " exit "
TerminateApp ( Nothing )
Case Else
MQ_CheckAnswer ( )
End Select
2022-11-05 15:24:30 +00:00
End Select
End Sub
2022-11-08 03:22:01 +00:00
Public Sub ShOSKey_InputCommand ( lastcommand As String )
2022-11-13 08:15:05 +00:00
Console . ShOSKey = lastcommand
2022-11-08 03:22:01 +00:00
End Sub
Public Sub ShOSKey_Display ( )
2022-11-13 08:15:05 +00:00
Console . TextBox1 . Text = Console . TextBox1 . Text & Console . ShOSKey
2022-11-08 03:22:01 +00:00
Try
2022-11-13 08:15:05 +00:00
Console . TrackPos = Console . ShOSKey . Length
2022-11-08 03:22:01 +00:00
Catch ex As Exception
2022-11-13 08:15:05 +00:00
Console . TrackPos = 0
2022-11-08 03:22:01 +00:00
End Try
End Sub
2022-11-04 22:36:43 +00:00
Public Sub ShiftoriumFX_DisplayPackages ( )
2022-11-13 08:15:05 +00:00
Console . TextBox1 . Text = " Shiftorium FX! " & Environment . NewLine & " The place to shiftisize the ShiftOS " & Environment . NewLine & Environment . NewLine & " Available Package(s) "
2022-11-04 22:36:43 +00:00
Shiftorium_ListFeatures ( )
End Sub
2022-11-02 04:17:14 +00:00
End Module