v0.2.2 stuff working on

This commit is contained in:
EverythingWindows 2022-11-03 22:27:40 +07:00
parent 003fd87c55
commit 37df7b5fd4
9 changed files with 152 additions and 25 deletions

View file

@ -39,7 +39,8 @@ Public Class ShiftOSUpdater
End Sub End Sub
Private Sub Download_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles Download.DownloadProgressChanged 'Will revisit this later
ProgressBar1.Value = e.ProgressPercentage 'Private Sub Download_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles Download.DownloadProgressChanged
End Sub ' ProgressBar1.Value = e.ProgressPercentage
'End Sub
End Class End Class

View file

@ -4,6 +4,7 @@
Public Shared IsFree As Boolean Public Shared IsFree As Boolean
Public Shared OnceInfo(0) As String Public Shared OnceInfo(0) As String
Public Shared AvailableFeature(1) As String Public Shared AvailableFeature(1) As String
Public Shared CLIInterpreter As String
'STRING CATEGORIZATION WRITING RULES! 'STRING CATEGORIZATION WRITING RULES!
'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS! 'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS!

View file

@ -8,6 +8,8 @@ Public Class Terminal
Public BadCommand As Boolean Public BadCommand As Boolean
Public DisplayStory As Integer Public DisplayStory As Integer
Public StoryToTell As String 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 Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormBorderStyle = FormBorderStyle.None FormBorderStyle = FormBorderStyle.None
@ -36,25 +38,35 @@ Public Class Terminal
Public Sub PrintPrompt() Public Sub PrintPrompt()
If TextBox1.Text = Nothing Then If TextBox1.Text = Nothing Then
If Strings.OnceInfo(0) = "Yes" Then If ChangeInterpreter = True Then
TextBox1.Text = "root@" & Strings.ComputerInfo(0) & " #> " TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
Else 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 End If
Else Else
If Strings.OnceInfo(0) = "Yes" Then If ChangeInterpreter = True Then
TextBox1.Text = TextBox1.Text & Environment.NewLine & "root@" & Strings.ComputerInfo(0) & " #> " TextBox1.Text = TextBox1.Text & Environment.NewLine & DefaultPrompt
Else 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 If End If
End Sub End Sub
Public Sub AssignPrompt() Public Sub AssignPrompt()
If Strings.OnceInfo(0) = "Yes" Then If ChangeInterpreter = False Then
DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> " If Strings.OnceInfo(0) = "Yes" Then
Else DefaultPrompt = "root@" & Strings.ComputerInfo(0) & " #> "
DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> " Else
DefaultPrompt = Strings.ComputerInfo(1) & "@" & Strings.ComputerInfo(0) & " $> "
End If
End If End If
End Sub End Sub
@ -86,8 +98,11 @@ Public Class Terminal
AdvancedCommand = False AdvancedCommand = False
BadCommand = False BadCommand = False
Case "guess" Case "guess"
'AppHost("gtn") ChangeInterpreter = True
Undeveloped() AppHost("guess")
AdvancedCommand = False
BadCommand = False
'Undeveloped()
Case "gimme" Case "gimme"
Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2)) Dim TempCP As Integer = Convert.ToInt32(Strings.ComputerInfo(2))
TempCP = TempCP + 50 TempCP = TempCP + 50
@ -149,13 +164,16 @@ Public Class Terminal
Dim mancommand As String = command.Replace("man ", "") Dim mancommand As String = command.Replace("man ", "")
Dim TempUsage As String = "'" & mancommand & "' Usage: " Dim TempUsage As String = "'" & mancommand & "' Usage: "
Select Case mancommand Select Case mancommand
'In process to convert every command from printing from code to printing from text file
Case "clear" Case "clear"
TempUsage = TempUsage & "clear" If Strings.AvailableFeature(1) = "1" Then
TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & "Clears all contents of the terminal" & Environment.NewLine TempUsage = TempUsage & "clear"
BadCommand = False TextBox1.Text = TextBox1.Text & TempUsage & Environment.NewLine & Environment.NewLine & My.Resources.man_clear & Environment.NewLine
BadCommand = False
End If
Case "codepoint" Case "codepoint"
TempUsage = TempUsage & "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 BadCommand = False
Case "help" Case "help"
TempUsage = TempUsage & "help" TempUsage = TempUsage & "help"
@ -284,17 +302,25 @@ Public Class Terminal
If e.KeyCode = Keys.Enter Then If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True e.SuppressKeyPress = True
ReadCommand() ReadCommand()
DoCommand() If ChangeInterpreter = True Then
DoChildCommand()
If command = "clear" Then
PrintPrompt() PrintPrompt()
TextBox1.Select(TextBox1.Text.Length, 0) TextBox1.Select(TextBox1.Text.Length, 0)
Else Else
DoCommand()
PrintPrompt() PrintPrompt()
TextBox1.Select(TextBox1.Text.Length, 0) TextBox1.Select(TextBox1.Text.Length, 0)
End If 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 TrackPos = 0
Else Else
If e.KeyCode = Keys.Back Then If e.KeyCode = Keys.Back Then

View file

@ -1,5 +1,76 @@
Module TerminalApps 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 Sub
End Module End Module

View file

@ -70,12 +70,30 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to 0.2.0. ''' Looks up a localized string similar to 0.2.1.
'''</summary> '''</summary>
Friend ReadOnly Property CurrentVersion() As String Friend ReadOnly Property CurrentVersion() As String
Get Get
Return ResourceManager.GetString("CurrentVersion", resourceCulture) Return ResourceManager.GetString("CurrentVersion", resourceCulture)
End Get End Get
End Property 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 Module
End Namespace End Namespace

View file

@ -124,4 +124,10 @@
<data name="CurrentVersion" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\CurrentVersion.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data> </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> </root>

View file

@ -0,0 +1 @@
Clears all contents of the terminal

View file

@ -0,0 +1 @@
Shows the value of codepoint in your wallet

View file

@ -195,6 +195,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Resources\CurrentVersion.txt" /> <None Include="Resources\CurrentVersion.txt" />
<Content Include="Resources\man Manuals\clear.txt" />
<Content Include="Resources\man Manuals\codepoint.txt" />
<Content Include="ShiftOS.ico" /> <Content Include="ShiftOS.ico" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />