diff options
Diffstat (limited to 'ShiftOS-TheRevival/MainForms')
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/SaveLoadSystem.vb | 24 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb | 6 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/Shiftoriums.vb | 147 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/Strings.vb | 9 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/Terminal.vb | 112 |
5 files changed, 209 insertions, 89 deletions
diff --git a/ShiftOS-TheRevival/MainForms/SaveLoadSystem.vb b/ShiftOS-TheRevival/MainForms/SaveLoadSystem.vb new file mode 100644 index 0000000..0499d5b --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/SaveLoadSystem.vb @@ -0,0 +1,24 @@ +Module SaveLoadSystem + + Public Sub NewGameMode() + Strings.AvailableFeature(0) = "0" + Strings.AvailableFeature(1) = "0" + Strings.AvailableFeature(2) = "2" + Strings.AvailableFeature(3) = "2" + End Sub + + Public Sub FreeRoamMode() + Strings.AvailableFeature(0) = "1" + Strings.AvailableFeature(1) = "1" + Strings.AvailableFeature(2) = "1" + Strings.AvailableFeature(3) = "1" + End Sub + + Public Sub GodMode() + Strings.ComputerInfo(2) = 9999 + Strings.AvailableFeature(0) = "0" + Strings.AvailableFeature(1) = "0" + Strings.AvailableFeature(2) = "2" + Strings.AvailableFeature(3) = "2" + End Sub +End Module diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index 156e353..029a662 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -35,8 +35,7 @@ Public Class ShiftOSMenu Case "Free Roam Mode" Try Strings.IsFree = True - Strings.AvailableFeature(0) = "0" - Strings.AvailableFeature(1) = "0" + FreeRoamMode() Terminal.Show() Close() Catch ex As Exception @@ -107,8 +106,7 @@ Public Class ShiftOSMenu Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click If Label2.Text = "Debug it your way" Then Strings.IsFree = True - Strings.AvailableFeature(0) = "0" - Strings.AvailableFeature(1) = "0" + GodMode() Terminal.Show() Close() End If diff --git a/ShiftOS-TheRevival/MainForms/Shiftoriums.vb b/ShiftOS-TheRevival/MainForms/Shiftoriums.vb index 5beb371..595c1ac 100644 --- a/ShiftOS-TheRevival/MainForms/Shiftoriums.vb +++ b/ShiftOS-TheRevival/MainForms/Shiftoriums.vb @@ -1,31 +1,132 @@ Module Shiftoriums - Public Sub InstallFeature(IsCLI As Boolean, Feature As String, Codepoint As Integer) + Public prompt As String + + Public Sub Shiftorium_ListFeatures() + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium Available Feature(s)" & Environment.NewLine + If Strings.AvailableFeature(0) = "0" Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "ShiftOS Help Manual (man | 20 CP)" + End If + If Strings.AvailableFeature(1) = "0" Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Clear Terminal Screen (clear | 25 CP)" + Else + If Strings.AvailableFeature(2) = "0" Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Print Terminal Screen (print | 30 CP)" + Else + If Strings.AvailableFeature(3) = "0" Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Terminal Display Driver (termdspdrv | 50 CP)" + End If + End If + End If + End Sub + + Public Sub Shiftorium_InformationFeatures() + 'ManHeader is for the ShiftOS Help Manual header and the 'Cost' footer, kinda like template-ish + Dim ManHeader(1) As String + 'ManHeader(0) = Insert any feature here for the Case prompt + ManHeader(1) = "Cost: " + Select Case prompt + Case "man" + If Strings.AvailableFeature(0) = "0" Then + ManHeader(0) = "ShiftOS Help Manual (command: man)" + ManHeader(1) = "20 CP" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Shows up any further help instruction on each command, its corresponding action and its example if necessary" & Environment.NewLine & Environment.NewLine & ManHeader(1) + Terminal.BadCommand = False + End If + Case "clear" + If Strings.AvailableFeature(1) = "0" Then + ManHeader(0) = "Clear Terminal Screen (command: clear)" + ManHeader(1) = "25 CP" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Clears the terminal screen" & Environment.NewLine & Environment.NewLine & ManHeader(1) + Terminal.BadCommand = False + End If + Case "print" + If Strings.AvailableFeature(2) = "0" Then + ManHeader(0) = "Print Command (command: print)" + ManHeader(1) = "30 CP" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Prints a corresponding text entered in the command" & Environment.NewLine & Environment.NewLine & ManHeader(1) + Terminal.BadCommand = False + End If + Case "termdspdrv" + If Strings.AvailableFeature(3) = "0" Then + ManHeader(0) = "Terminal Display Driver" + ManHeader(1) = "50 CP" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Display driver for ShiftOS' Terminal to utilize advantages such as Infobar, ASCII-based applications" & Environment.NewLine & Environment.NewLine & ManHeader(1) + Terminal.BadCommand = False + End If + Case Else + Terminal.BadCommand = False + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Bad command or not available" + End Select + End Sub + + Public Sub Shiftorium_DetectInstallFeatures() + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Installing feature..." + Select Case prompt + Case "man" + Shiftorium_InstallFeatures(True, "man", 0, 20) + Terminal.BadCommand = False + Case "clear" + Shiftorium_InstallFeatures(True, "clear", 1, 25) + Terminal.BadCommand = False + Case "print" + Shiftorium_InstallFeatures(True, "print", 2, 30) + Terminal.BadCommand = False + Case "termdspdrv" + Shiftorium_InstallFeatures(True, "termdspdrv", 3, 50) + Terminal.BadCommand = False + Case Else + Terminal.BadCommand = False + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Bad command or not available" + End Select + End Sub + + Public Sub Shiftorium_InstallFeatures(IsCLI As Boolean, Feature As String, FeatureRow As Integer, Codepoint As Integer) Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2)) - If TempCP >= Codepoint Then - Dim success As Boolean = False - Select Case Feature - Case "man" - Strings.AvailableFeature(0) = "1" - success = True - Case "clear" - Strings.AvailableFeature(1) = "1" - success = True - End Select - If success = False Then + Select Case Strings.AvailableFeature(FeatureRow) + Case "0" + If TempCP >= Codepoint Then + Dim success As Boolean = False + Select Case Feature + Case "man" + Strings.AvailableFeature(0) = "1" + success = True + Case "clear" + Strings.AvailableFeature(1) = "1" + Strings.AvailableFeature(2) = "0" + success = True + Case "print" + Strings.AvailableFeature(2) = "1" + Strings.AvailableFeature(3) = "0" + success = True + Case "termdspdrv" + Strings.AvailableFeature(3) = "1" + 'Strings.AvailableFeature(3) = "0" + success = True + End Select + If success = False Then + If IsCLI = True Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Invalid command or feature already installed" + End If + Else + TempCP = TempCP - Codepoint + Strings.ComputerInfo(2) = Convert.ToString(TempCP) + If IsCLI = True Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Feature has been install succesfully" + End If + End If + Else + If IsCLI = True Then + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Insufficent Codepoint" + End If + End If + Case "1" If IsCLI = True Then - Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Invalid command or feature already installed" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Feature has already been installed" End If - Else - TempCP = TempCP - Codepoint - Strings.ComputerInfo(2) = Convert.ToString(TempCP) + Case "2" If IsCLI = True Then - Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Feature has been install succesfully" + Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Feature is not available" End If - End If - Else - If IsCLI = True Then - Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Shiftorium: Insufficent Codepoint" - End If - End If + End Select End Sub End Module diff --git a/ShiftOS-TheRevival/MainForms/Strings.vb b/ShiftOS-TheRevival/MainForms/Strings.vb index a75546e..cead842 100644 --- a/ShiftOS-TheRevival/MainForms/Strings.vb +++ b/ShiftOS-TheRevival/MainForms/Strings.vb @@ -3,8 +3,9 @@ Public Shared ComputerInfo(3) As String Public Shared IsFree As Boolean Public Shared OnceInfo(0) As String - Public Shared AvailableFeature(1) As String + Public Shared AvailableFeature(3) As String Public Shared CLIInterpreter As String + Public Shared SaveFile As String 'STRING CATEGORIZATION WRITING RULES! 'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS! @@ -34,11 +35,15 @@ '2 = Codepoint (0.2) (default : 0) '3 = Story Chapter (0.2) (default : 0 for New Game) ' - 'AvailableFeature (Default is defined on the Story Mode, Free Mode automatically assigns every available feature to 1)Strings: + 'AvailableFeature (Default is defined on the Story Mode, Free Mode automatically assigns every available feature to 1, Unavailable in the Shiftorium assigned as 2) Strings: '0 = MAN command [Manual on each command] (0.2) (default : 0) '1 = CLEAR command [Clearing the screen] (0.2) (default : 0) + '2 = PRINT command [Printing a string] (0.2.2) (default : 0) + '3 = Terminal Display Driver [Dependencies for advanced terminal applications] (0.2.2) (default : 0) ' 'Features bought hierarchy : 'ShiftOS Help Manual (MAN) (20 CP) 'Terminal Clear (CLEAR) (25 CP) + '>Terminal Print (PRINT) (30 CP) + '>>Terminal Display Driver (50 CP) End Class diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb index ab7535a..1f11e9e 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.vb @@ -17,7 +17,7 @@ Public Class Terminal If Strings.IsFree = True Then Strings.ComputerInfo(0) = "shiftos" Strings.ComputerInfo(1) = "user" - Strings.ComputerInfo(2) = 0 + 'Strings.ComputerInfo(2) = 0 PrintPrompt() AssignPrompt() Else @@ -119,11 +119,15 @@ Public Class Terminal TextBox1.Text = TextBox1.Text & Environment.NewLine & "CLEAR Clear the terminal" End If TextBox1.Text = TextBox1.Text & Environment.NewLine & "CODEPOINT Display Codepoint(s) from your wallet" + TextBox1.Text = TextBox1.Text & Environment.NewLine & "GUESS Runs 'Guess the Number' application" TextBox1.Text = TextBox1.Text & Environment.NewLine & "HELP Shows all commands available and its corresponding action" If Strings.AvailableFeature(0) = 1 Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "MAN Shows a command, its corresponding action, and its example usage" End If - TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHIFTORIUM Terminate ShiftOS session" + If Strings.AvailableFeature(2) = 1 Then + TextBox1.Text = TextBox1.Text & Environment.NewLine & "PRINT Prints a corresponding text entered in the command" + End If + TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHIFTORIUM A software center for upgrading features on ShiftOS" TextBox1.Text = TextBox1.Text & Environment.NewLine & "SHUTDOWN Terminate ShiftOS session" TextBox1.Text = TextBox1.Text & Environment.NewLine & "SU Runs terminal as super user" TextBox1.Text = TextBox1.Text & Environment.NewLine & "VER Printing current version of ShiftOS TheRevival" @@ -143,7 +147,7 @@ Public Class Terminal ShiftOSMenu.Show() Close() Case "ver" - TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version 0.1.1" + TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version " & My.Resources.CurrentVersion AdvancedCommand = False BadCommand = False End Select @@ -175,21 +179,37 @@ Public Class Terminal TempUsage = TempUsage & "codepoint" TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_codepoint & Environment.NewLine BadCommand = False + Case "guess" + TempUsage = TempUsage & "guess" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_guess & Environment.NewLine + BadCommand = False Case "help" TempUsage = TempUsage & "help" - TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Shows all commands available in the terminal and its brief explanation of action" & Environment.NewLine + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_help & Environment.NewLine BadCommand = False Case "man" - TempUsage = TempUsage & "man [command]" - TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Shows up a manual on each corresponding command and its example of action" & Environment.NewLine & Environment.NewLine & "[COMMAND] Any command that you want to get the manual for" & Environment.NewLine & Environment.NewLine & "Example: man help" + If Strings.AvailableFeature(0) = "1" Then + TempUsage = TempUsage & "man [command]" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_man & Environment.NewLine + BadCommand = False + End If + Case "print" + If Strings.AvailableFeature(2) = "1" Then + TempUsage = TempUsage & "print [text]" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_print & Environment.NewLine + BadCommand = False + End If + Case "shiftorium" + TempUsage = TempUsage & "shiftorium [option] [featureName]" + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shiftorium & Environment.NewLine BadCommand = False Case "shutdown" TempUsage = TempUsage & "shutdown" - TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Terminate ShiftOS session" & Environment.NewLine + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_shutdown & Environment.NewLine BadCommand = False Case "ver" TempUsage = TempUsage & "ver" - TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Displays current version of ShiftOS TheRevival" & Environment.NewLine + TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_ver & Environment.NewLine BadCommand = False Case Else TextBox1.Text = TextBox1.Text & Environment.NewLine & "MAN : Invalid command" @@ -200,58 +220,26 @@ Public Class Terminal Dim prompt As String = command.Replace("shiftorium ", "") TextBox1.Text = TextBox1.Text & Environment.NewLine & "Shiftorium ShiftOS Center" If prompt Like "info *" Then - prompt = command.Replace("shiftorium info ", "") - 'ManHeader is for the ShiftOS Help Manual header and the 'Cost' footer, kinda like template-ish - Dim ManHeader(1) As String - 'ManHeader(0) = Insert any feature here for the Case prompt - ManHeader(1) = "Cost: " - Select Case prompt - Case "man" - ManHeader(0) = "ShiftOS Help Manual (command: man)" - ManHeader(1) = "20 CP" - TextBox1.Text = TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Shows up any further help instruction on each command, its corresponding action and its example if necessary" & Environment.NewLine & Environment.NewLine & ManHeader(1) - BadCommand = False - Case "clear" - ManHeader(0) = "Clear Terminal Screen (command: clear)" - ManHeader(1) = "25 CP" - TextBox1.Text = TextBox1.Text & Environment.NewLine & ManHeader(0) & Environment.NewLine & Environment.NewLine & "Clears the terminal screen" & Environment.NewLine & Environment.NewLine & ManHeader(1) - BadCommand = False - Case Else - BadCommand = False - TextBox1.Text = TextBox1.Text & Environment.NewLine & "Shiftorium: Bad command or not available" - End Select + Shiftoriums.prompt = command.Replace("shiftorium info ", "") + Shiftorium_InformationFeatures() End If If prompt Like "install *" Then - prompt = command.Replace("shiftorium install ", "") - Select Case prompt - Case "man" - InstallFeature(True, "man", 20) - BadCommand = False - Case "clear" - InstallFeature(True, "clear", 25) - BadCommand = False - Case Else - BadCommand = False - TextBox1.Text = TextBox1.Text & Environment.NewLine & "Shiftorium: Bad command or not available" - End Select + Shiftoriums.prompt = command.Replace("shiftorium install ", "") + Shiftorium_DetectInstallFeatures() End If If prompt = "list" Then - TextBox1.Text = TextBox1.Text & Environment.NewLine & "Shiftorium Available Feature(s)" & Environment.NewLine - If Strings.AvailableFeature(0) = "0" Then - TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS Help Manual (20 CP)" - End If - If Strings.AvailableFeature(1) = "0" Then - TextBox1.Text = TextBox1.Text & Environment.NewLine & "Clear Terminal Screen (25 CP)" - End If + Shiftorium_ListFeatures() BadCommand = False End If End If If command Like "print *" Then - TextBox1.Text = TextBox1.Text & Environment.NewLine & command.Substring(6) - Dim printed As String = command.Replace("print ", "") - ''It has the same issue, only displays in lowercase - 'TextBox1.Text = TextBox1.Text & Environment.NewLine & printed - BadCommand = False + If Strings.AvailableFeature(2) = "1" Then + TextBox1.Text = TextBox1.Text & Environment.NewLine & command.Substring(6) + Dim printed As String = command.Replace("print ", "") + ''It has the same issue, only displays in lowercase + 'TextBox1.Text = TextBox1.Text & Environment.NewLine & printed + BadCommand = False + End If End If AdvancedCommand = False End If @@ -301,15 +289,19 @@ Public Class Terminal If e.KeyCode = Keys.Enter Then e.SuppressKeyPress = True - ReadCommand() - If ChangeInterpreter = True Then - DoChildCommand() - PrintPrompt() - TextBox1.Select(TextBox1.Text.Length, 0) + If TextBox1.ReadOnly = True Then + Else - DoCommand() - PrintPrompt() - TextBox1.Select(TextBox1.Text.Length, 0) + ReadCommand() + If ChangeInterpreter = True Then + DoChildCommand() + PrintPrompt() + TextBox1.Select(TextBox1.Text.Length, 0) + Else + DoCommand() + PrintPrompt() + TextBox1.Select(TextBox1.Text.Length, 0) + End If End If 'If command = "clear" Then |
