mirror of
https://github.com/EverythingWindows/ShiftOS-TheRevival-Old.git
synced 2025-01-22 18:02:16 +00:00
v0.2.2 stuff working on
This commit is contained in:
parent
003fd87c55
commit
37df7b5fd4
9 changed files with 152 additions and 25 deletions
|
@ -39,7 +39,8 @@ Public Class ShiftOSUpdater
|
|||
|
||||
End Sub
|
||||
|
||||
Private Sub Download_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles Download.DownloadProgressChanged
|
||||
ProgressBar1.Value = e.ProgressPercentage
|
||||
End Sub
|
||||
'Will revisit this later
|
||||
'Private Sub Download_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles Download.DownloadProgressChanged
|
||||
' ProgressBar1.Value = e.ProgressPercentage
|
||||
'End Sub
|
||||
End Class
|
|
@ -4,6 +4,7 @@
|
|||
Public Shared IsFree As Boolean
|
||||
Public Shared OnceInfo(0) As String
|
||||
Public Shared AvailableFeature(1) As String
|
||||
Public Shared CLIInterpreter As String
|
||||
|
||||
'STRING CATEGORIZATION WRITING RULES!
|
||||
'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS!
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,76 @@
|
|||
Module TerminalApps
|
||||
Public Sub AppHost(App As Object)
|
||||
Public ShouldChange As Boolean = False
|
||||
'This is for GTN's RAM
|
||||
Public TheNumber As Integer = 0
|
||||
|
||||
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)
|
||||
Select Case App
|
||||
Case "guess" 'Guess the Number
|
||||
Terminal.DefaultPrompt = "Your answer: "
|
||||
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Guess the Number" & Environment.NewLine & "Guess the correct number between 1 and 50 and you'll get anything between 1 to 5 Codepoints" & Environment.NewLine & "Type 'exit' to terminate this game"
|
||||
Terminal.CurrentInterpreter = "guess"
|
||||
GTN_GenerateNumber()
|
||||
ShouldChange = True
|
||||
End Select
|
||||
If ShouldChange = True Then
|
||||
Terminal.ChangeInterpreter = True
|
||||
ShouldChange = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub TerminateApp()
|
||||
Terminal.ChangeInterpreter = False
|
||||
Terminal.PrintPrompt()
|
||||
Terminal.AssignPrompt()
|
||||
End Sub
|
||||
|
||||
Public Sub DoChildCommand()
|
||||
Select Case Terminal.CurrentInterpreter
|
||||
Case "guess"
|
||||
Select Case Terminal.command
|
||||
Case "exit"
|
||||
TerminateApp()
|
||||
Case Else
|
||||
Try
|
||||
GTN_CheckNumber()
|
||||
Catch ex As Exception
|
||||
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Invalid value!"
|
||||
End Try
|
||||
End Select
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Public Sub GTN_GenerateNumber()
|
||||
Dim RandNum As New Random
|
||||
TheNumber = RandNum.Next(1, 51)
|
||||
End Sub
|
||||
|
||||
Public Sub GTN_CheckNumber()
|
||||
Dim TheirNumber As Integer = Convert.ToInt32(Terminal.command)
|
||||
If TheirNumber > 0 And TheirNumber < 51 Then
|
||||
If TheirNumber = TheNumber Then
|
||||
Dim GetCP As New Random
|
||||
Dim GotCP As Integer = GetCP.Next(1, 6)
|
||||
ChangeCP(True, GotCP)
|
||||
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "You are correct!, you got " & GotCP & " Codepoint(s)" & Environment.NewLine & "Guess the new number between 1 and 50."
|
||||
GTN_GenerateNumber()
|
||||
Else
|
||||
If TheirNumber < TheNumber Then
|
||||
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Higher!"
|
||||
ElseIf TheirNumber > TheNumber Then
|
||||
Terminal.TextBox1.Text = Terminal.TextBox1.Text & Environment.NewLine & "Lower!"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Module
|
||||
|
|
20
ShiftOS-TheRevival/My Project/Resources.Designer.vb
generated
20
ShiftOS-TheRevival/My Project/Resources.Designer.vb
generated
|
@ -70,12 +70,30 @@ Namespace My.Resources
|
|||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to 0.2.0.
|
||||
''' Looks up a localized string similar to 0.2.1.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property CurrentVersion() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("CurrentVersion", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Clears all contents of the terminal.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property man_clear() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("man_clear", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Shows the value of codepoint in your wallet.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property man_codepoint() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("man_codepoint", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
|
|
|
@ -124,4 +124,10 @@
|
|||
<data name="CurrentVersion" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\CurrentVersion.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="man_clear" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\man manuals\clear.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="man_codepoint" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\man manuals\codepoint.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
1
ShiftOS-TheRevival/Resources/man Manuals/clear.txt
Normal file
1
ShiftOS-TheRevival/Resources/man Manuals/clear.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Clears all contents of the terminal
|
1
ShiftOS-TheRevival/Resources/man Manuals/codepoint.txt
Normal file
1
ShiftOS-TheRevival/Resources/man Manuals/codepoint.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Shows the value of codepoint in your wallet
|
|
@ -195,6 +195,8 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\CurrentVersion.txt" />
|
||||
<Content Include="Resources\man Manuals\clear.txt" />
|
||||
<Content Include="Resources\man Manuals\codepoint.txt" />
|
||||
<Content Include="ShiftOS.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
|
|
Loading…
Reference in a new issue