From e08f5e8e55a2c7061a638bba6428f6d9b495d4c7 Mon Sep 17 00:00:00 2001 From: EverythingWindows Date: Thu, 17 Nov 2022 10:56:11 +0700 Subject: [PATCH] Optimization on Intro Story --- .../Functions/InGame/IntroStoryTell.vb | 41 ++++++++++++ ShiftOS-TheRevival/MainForms/Console.vb | 65 ++++--------------- ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb | 1 + ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj | 1 + 4 files changed, 57 insertions(+), 51 deletions(-) create mode 100644 ShiftOS-TheRevival/Functions/InGame/IntroStoryTell.vb diff --git a/ShiftOS-TheRevival/Functions/InGame/IntroStoryTell.vb b/ShiftOS-TheRevival/Functions/InGame/IntroStoryTell.vb new file mode 100644 index 0000000..048b61f --- /dev/null +++ b/ShiftOS-TheRevival/Functions/InGame/IntroStoryTell.vb @@ -0,0 +1,41 @@ +Module IntroStoryTell + Public Sub StoryLineIntro(Timestamp As Integer) + Select Case Strings.ComputerInfo(3) + Case "0" + Select Case Timestamp + Case 5 + ResetLine("Connected to ") + Case 25 + NewLine(": Hey there, Unknown user!") + Case 60 + NewLine(": Congratulaions! You have been involuntarily selected for a test on my experimental operating system, ShiftOS.") + Case 125 + NewLine(": ShiftOS is an operating system that will evolve itself as you use it as I progressively add more features into ShiftOS.") + Case 160 + NewLine(": Currently ShiftOS isn't much from a basic command-line operating system.") + Case 210 + NewLine(": I don't wish to reveal my indentity at this point in time.") + Case 270 + NewLine(": I will install ShiftOS on your system once I leave while I work on... something else.") + Case 335 + NewLine(": Once you have ShiftOS rich feature enough, I will come back to you. In the mean time, goodbye!") + Case 400 + NewLine(" Disconnected") + Case 430 + ResetLine("Installing ShiftOS...") + Case 550 + ResetLine("ShiftOS Installed, The computer will restart in a few seconds") + Case 600 + Console.StoryOnlyTimer.Stop() + Console.TextBox1.Text = Nothing + Console.TextBox1.ReadOnly = False + Strings.ComputerInfo(0) = "shiftos" + Strings.ComputerInfo(1) = "user" + Console.CheckFeature() + Terminal_PrintPrompt() + Terminal_AssignPrompt() + TextRebind() + End Select + End Select + End Sub +End Module diff --git a/ShiftOS-TheRevival/MainForms/Console.vb b/ShiftOS-TheRevival/MainForms/Console.vb index 0e38d0e..048fdfa 100644 --- a/ShiftOS-TheRevival/MainForms/Console.vb +++ b/ShiftOS-TheRevival/MainForms/Console.vb @@ -1,19 +1,19 @@ Imports System.IO Public Class Console - Public TrackPos As Integer - Public DefaultPrompt As String - Public BadCommand As Boolean - Public DisplayStory As Integer - Public StoryToTell As String - Public ChangeInterpreter As Boolean = False - Public CurrentInterpreter As String = "terminal" - Public CurrentDirectory As String - Public Pseudodir As String - Public StayAtChapter As Boolean = False - Public ToolBarUse As Boolean = False - Public ReleaseCursor As Boolean = False - Public ShOSKey As String + Public TrackPos As Integer 'Tracking the position of the caret in order to not bypass the user@hostname string + Public DefaultPrompt As String 'Default prompt to display in ShiftOS, usually it's user@hostname + Public BadCommand As Boolean 'Detect if it's a bad command or not + Public DisplayStory As Integer 'Keep record for displaying the DevX's or other's monologue + Public StoryToTell As String 'Which chapter that you're going to be in + Public ChangeInterpreter As Boolean = False 'Default interpreter is Terminal, if it's changed to True, there'll be other program used by Console + Public CurrentInterpreter As String = "terminal" 'Shows what program is using Console + Public CurrentDirectory As String 'Current Directory for ShiftOS Explorer + Public Pseudodir As String 'Pseudo-directory for ShiftFS + Public StayAtChapter As Boolean = False 'If this set to true, then intro for chapters are mostly going to be in + Public ToolBarUse As Boolean = False 'Either any program is using ToolBar or not + Public ReleaseCursor As Boolean = False 'Release cursor from TrackPos + Public ShOSKey As String 'DOSKEY tracking string for ShiftOS Private Sub Console_Load(sender As Object, e As EventArgs) Handles MyBase.Load Console_Full() @@ -233,44 +233,7 @@ Public Class Console End Sub Private Sub StoryOnlyTimer_Tick(sender As Object, e As EventArgs) Handles StoryOnlyTimer.Tick - Select Case Strings.ComputerInfo(3) - Case "0" - Select Case DisplayStory - Case 5 - ResetLine("Connected to ") - Case 25 - NewLine(": Hey there, Unknown user!") - Case 60 - NewLine(": Congratulaions! You have been involuntarily selected for a test on my experimental operating system, ShiftOS.") - Case 125 - NewLine(": ShiftOS is an operating system that will evolve itself as you use it as I progressively add more features into ShiftOS.") - Case 160 - NewLine(": Currently ShiftOS isn't much from a basic command-line operating system.") - Case 210 - NewLine(": I don't wish to reveal my indentity at this point in time.") - Case 270 - NewLine(": I will install ShiftOS on your system once I leave while I work on... something else.") - Case 335 - NewLine(": Once you have ShiftOS rich feature enough, I will come back to you. In the mean time, goodbye!") - Case 400 - NewLine(" Disconnected") - Case 430 - ResetLine("Installing ShiftOS...") - Case 550 - ResetLine("ShiftOS Installed, The computer will restart in a few seconds") - Case 600 - StoryOnlyTimer.Stop() - TextBox1.Text = Nothing - TextBox1.ReadOnly = False - Strings.ComputerInfo(0) = "shiftos" - Strings.ComputerInfo(1) = "user" - CheckFeature() - Terminal_PrintPrompt() - Terminal_AssignPrompt() - TextBox1.Select(TextBox1.TextLength, 0) - TextBox1.ScrollToCaret() - End Select - End Select + StoryLineIntro(DisplayStory) DisplayStory = DisplayStory + 1 End Sub diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index e1e21ac..53f4fef 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -173,6 +173,7 @@ Public Class ShiftOSMenu Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\saved") File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt", My.Resources.CurrentVersion) End If + CheckUpdate() End If End Sub diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index cb0c8b3..400da4f 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -133,6 +133,7 @@ Form +