aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/MainForms/Terminal.vb
diff options
context:
space:
mode:
authorEverythingWindows <[email protected]>2022-11-03 22:27:40 +0700
committerEverythingWindows <[email protected]>2022-11-03 22:27:40 +0700
commit37df7b5fd4830b6f508acf7bac13a4fa8d5bb5f4 (patch)
treea4f5166ec67b49cd9c4d3dc3d49c786823c81e97 /ShiftOS-TheRevival/MainForms/Terminal.vb
parent003fd87c55056e22ac01666cefce98f66d61307e (diff)
downloadshiftos-therevival-old-37df7b5fd4830b6f508acf7bac13a4fa8d5bb5f4.tar.gz
shiftos-therevival-old-37df7b5fd4830b6f508acf7bac13a4fa8d5bb5f4.tar.bz2
shiftos-therevival-old-37df7b5fd4830b6f508acf7bac13a4fa8d5bb5f4.zip
v0.2.2 stuff working on
Diffstat (limited to 'ShiftOS-TheRevival/MainForms/Terminal.vb')
-rw-r--r--ShiftOS-TheRevival/MainForms/Terminal.vb66
1 files changed, 46 insertions, 20 deletions
diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb
index 0df3815..ab7535a 100644
--- a/ShiftOS-TheRevival/MainForms/Terminal.vb
+++ b/ShiftOS-TheRevival/MainForms/Terminal.vb
@@ -8,6 +8,8 @@ Public Class Terminal
Public BadCommand As Boolean
Public DisplayStory As Integer
Public StoryToTell As String
+ Public ChangeInterpreter As Boolean = False
+ Public CurrentInterpreter As String = "Terminal"
Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormBorderStyle = FormBorderStyle.None
@@ -36,25 +38,35 @@ Public Class Terminal
Public Sub PrintPrompt()
If TextBox1.Text = Nothing Then
- If Strings.OnceInfo(0) = "Yes" Then
- TextBox1.Text = "root@" & Strings.ComputerInfo(0) & " #> "
+ If ChangeInterpreter = True Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
Else
- TextBox1.Text = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ If Strings.OnceInfo(0) = "Yes" Then
+ TextBox1.Text = "root@" & Strings.ComputerInfo(0) & " #> "
+ Else
+ TextBox1.Text = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ End If
End If
Else
- If Strings.OnceInfo(0) = "Yes" Then
- TextBox1.Text = TextBox1.Text & Environment.NewLine & "root@" & Strings.ComputerInfo(0) & " #> "
+ If ChangeInterpreter = True Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
Else
- TextBox1.Text = TextBox1.Text & Environment.NewLine & Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ If Strings.OnceInfo(0) = "Yes" Then
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & "root@" & Strings.ComputerInfo(0) & " #> "
+ Else
+ TextBox1.Text = TextBox1.Text & Environment.NewLine & Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ End If
End If
End If
End Sub
Public Sub AssignPrompt()
- If Strings.OnceInfo(0) = "Yes" Then
- DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> "
- Else
- DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ If ChangeInterpreter = False Then
+ If Strings.OnceInfo(0) = "Yes" Then
+ DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> "
+ Else
+ DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
+ End If
End If
End Sub
@@ -86,8 +98,11 @@ Public Class Terminal
AdvancedCommand = False
BadCommand = False
Case "guess"
- 'AppHost("gtn")
- Undeveloped()
+ ChangeInterpreter = True
+ AppHost("guess")
+ AdvancedCommand = False
+ BadCommand = False
+ 'Undeveloped()
Case "gimme"
Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2))
TempCP = TempCP + 50
@@ -149,13 +164,16 @@ Public Class Terminal
Dim mancommand As String = command.Replace("man ", "")
Dim TempUsage As String = "'" & mancommand & "' Usage: "
Select Case mancommand
+ 'In process to convert every command from printing from code to printing from text file
Case "clear"
- TempUsage = TempUsage & "clear"
- TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Clears all contents of the terminal" & Environment.NewLine
- BadCommand = False
+ If Strings.AvailableFeature(1) = "1" Then
+ TempUsage = TempUsage & "clear"
+ TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_clear & Environment.NewLine
+ BadCommand = False
+ End If
Case "codepoint"
TempUsage = TempUsage & "codepoint"
- TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Shows the value of codepoint in your wallet" & Environment.NewLine
+ TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_codepoint & Environment.NewLine
BadCommand = False
Case "help"
TempUsage = TempUsage & "help"
@@ -284,17 +302,25 @@ Public Class Terminal
If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True
ReadCommand()
- DoCommand()
-
- If command = "clear" Then
+ If ChangeInterpreter = True Then
+ DoChildCommand()
PrintPrompt()
TextBox1.Select(TextBox1.Text.Length, 0)
-
Else
+ DoCommand()
PrintPrompt()
TextBox1.Select(TextBox1.Text.Length, 0)
End If
+ 'If command = "clear" Then
+ ' PrintPrompt()
+ ' TextBox1.Select(TextBox1.Text.Length, 0)
+
+ 'Else
+ ' PrintPrompt()
+ ' TextBox1.Select(TextBox1.Text.Length, 0)
+ 'End If
+
TrackPos = 0
Else
If e.KeyCode = Keys.Back Then