diff --git a/ShiftOS-TheRevival/API/TerminalAPI.vb b/ShiftOS-TheRevival/API/TerminalAPI.vb index e28f222..66b6af6 100644 --- a/ShiftOS-TheRevival/API/TerminalAPI.vb +++ b/ShiftOS-TheRevival/API/TerminalAPI.vb @@ -264,9 +264,15 @@ NormalCommand() End If Case "time" - Terminal_Time() - AdvancedCommand = False - NormalCommand() + If Strings.AvailableFeature(5) = 1 Then + Terminal_Time() + AdvancedCommand = False + NormalCommand() + ElseIf Strings.AvailableFeature(5) = 3 Then + Terminal_Time() + AdvancedCommand = False + NormalCommand() + End If Case "su" Terminal_Su() AdvancedCommand = False @@ -340,6 +346,13 @@ AdvancedCommand = False End If End If + If command Like "ren '*' '*'" Then + If Strings.AvailableFeature(31) = 1 Then + Rename() + NormalCommand() + AdvancedCommand = False + End If + End If If command Like "rev *" Then If Strings.AvailableFeature(21) = 1 Then Reverse() diff --git a/ShiftOS-TheRevival/Functions/InGame/FileManagement.vb b/ShiftOS-TheRevival/Functions/InGame/FileManagement.vb index b84a2a0..8ce69ff 100644 --- a/ShiftOS-TheRevival/Functions/InGame/FileManagement.vb +++ b/ShiftOS-TheRevival/Functions/InGame/FileManagement.vb @@ -5,12 +5,16 @@ Module FileManagement If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then Dim ContentsFinal As String = File.ReadAllText(Console.CurrentDirectory & "\" & filename) NewLine(ContentsFinal) + Else + NewLine("File is not exist") End If End Sub Public Sub DeleteFile(filename As String) If File.Exists(Console.CurrentDirectory & "\" & filename) = True Then File.Delete(Console.CurrentDirectory & "\" & filename) + Else + NewLine("File is not exist") End If End Sub diff --git a/ShiftOS-TheRevival/Functions/InGame/ROMs/Strings.vb b/ShiftOS-TheRevival/Functions/InGame/ROMs/Strings.vb index 0bbada4..325f583 100644 --- a/ShiftOS-TheRevival/Functions/InGame/ROMs/Strings.vb +++ b/ShiftOS-TheRevival/Functions/InGame/ROMs/Strings.vb @@ -79,7 +79,7 @@ '28 = Date by month and year [Shows date in MM/YYYY format] (0.2.5) (default : 0) '29 = Date by general [Shows date in general DD/MM/YYYY format] (0.2.5) (default : 0) '30 = Batch-file support for ShiftOS [Gives execution support for ShiftOS Script File (.scr)] (0.2.5) (default : 0) - '31 = Clipboard support for ShiftOS [Gives clipboard support for copy-pasting in ShiftOS] (0.2.6) (default : 0) + '31 = Rename support [Ability to rename files in ShiftOS] (default : 0) ' 'Features bought hierarchy : 'ShiftOS Key (KEY) (5 CP) @@ -100,8 +100,8 @@ '>>>>>>RGB Variant (rgb2) (75 CP) '>>>>>>>4-bit Color Display (4BITCOLOR) (80 CP) '>>>>>>>>Terminal Read-Only Memory Driver (ROMDRIVER, DIR, MKDIR, RMDIR, CD, PWD) (90 CP) + '>>>>>>>>>Rename support (RENAME) (95 CP) '>>>>>>>>>TextPad (100 CP) - '>>>>>>>>>>Clipboard support (CLIPBOARD) (100 CP) '>>>>>>>>>>ShiftOS Batch Script Support (BATCHSCRIPT) (100 CP) '>>Basic Calculator (BC) (55 CP) '>>Time by Seconds (TIME, STIME) (10 CP) diff --git a/ShiftOS-TheRevival/Functions/InGame/StoreManager/Shiftoriums.vb b/ShiftOS-TheRevival/Functions/InGame/StoreManager/Shiftoriums.vb index d24d072..dcc0fb1 100644 --- a/ShiftOS-TheRevival/Functions/InGame/StoreManager/Shiftoriums.vb +++ b/ShiftOS-TheRevival/Functions/InGame/StoreManager/Shiftoriums.vb @@ -55,9 +55,9 @@ If Strings.AvailableFeature(30) = "0" Then NewLine("(batchscript | 100 CP) ShiftOS Batch Script Support") End If - If Strings.AvailableFeature(31) = "0" Then - NewLine("(clipboard | 100 CP) Clipboard support") - End If + End If + If Strings.AvailableFeature(31) = "0" Then + NewLine("(rename | 95 CP) Rename command") End If End If End If @@ -381,13 +381,13 @@ NewLine(ManHeader(1)) NormalCommand() End If - Case "clipboard" + Case "rename" If Strings.AvailableFeature(31) = "0" Then - ManHeader(0) = "Clipboard Support" - ManHeader(1) = "100 CP" + ManHeader(0) = "Rename command" + ManHeader(1) = "95 CP" NewLine(ManHeader(0)) NewLine(Nothing) - NewLine("Adds the supports for clipboard") + NewLine("Gives ability to rename a file") NewLine(Nothing) NewLine(ManHeader(1)) NormalCommand() @@ -494,8 +494,8 @@ Case "batchscript" Shiftorium_InstallFeatures(True, "batchscript", 30, 100) NormalCommand() - Case "clipboard" - Shiftorium_InstallFeatures(True, "clipboard", 31, 100) + Case "rename" + Shiftorium_InstallFeatures(True, "rename", 31, 95) NormalCommand() Case Else NormalCommand() @@ -587,11 +587,11 @@ Case "romdriver" Strings.AvailableFeature(16) = "1" Strings.AvailableFeature(17) = "0" + Strings.AvailableFeature(31) = "0" success = True Case "textpad" Strings.AvailableFeature(17) = "1" Strings.AvailableFeature(30) = "0" - Strings.AvailableFeature(31) = "0" success = True Case "shiftkey" Strings.AvailableFeature(18) = "1" @@ -645,7 +645,7 @@ Case "batchscript" Strings.AvailableFeature(30) = "1" success = True - Case "clipboard" + Case "rename" Strings.AvailableFeature(31) = "1" success = True End Select diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index ecedef6..f8a83a4 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -178,6 +178,7 @@ + diff --git a/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rename.vb b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rename.vb new file mode 100644 index 0000000..43c79a1 --- /dev/null +++ b/ShiftOS-TheRevival/TerminalApplications/Internal/Com_Rename.vb @@ -0,0 +1,34 @@ +Imports System.IO + +Module Com_Rename + Public ShouldRename As Boolean + + Public Sub Rename() + Dim Names() As String = command.Split("''") + If Names(1) = "" Then + NewLine("No filename has been inputted") + ShouldRename = False + ElseIf Names(1) Like " *" Then + NewLine("Filename cannot be started with spaces") + ShouldRename = False + Else + ShouldRename = True + End If + If Names(3) = "" Then + NewLine("No new filename has been inputted") + ShouldRename = False + ElseIf Names(3) Like " *" Then + NewLine("Filename cannot be started with spaces") + ShouldRename = False + Else + ShouldRename = True + End If + If ShouldRename = True Then + If File.Exists(Console.CurrentDirectory & "\" & Names(1)) = True Then + FileSystem.Rename(Console.CurrentDirectory & "\" & Names(1), Console.CurrentDirectory & "\" & Names(3)) + Else + NewLine("File is not exist") + End If + End If + End Sub +End Module