diff --git a/ShiftOS-TheRevival/API/TerminalAPI.vb b/ShiftOS-TheRevival/API/TerminalAPI.vb index e830f41..f199b84 100644 --- a/ShiftOS-TheRevival/API/TerminalAPI.vb +++ b/ShiftOS-TheRevival/API/TerminalAPI.vb @@ -97,7 +97,7 @@ End If Case "clear" If Strings.AvailableFeature(1) = "1" Then - Console.TextBox1.Text = Nothing + Clear() AdvancedCommand = False Console.BadCommand = False End If diff --git a/ShiftOS-TheRevival/Functions/InGame/DirectoryManagements.vb b/ShiftOS-TheRevival/Functions/InGame/DirectoryManagements.vb index 7647e1e..8b77bbe 100644 --- a/ShiftOS-TheRevival/Functions/InGame/DirectoryManagements.vb +++ b/ShiftOS-TheRevival/Functions/InGame/DirectoryManagements.vb @@ -1,83 +1,3 @@ Module DirectoryManagements - Dim spaces As String - Public Sub TerminalDirectories(TheDirectory As String) - Console.Pseudodir = TheDirectory.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS", "!") - NewLine("Contents of " & Console.Pseudodir) - NewLine(Nothing) - NewLine("[DIR] 0 KB .") - NewLine("[DIR] 0 KB ..") - For Each Dir As String In IO.Directory.GetDirectories(TheDirectory) - Dim dirinf As New IO.DirectoryInfo(Dir) - NewLine("[DIR] 0 KB " & dirinf.Name) - Next - For Each file As String In IO.Directory.GetFiles(TheDirectory) - Dim filinf As New IO.FileInfo(file) - Dim filsize As Long = filinf.Length / 1024 - Dim thesize As Integer = 1 - Do - If filsize >= 1024 Then - filsize = filsize / 1024 - thesize = thesize + 1 - Else - Exit Do - End If - Loop - Select Case filsize - Case 0 To 9 - spaces = " " - Case 10 To 99 - spaces = " " - Case 100 To 999 - spaces = " " - Case 1000 To 1023 - spaces = " " - End Select - Select Case thesize - Case 1 - NewLine(spaces & filsize & " KB " & filinf.Name) - Case 2 - NewLine(spaces & filsize & " MB " & filinf.Name) - Case 3 - NewLine(spaces & filsize & " GB " & filinf.Name) - End Select - Next - End Sub - Public Sub NavigateDir(TheDirectory As String) - If TheDirectory = ".." Then - If Console.CurrentDirectory = Strings.OnceInfo(1) Then - NewLine("!\") - Else - Console.CurrentDirectory = IO.Directory.GetParent(Console.CurrentDirectory).ToString - End If - Else - If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then - Console.CurrentDirectory = Console.CurrentDirectory & "\" & TheDirectory - ElseIf IO.Directory.Exists(TheDirectory) Then - Console.CurrentDirectory = TheDirectory - Else - NewLine("The directory is not exist!") - End If - End If - End Sub - - Public Sub CreateDir(TheDirectory As String) - If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then - NewLine("Directory is already exists!") - Else - IO.Directory.CreateDirectory(Console.CurrentDirectory + "\" + TheDirectory) - End If - End Sub - - Public Sub RemoveDir(TheDirectory As String) - If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then - Try - IO.Directory.Delete(Console.CurrentDirectory + "\" + TheDirectory) - Catch ex As Exception - NewLine(ex.Message) - End Try - Else - NewLine("The directory is not exists!") - End If - End Sub End Module diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index 4f5e7ba..c660d6c 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -163,16 +163,20 @@ + + - + + + diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb new file mode 100644 index 0000000..479d050 --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Cd.vb @@ -0,0 +1,19 @@ +Module Com_Cd + Public Sub NavigateDir(TheDirectory As String) + If TheDirectory = ".." Then + If Console.CurrentDirectory = Strings.OnceInfo(1) Then + NewLine("!\") + Else + Console.CurrentDirectory = IO.Directory.GetParent(Console.CurrentDirectory).ToString + End If + Else + If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then + Console.CurrentDirectory = Console.CurrentDirectory & "\" & TheDirectory + ElseIf IO.Directory.Exists(TheDirectory) Then + Console.CurrentDirectory = TheDirectory + Else + NewLine("The directory is not exist!") + End If + End If + End Sub +End Module diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb new file mode 100644 index 0000000..0a22401 --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Clear.vb @@ -0,0 +1,5 @@ +Module Com_Clear + Public Sub Clear() + Console.TextBox1.Text = Nothing + End Sub +End Module diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb deleted file mode 100644 index ac9d52e..0000000 --- a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Color.vb +++ /dev/null @@ -1,3 +0,0 @@ -Module Com_Color - -End Module diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb new file mode 100644 index 0000000..d697c32 --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Dir.vb @@ -0,0 +1,46 @@ +Module Com_Dir + Dim spaces As String + + Public Sub TerminalDirectories(TheDirectory As String) + Console.Pseudodir = TheDirectory.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS", "!") + NewLine("Contents of " & Console.Pseudodir) + NewLine(Nothing) + NewLine("[DIR] 0 KB .") + NewLine("[DIR] 0 KB ..") + For Each Dir As String In IO.Directory.GetDirectories(TheDirectory) + Dim dirinf As New IO.DirectoryInfo(Dir) + NewLine("[DIR] 0 KB " & dirinf.Name) + Next + For Each file As String In IO.Directory.GetFiles(TheDirectory) + Dim filinf As New IO.FileInfo(file) + Dim filsize As Long = filinf.Length / 1024 + Dim thesize As Integer = 1 + Do + If filsize >= 1024 Then + filsize = filsize / 1024 + thesize = thesize + 1 + Else + Exit Do + End If + Loop + Select Case filsize + Case 0 To 9 + spaces = " " + Case 10 To 99 + spaces = " " + Case 100 To 999 + spaces = " " + Case 1000 To 1023 + spaces = " " + End Select + Select Case thesize + Case 1 + NewLine(spaces & filsize & " KB " & filinf.Name) + Case 2 + NewLine(spaces & filsize & " MB " & filinf.Name) + Case 3 + NewLine(spaces & filsize & " GB " & filinf.Name) + End Select + Next + End Sub +End Module diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb new file mode 100644 index 0000000..2943916 --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Mkdir.vb @@ -0,0 +1,9 @@ +Module Com_Mkdir + Public Sub CreateDir(TheDirectory As String) + If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then + NewLine("Directory is already exists!") + Else + IO.Directory.CreateDirectory(Console.CurrentDirectory + "\" + TheDirectory) + End If + End Sub +End Module diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb new file mode 100644 index 0000000..1d1754f --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rmdir.vb @@ -0,0 +1,13 @@ +Module Com_Rmdir + Public Sub RemoveDir(TheDirectory As String) + If IO.Directory.Exists(Console.CurrentDirectory + "\" + TheDirectory) Then + Try + IO.Directory.Delete(Console.CurrentDirectory + "\" + TheDirectory) + Catch ex As Exception + NewLine(ex.Message) + End Try + Else + NewLine("The directory is not exists!") + End If + End Sub +End Module