2022-11-01 04:27:02 -04:00
Imports System . IO
2022-11-01 21:52:31 -04:00
Public Class ShiftOSMenu
2022-11-01 04:27:02 -04:00
Public Shared ActualBuildLab As String
Public Shared BuildLab ( ) As String
2022-11-05 12:48:35 -04:00
Public Shared BannerUse As Integer = 1
Public Shared TimeToChange
2022-11-05 20:21:26 -04:00
Public Shared ShouldUpdate As Boolean = False
2022-11-01 04:27:02 -04:00
Private Sub Form1_Load ( sender As Object , e As EventArgs ) Handles MyBase . Load
2022-11-06 06:45:00 -05:00
CheckInstall ( )
2022-11-14 00:11:31 -05:00
lbl_BuildString . Text = My . Resources . CurrentVersion
2022-11-05 12:48:35 -04:00
BannerChange . Start ( )
2022-11-01 04:27:02 -04:00
End Sub
Private Sub btn_Exit_Click ( sender As Object , e As EventArgs ) Handles btn_Exit . Click
2022-11-08 01:02:02 -05:00
Select Case btn_Exit . Text
Case " Exit "
2022-11-21 17:42:55 -05:00
'Close()
Application . Exit ( )
2022-11-08 01:02:02 -05:00
End Select
2022-11-01 04:27:02 -04:00
End Sub
2022-11-01 08:48:52 -04:00
Private Sub btn_FreeRoam_Click ( sender As Object , e As EventArgs ) Handles btn_FreeRoam . Click
2022-11-02 00:17:14 -04:00
Select Case btn_FreeRoam . Text
Case " Free Roam Mode "
Try
Strings . IsFree = True
2022-11-06 06:45:00 -05:00
Strings . OnceInfo ( 6 ) = " free "
2022-11-23 09:30:54 -05:00
IsConsoleParent = True
2022-11-03 21:56:41 -04:00
FreeRoamMode ( )
2022-11-13 03:15:05 -05:00
Console . Show ( )
2022-11-02 00:17:14 -04:00
Close ( )
Catch ex As Exception
Dim NewBugSlap As New BugSlap
NewBugSlap . Show ( )
NewBugSlap . TextBox1 . Text = ex . Message
Close ( )
End Try
Case " Continue "
2022-11-06 06:45:00 -05:00
Strings . IsFree = False
Strings . OnceInfo ( 6 ) = " story "
2022-11-23 09:30:54 -05:00
IsConsoleParent = True
StayAtChapter = True
2022-11-13 03:15:05 -05:00
Console . Show ( )
2022-11-06 06:45:00 -05:00
Close ( )
2022-11-07 07:22:19 -05:00
Case " No "
Label3 . Visible = False
btn_StoryMode . Text = " Story Mode "
btn_FreeRoam . Text = " Free Roam Mode "
btn_Aboot . Text = " About "
btn_Aboot . Visible = True
btn_Exit . Visible = True
2022-11-27 08:58:48 -05:00
Case " Chapter 2 " & Environment . NewLine & " Exploration "
Strings . ComputerInfo ( 3 ) = " 1 "
IsConsoleParent = True
Strings . IsFree = False
Strings . OnceInfo ( 6 ) = " story "
NewGameMode ( 1 )
Console . Show ( )
Close ( )
2022-11-02 00:17:14 -04:00
End Select
End Sub
Private Sub btn_StoryMode_Click ( sender As Object , e As EventArgs ) Handles btn_StoryMode . Click
Select Case btn_StoryMode . Text
Case " Story Mode "
btn_StoryMode . Text = " New Game "
btn_FreeRoam . Text = " Continue "
btn_Aboot . Text = " Back "
btn_Exit . Visible = False
Case " New Game "
2022-11-07 07:22:19 -05:00
Label3 . Text = " Are you sure? "
Label3 . Visible = True
btn_StoryMode . Text = " Yes "
btn_FreeRoam . Text = " No "
btn_Aboot . Visible = False
btn_Exit . Visible = False
Case " Yes "
2022-11-08 01:02:02 -05:00
Label3 . Text = " Choose Chapter "
btn_StoryMode . Text = " Chapter 1 " & Environment . NewLine & " Hijacked! "
btn_FreeRoam . Text = " Chapter 2 " & Environment . NewLine & " Exploration "
btn_Aboot . Text = " Chapter 3 " & Environment . NewLine & " Escaped "
btn_Exit . Text = " Chapter 4 " & Environment . NewLine & " The known "
btn_Aboot . Visible = True
btn_Exit . Visible = True
btn_Chapter5 . Visible = True
btn_Back . Visible = True
Case " Chapter 1 " & Environment . NewLine & " Hijacked! "
2022-11-12 21:00:34 -05:00
Epilepsy . Show ( )
2022-11-02 00:17:14 -04:00
End Select
End Sub
Private Sub btn_Aboot_Click ( sender As Object , e As EventArgs ) Handles btn_Aboot . Click
Select Case btn_Aboot . Text
2022-11-20 04:43:01 -05:00
Case " About "
ShiftOSAbout . ShowDialog ( )
2022-11-02 00:17:14 -04:00
Case " Back "
btn_StoryMode . Text = " Story Mode "
btn_FreeRoam . Text = " Free Roam Mode "
btn_Aboot . Text = " About "
btn_Exit . Visible = True
End Select
2022-11-01 08:48:52 -04:00
End Sub
2022-11-08 01:02:02 -05:00
Private Sub btn_Chapter5_Click ( sender As Object , e As EventArgs ) Handles btn_Chapter5 . Click
End Sub
Private Sub btn_Back_Click ( sender As Object , e As EventArgs ) Handles btn_Back . Click
Label3 . Visible = False
btn_StoryMode . Text = " Story Mode "
btn_FreeRoam . Text = " Free Roam Mode "
btn_Aboot . Text = " About "
btn_Exit . Text = " Exit "
btn_Aboot . Visible = True
btn_Exit . Visible = True
btn_Chapter5 . Visible = False
btn_Back . Visible = False
End Sub
2022-11-03 03:40:32 -04:00
Private Sub CheckUpdate ( )
2022-11-03 05:18:01 -04:00
Try
2022-11-06 06:45:00 -05:00
If File . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SOS_NewVer.txt " ) = True Then
File . Delete ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SOS_NewVer.txt " )
2022-11-03 05:18:01 -04:00
End If
2022-11-06 06:45:00 -05:00
My . Computer . Network . DownloadFile ( " http://148.251.124.62:8080/ShiftOS/data/NewVer.txt " , Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SOS_NewVer.txt " )
2022-11-03 05:18:01 -04:00
Dim CurrentVersion As String = My . Resources . CurrentVersion
2022-11-06 06:45:00 -05:00
Dim NewVersion As String = File . ReadAllText ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SOS_NewVer.txt " )
2022-11-03 05:18:01 -04:00
If CurrentVersion = NewVersion Then
Else
btn_Aboot . Enabled = False
btn_Exit . Enabled = False
btn_FreeRoam . Enabled = False
btn_StoryMode . Enabled = False
ShiftOSUpdater . Show ( )
ShiftOSUpdater . NewVersion = NewVersion
ShiftOSUpdater . Label2 . Text = " A new version, " & NewVersion & " is available. " & Environment . NewLine & " Your version is " & CurrentVersion
ShiftOSUpdater . Focus ( )
End If
Catch ex As Exception
End Try
End Sub
2022-11-05 20:21:26 -04:00
Private Sub CheckInstall ( )
2022-11-06 03:20:38 -05:00
If Directory . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\ShiftFS " ) = True Then
2022-11-08 20:42:46 -05:00
Dim CurrentVersion As String = My . Resources . CurrentVersion
If File . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\version.txt " ) = True Then
TheUpdater . WhatVersion = File . ReadAllText ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\version.txt " )
Else
2022-11-13 03:15:05 -05:00
TheUpdater . WhatVersion = " 0.2.4 "
2022-11-08 20:42:46 -05:00
End If
If TheUpdater . WhatVersion = My . Resources . CurrentVersion Then
File . WriteAllText ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\version.txt " , My . Resources . CurrentVersion )
CheckUpdate ( )
Else
btn_Aboot . Enabled = False
btn_Exit . Enabled = False
btn_FreeRoam . Enabled = False
btn_StoryMode . Enabled = False
ShouldUpdate = True
ShiftOSUpdater . Show ( )
2022-11-13 09:22:42 -05:00
ShiftOSUpdater . Label2 . Text = " A new version, " & CurrentVersion & " is available. " & Environment . NewLine & " Your version is " & TheUpdater . WhatVersion & Environment . NewLine & " Update now to get more features. " 'ShiftOSUpdater.Label2.Text = "A new version, " & CurrentVersion & " is available." & Environment.NewLine & "Your version is " & TheUpdater.WhatVersion & "Update now to get more features."
'ShiftOSUpdater.Label2.Text = "Update function is temporarily disabled." & Environment.NewLine & "Click the 'Reset' to reset the save"
'ShiftOSUpdater.Button2.Text = "Reset"
2022-11-08 20:42:46 -05:00
End If
2022-11-05 20:21:26 -04:00
Else
2022-11-06 03:20:38 -05:00
If Directory . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS " ) = True Then
If Directory . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\ShiftFS " ) = True Then
2022-11-06 06:45:00 -05:00
Else
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\ShiftFS " )
End If
If Directory . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\saved " ) = True Then
Else
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\saved " )
2022-11-05 20:21:26 -04:00
End If
2022-11-19 14:25:18 -05:00
If Directory . Exists ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SysShiftFS " ) = True Then
Else
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SysShiftFS " )
End If
2022-11-05 20:21:26 -04:00
Else
2022-11-06 06:45:00 -05:00
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS " )
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\ShiftFS " )
2022-11-19 14:25:18 -05:00
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\SysShiftFS " )
2022-11-06 06:45:00 -05:00
Directory . CreateDirectory ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\saved " )
2022-11-13 03:15:05 -05:00
File . WriteAllText ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) & " \ShiftOS\version.txt " , My . Resources . CurrentVersion )
2022-11-05 20:21:26 -04:00
End If
2022-11-16 22:56:11 -05:00
CheckUpdate ( )
2022-11-05 20:21:26 -04:00
End If
End Sub
2022-11-03 05:18:01 -04:00
Private Sub Label1_Click ( sender As Object , e As EventArgs ) Handles Label1 . Click
Label2 . Text = " Debug it your way "
End Sub
2022-11-03 03:40:32 -04:00
2022-11-07 07:22:19 -05:00
Private Sub Label2_Click ( sender As Object , e As EventArgs ) Handles Label2 . Click , Label3 . Click
2022-11-03 05:18:01 -04:00
If Label2 . Text = " Debug it your way " Then
Strings . IsFree = True
2022-11-03 21:56:41 -04:00
GodMode ( )
2022-11-13 03:15:05 -05:00
Console . Show ( )
2022-11-03 05:18:01 -04:00
Close ( )
2022-11-03 03:40:32 -04:00
End If
End Sub
2022-11-05 12:48:35 -04:00
Private Sub BannerChange_Tick ( sender As Object , e As EventArgs ) Handles BannerChange . Tick
Select Case TimeToChange
Case 50
Thumbnail . BackgroundImage = My . Resources . MenuBanner1
Case 100
Thumbnail . BackgroundImage = My . Resources . MenuBanner2
TimeToChange = 0
End Select
TimeToChange = TimeToChange + 1
End Sub
2022-11-01 04:27:02 -04:00
End Class