From ec630f54d67fa37e0ad79936c3eaf9cf1cd2ac1f Mon Sep 17 00:00:00 2001 From: EverythingWindows Date: Thu, 3 Nov 2022 04:28:19 +0700 Subject: [PATCH] story mode completed --- .../MainForms/IntroStory.Designer.vb | 48 +++++++ ShiftOS-TheRevival/MainForms/IntroStory.resx | 123 ++++++++++++++++++ ShiftOS-TheRevival/MainForms/IntroStory.vb | 35 +++++ .../MainForms/ShiftOSMenu.Designer.vb | 2 + ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb | 5 +- ShiftOS-TheRevival/MainForms/Strings.vb | 4 +- .../MainForms/Terminal.Designer.vb | 12 +- ShiftOS-TheRevival/MainForms/Terminal.resx | 3 + ShiftOS-TheRevival/MainForms/Terminal.vb | 76 +++++++++-- ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj | 9 ++ 10 files changed, 300 insertions(+), 17 deletions(-) create mode 100644 ShiftOS-TheRevival/MainForms/IntroStory.Designer.vb create mode 100644 ShiftOS-TheRevival/MainForms/IntroStory.resx create mode 100644 ShiftOS-TheRevival/MainForms/IntroStory.vb diff --git a/ShiftOS-TheRevival/MainForms/IntroStory.Designer.vb b/ShiftOS-TheRevival/MainForms/IntroStory.Designer.vb new file mode 100644 index 0000000..73034d8 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/IntroStory.Designer.vb @@ -0,0 +1,48 @@ + +Partial Class IntroStory + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Me.OpacityPlay = New System.Windows.Forms.Timer(Me.components) + Me.SuspendLayout() + ' + 'OpacityPlay + ' + ' + 'IntroStory + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.White + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Name = "IntroStory" + Me.ShowIcon = False + Me.ShowInTaskbar = False + Me.Text = "IntroStory" + Me.TopMost = True + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents OpacityPlay As Timer +End Class diff --git a/ShiftOS-TheRevival/MainForms/IntroStory.resx b/ShiftOS-TheRevival/MainForms/IntroStory.resx new file mode 100644 index 0000000..91269ce --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/IntroStory.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/IntroStory.vb b/ShiftOS-TheRevival/MainForms/IntroStory.vb new file mode 100644 index 0000000..f7d30d9 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/IntroStory.vb @@ -0,0 +1,35 @@ +Public Class IntroStory + Dim TimerDisplay As Integer = 1 + Private Sub IntroStory_Load(sender As Object, e As EventArgs) Handles MyBase.Load + FormBorderStyle = FormBorderStyle.None + WindowState = FormWindowState.Maximized + OpacityPlay.Start() + End Sub + + Private Sub OpacityPlay_Tick(sender As Object, e As EventArgs) Handles OpacityPlay.Tick + Select Case TimerDisplay + Case 1, 5, 9, 13, 17 + Visible = True + TimerDisplay = TimerDisplay + 1 + Case 3, 7, 11, 15, 19 + Visible = False + TimerDisplay = TimerDisplay + 1 + Case 21 + BackColor = Color.Black + Visible = True + Opacity = 0.1 + TimerDisplay = 22 + Case 22 + If Opacity = 1 Then + Strings.ComputerInfo(3) = "0" + Strings.IsFree = False + Terminal.Show() + Close() + Else + Opacity = Opacity + 0.05 + End If + Case Else + TimerDisplay = TimerDisplay + 1 + End Select + End Sub +End Class \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb index 71ba185..a613e25 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb @@ -134,9 +134,11 @@ Partial Class ShiftOSMenu Me.Controls.Add(Me.btn_Aboot) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.Name = "ShiftOSMenu" Me.ShowIcon = False + Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Main Menu" CType(Me.Thumbnail, System.ComponentModel.ISupportInitialize).EndInit() diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index 167da32..bd1edb2 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -57,7 +57,10 @@ Public Class ShiftOSMenu btn_Aboot.Text = "Back" btn_Exit.Visible = False Case "New Game" - MsgBox("This feature is in development") + Strings.IsFree = False + MsgBox("This feature is in development, be sure to watch out for bugs") + IntroStory.Show() + Close() End Select End Sub diff --git a/ShiftOS-TheRevival/MainForms/Strings.vb b/ShiftOS-TheRevival/MainForms/Strings.vb index fe3f311..593a40b 100644 --- a/ShiftOS-TheRevival/MainForms/Strings.vb +++ b/ShiftOS-TheRevival/MainForms/Strings.vb @@ -1,9 +1,8 @@ Public Class Strings Public Shared OSInfo() As String - Public Shared ComputerInfo(2) As String + Public Shared ComputerInfo(3) As String Public Shared IsFree As Boolean Public Shared OnceInfo(0) As String - Public Shared StoryChapter As Integer Public Shared AvailableFeature(1) As String 'STRING CATEGORIZATION WRITING RULES! @@ -32,6 +31,7 @@ '0 = Computer Name (0.1) (default : shiftos) '1 = Username (0.1) (default : user) '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: '0 = MAN command [Manual on each command] (0.2) (default : 0) diff --git a/ShiftOS-TheRevival/MainForms/Terminal.Designer.vb b/ShiftOS-TheRevival/MainForms/Terminal.Designer.vb index 5dec2f5..a29a92e 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class Terminal Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,9 +20,11 @@ Partial Class Terminal 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.StoryOnlyTimer = New System.Windows.Forms.Timer(Me.components) Me.SuspendLayout() ' 'TextBox1 @@ -38,6 +40,9 @@ Partial Class Terminal Me.TextBox1.Size = New System.Drawing.Size(800, 450) Me.TextBox1.TabIndex = 0 ' + 'StoryOnlyTimer + ' + ' 'Terminal ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -52,4 +57,5 @@ Partial Class Terminal End Sub Friend WithEvents TextBox1 As TextBox + Friend WithEvents StoryOnlyTimer As Timer End Class diff --git a/ShiftOS-TheRevival/MainForms/Terminal.resx b/ShiftOS-TheRevival/MainForms/Terminal.resx index 1af7de1..dd16740 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.resx +++ b/ShiftOS-TheRevival/MainForms/Terminal.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/Terminal.vb b/ShiftOS-TheRevival/MainForms/Terminal.vb index 368b745..0df3815 100644 --- a/ShiftOS-TheRevival/MainForms/Terminal.vb +++ b/ShiftOS-TheRevival/MainForms/Terminal.vb @@ -1,9 +1,13 @@ -Public Class Terminal +Imports System.IO + +Public Class Terminal Public command As String Public DefaultPrompt As String Public TrackPos As Integer Public AdvancedCommand As Boolean Public BadCommand As Boolean + Public DisplayStory As Integer + Public StoryToTell As String Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load FormBorderStyle = FormBorderStyle.None @@ -15,7 +19,16 @@ PrintPrompt() AssignPrompt() Else - + If Strings.ComputerInfo(3) = "0" Then + TextBox1.ReadOnly = True + StoryOnlyTimer.Start() + Else + Strings.ComputerInfo(0) = "shiftos" + Strings.ComputerInfo(1) = "user" + Strings.ComputerInfo(2) = 0 + PrintPrompt() + AssignPrompt() + End If End If TextBox1.Select(TextBox1.TextLength, 0) TextBox1.ScrollToCaret() @@ -215,17 +228,17 @@ 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 - End If - AdvancedCommand = False + 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 End If + AdvancedCommand = False + End If - If BadCommand = True Then + If BadCommand = True Then TextBox1.Text = TextBox1.Text & Environment.NewLine & "Bad command or wrong file name" End If End Sub @@ -310,4 +323,45 @@ TextBox1.Select(TextBox1.TextLength, 0) TextBox1.ScrollToCaret() 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 + TextBox1.Text = "Connected to " + Case 25 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": Hey there, Unknown user!" + Case 40 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": You have been selected for an unvolentary test on my experimental operating system, ShiftOS" + Case 90 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": ShiftOS is an operating system that purposes itself to evolve itself as the time progresses" + Case 140 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": I will add features into the operating system as you use it" + Case 170 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": Currently ShiftOS didn't have that much function aside from a command line with little command" + Case 190 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": I'll install ShiftOS now on your system" + Case 215 + TextBox1.Text = TextBox1.Text & Environment.NewLine & ": I will come back and contact you later on when the time is necessary, see you!" + Case 250 + TextBox1.Text = TextBox1.Text & Environment.NewLine & " Disconnected" + Case 275 + TextBox1.Text = "Installing ShiftOS..." + Case 350 + TextBox1.Text = "ShiftOS Installed, The computer will restart in a few seconds" + Case 400 + TextBox1.Text = Nothing + TextBox1.ReadOnly = False + Strings.ComputerInfo(0) = "shiftos" + Strings.ComputerInfo(1) = "user" + Strings.ComputerInfo(2) = 0 + PrintPrompt() + AssignPrompt() + TextBox1.Select(TextBox1.TextLength, 0) + TextBox1.ScrollToCaret() + End Select + End Select + DisplayStory = DisplayStory + 1 + End Sub End Class \ No newline at end of file diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index 10cec8a..0c96be9 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -99,6 +99,12 @@ Form + + IntroStory.vb + + + Form + Form @@ -136,6 +142,9 @@ BugSlap.vb + + IntroStory.vb + Terminal.vb