CodepointSystem module, ColorSystem module, Completing TerminalInternalApps migrating to modules

This commit is contained in:
EverythingWindows 2022-11-17 11:03:57 +07:00
parent e08f5e8e55
commit b6ad60f568
9 changed files with 72 additions and 76 deletions

View file

@ -8,7 +8,7 @@
If Strings.AvailableFeature(18) = 1 Then If Strings.AvailableFeature(18) = 1 Then
ShOSKey_InputCommand(command) ShOSKey_InputCommand(command)
End If End If
Console.DoCommand() Terminal_DoCommand()
Terminal_PrintPrompt() Terminal_PrintPrompt()
TextRebind() TextRebind()
End Sub End Sub
@ -67,7 +67,7 @@
Dim i As Integer = 1 Dim i As Integer = 1
While i <= linenum While i <= linenum
command = sr.ReadLine() command = sr.ReadLine()
Console.DoCommand() Terminal_DoCommand()
NewLine(Nothing) NewLine(Nothing)
i = i + 1 i = i + 1
End While End While
@ -106,7 +106,7 @@
AdvancedCommand = False AdvancedCommand = False
Console.BadCommand = False Console.BadCommand = False
Case "colors" Case "colors"
DisplayColors() Colors()
AdvancedCommand = False AdvancedCommand = False
Console.BadCommand = False Console.BadCommand = False
Case "date" Case "date"

View file

@ -0,0 +1,11 @@
Module CodepointSystem
Public Sub ChangeCP(Addition As Boolean, NeededCP As Integer)
Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2))
If Addition = True Then
TempCP = TempCP + NeededCP
Else
TempCP = TempCP - NeededCP
End If
Strings.ComputerInfo(2) = Convert.ToString(TempCP)
End Sub
End Module

View file

@ -1,4 +1,4 @@
Module TerminalColorSystem Module ColorSystem
'GUIDE to COLORS in TERMINAL 'GUIDE to COLORS in TERMINAL
'Using the same Hexadecimal numbering as what Command Prompt used to: 'Using the same Hexadecimal numbering as what Command Prompt used to:
'0 = Black 8 = Gray '0 = Black 8 = Gray
@ -12,53 +12,6 @@
Public BgColor As Color Public BgColor As Color
Public FgColor As Color Public FgColor As Color
Public Sub DisplayColors()
NewLine("TERMINAL SUPPORTED COLORS")
NewLine(Nothing)
NewLine(Nothing)
If Strings.AvailableFeature(10) = "1" Then
NewLine("0 = Black 8 = Gray")
Else
NewLine("0 = Black 8 = ???")
End If
If Strings.AvailableFeature(14) = "1" Then
NewLine("1 = Blue 9 = Light Blue")
NewLine("2 = Green A = Light Green")
Else
If Strings.AvailableFeature(13) = "1" Then
NewLine("1 = ??? 9 = Light Blue")
NewLine("2 = Green A = ???")
Else
NewLine("1 = ??? 9 = ???")
NewLine("2 = ??? A = ???")
End If
End If
If Strings.AvailableFeature(15) = "1" Then
NewLine("3 = Aqua B = Light Aqua")
Else
NewLine("3 = ??? B = ???")
End If
If Strings.AvailableFeature(14) = "1" Then
NewLine("4 = Red C = Light Red")
ElseIf Strings.AvailableFeature(13) = "1" Then
NewLine("4 = ??? C = Light Red")
Else
NewLine("4 = ??? C = ???")
End If
If Strings.AvailableFeature(15) = "1" Then
NewLine("5 = Purple D = Light Purple")
NewLine("6 = Yellow E = Yellow")
Else
NewLine("5 = ??? D = ???")
NewLine("6 = ??? E = ???")
End If
If Strings.AvailableFeature(10) = "1" Then
NewLine("7 = Dark Gray F = White")
Else
NewLine("7 = ??? F = White")
End If
End Sub
Public Sub GetColor(App As String, Bg As String, Fg As String) Public Sub GetColor(App As String, Bg As String, Fg As String)
Select Case App Select Case App
Case "terminal" Case "terminal"

View file

@ -96,10 +96,6 @@ Public Class Console
End If End If
End Sub End Sub
Public Sub DoCommand()
End Sub
Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
KeyInput = e.KeyData KeyInput = e.KeyData
Select Case e.KeyData Select Case e.KeyData

View file

@ -93,6 +93,7 @@
<Import Include="System.Threading.Tasks" /> <Import Include="System.Threading.Tasks" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Functions\InGame\CodepointSystem.vb" />
<Compile Include="Functions\InGame\Terminate.vb" /> <Compile Include="Functions\InGame\Terminate.vb" />
<Compile Include="MainForms\BugSlap.Designer.vb"> <Compile Include="MainForms\BugSlap.Designer.vb">
<DependentUpon>BugSlap.vb</DependentUpon> <DependentUpon>BugSlap.vb</DependentUpon>
@ -160,13 +161,16 @@
<Compile Include="API\TerminalAPI.vb" /> <Compile Include="API\TerminalAPI.vb" />
<Compile Include="TerminalApplications\External\App_TextPad.vb" /> <Compile Include="TerminalApplications\External\App_TextPad.vb" />
<Compile Include="TerminalApplications\External\TerminalExternalApps.vb" /> <Compile Include="TerminalApplications\External\TerminalExternalApps.vb" />
<Compile Include="Functions\InGame\TerminalColorSystem.vb" /> <Compile Include="Functions\InGame\ColorSystem.vb" />
<Compile Include="TerminalApplications\Internal\Com_05tray.vb" /> <Compile Include="TerminalApplications\Internal\Com_05tray.vb" />
<Compile Include="TerminalApplications\Internal\Com_Codepoint.vb" /> <Compile Include="TerminalApplications\Internal\Com_Codepoint.vb" />
<Compile Include="TerminalApplications\Internal\Com_Color.vb" />
<Compile Include="TerminalApplications\Internal\Com_Colors.vb" />
<Compile Include="TerminalApplications\Internal\Com_Cowsay.vb" /> <Compile Include="TerminalApplications\Internal\Com_Cowsay.vb" />
<Compile Include="TerminalApplications\Internal\Com_Help.vb" /> <Compile Include="TerminalApplications\Internal\Com_Help.vb" />
<Compile Include="TerminalApplications\Internal\Com_Hostname.vb" /> <Compile Include="TerminalApplications\Internal\Com_Hostname.vb" />
<Compile Include="TerminalApplications\Internal\Com_Infobar.vb" /> <Compile Include="TerminalApplications\Internal\Com_Infobar.vb" />
<Compile Include="TerminalApplications\Internal\Com_Manual.vb" />
<Compile Include="TerminalApplications\Internal\Com_Pwd.vb" /> <Compile Include="TerminalApplications\Internal\Com_Pwd.vb" />
<Compile Include="TerminalApplications\Internal\Com_Rev.vb" /> <Compile Include="TerminalApplications\Internal\Com_Rev.vb" />
<Compile Include="TerminalApplications\Internal\Com_Shiftfetch.vb" /> <Compile Include="TerminalApplications\Internal\Com_Shiftfetch.vb" />
@ -175,7 +179,6 @@
<Compile Include="TerminalApplications\Internal\Com_Username.vb" /> <Compile Include="TerminalApplications\Internal\Com_Username.vb" />
<Compile Include="TerminalApplications\Internal\Com_Ver.vb" /> <Compile Include="TerminalApplications\Internal\Com_Ver.vb" />
<Compile Include="TerminalApplications\Internal\Com_Date.vb" /> <Compile Include="TerminalApplications\Internal\Com_Date.vb" />
<Compile Include="TerminalApplications\Internal\TerminalInternalApps.vb" />
<Compile Include="Functions\OutGame\TheUpdater.vb" /> <Compile Include="Functions\OutGame\TheUpdater.vb" />
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">

View file

@ -19,16 +19,6 @@ Module TerminalExternalApps
Public TextPad_FileName As String Public TextPad_FileName As String
Public TextPad_TempText As New Timer Public TextPad_TempText As New Timer
Public Sub ChangeCP(Addition As Boolean, NeededCP As Integer)
Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2))
If Addition = True Then
TempCP = TempCP + NeededCP
Else
TempCP = TempCP - NeededCP
End If
Strings.ComputerInfo(2) = Convert.ToString(TempCP)
End Sub
Public Sub AppHost(App As Object, UseToolBar As Boolean) Public Sub AppHost(App As Object, UseToolBar As Boolean)
Select Case App Select Case App
Case "bc" Case "bc"

View file

@ -0,0 +1,3 @@
Module Com_Color
End Module

View file

@ -0,0 +1,48 @@
Module Com_Colors
Public Sub Colors()
NewLine("TERMINAL SUPPORTED COLORS")
NewLine(Nothing)
NewLine(Nothing)
If Strings.AvailableFeature(10) = "1" Then
NewLine("0 = Black 8 = Gray")
Else
NewLine("0 = Black 8 = ???")
End If
If Strings.AvailableFeature(14) = "1" Then
NewLine("1 = Blue 9 = Light Blue")
NewLine("2 = Green A = Light Green")
Else
If Strings.AvailableFeature(13) = "1" Then
NewLine("1 = ??? 9 = Light Blue")
NewLine("2 = Green A = ???")
Else
NewLine("1 = ??? 9 = ???")
NewLine("2 = ??? A = ???")
End If
End If
If Strings.AvailableFeature(15) = "1" Then
NewLine("3 = Aqua B = Light Aqua")
Else
NewLine("3 = ??? B = ???")
End If
If Strings.AvailableFeature(14) = "1" Then
NewLine("4 = Red C = Light Red")
ElseIf Strings.AvailableFeature(13) = "1" Then
NewLine("4 = ??? C = Light Red")
Else
NewLine("4 = ??? C = ???")
End If
If Strings.AvailableFeature(15) = "1" Then
NewLine("5 = Purple D = Light Purple")
NewLine("6 = Yellow E = Yellow")
Else
NewLine("5 = ??? D = ???")
NewLine("6 = ??? E = ???")
End If
If Strings.AvailableFeature(10) = "1" Then
NewLine("7 = Dark Gray F = White")
Else
NewLine("7 = ??? F = White")
End If
End Sub
End Module

View file

@ -1,12 +1,4 @@
Module TerminalInternalApps Module Com_Manual
Public Sub Cowsay_Say(Say As String)
End Sub
Public Sub DateTerm()
End Sub
Public Sub Manual(Command As String) Public Sub Manual(Command As String)
'MAN command starts with this kinda format 'MAN command starts with this kinda format
'ShiftOS Help Manual 'ShiftOS Help Manual