diff --git a/ShiftOS-TheRevival/API/TerminalAPI.vb b/ShiftOS-TheRevival/API/TerminalAPI.vb index b367fac..69f77db 100644 --- a/ShiftOS-TheRevival/API/TerminalAPI.vb +++ b/ShiftOS-TheRevival/API/TerminalAPI.vb @@ -4,10 +4,11 @@ Module TerminalAPI Public command As String Public AdvancedCommand As Boolean Public RawCommand As String - Public IsConsoleParent As Boolean = True + Public IsConsoleParent As Boolean Public Sub InitializeTerminal() If IsConsoleParent = True Then + Console.TopMost = False Cursor.Hide() Strings.OnceInfo(1) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS" Strings.OnceInfo(4) = "!" @@ -279,13 +280,18 @@ Module TerminalAPI TerminateShiftOS() Case "startg" Undeveloped() - StartG() + If IsStartG = False Then + StartG() + End If Case "shiftertest" - DuWM_SecondWindowSet(Shifter) - Console.Close() - DuWM_FirstWindowSet(Console) + 'DuWM_SecondWindowSet(Shifter) + 'Console.Close() + 'DuWM_FirstWindowSet(Console) + DuWM_NewProcess(Shifter) Case "stopg" - StopG() + If IsStartG = True Then + StopG() + End If Undeveloped() Case "textpad" If Strings.AvailableFeature(17) = "1" Then diff --git a/ShiftOS-TheRevival/Functions/InGame/SystemManager/Terminate.vb b/ShiftOS-TheRevival/Functions/InGame/SystemManager/Terminate.vb index 4309452..25dabb2 100644 --- a/ShiftOS-TheRevival/Functions/InGame/SystemManager/Terminate.vb +++ b/ShiftOS-TheRevival/Functions/InGame/SystemManager/Terminate.vb @@ -1,7 +1,9 @@ Module Terminate Public Sub TerminateShiftOS() - NewLine("Stopping the Window Manager...") - StopG() + If IsStartG = True Then + NewLine("Stopping the Window Manager...") + StopG() + End If Console_Full() If Strings.OnceInfo(6) = "story" Then NewLine("Saving game...") @@ -10,7 +12,8 @@ Cursor.Show() NewLine("Shutting down...") ShiftOSMenu.Show() - Console.Close() - Shifter.Close() + If IsStartG = False Then + Console.Close() + End If End Sub End Module diff --git a/ShiftOS-TheRevival/Functions/OutGame/SaveLoadSystem.vb b/ShiftOS-TheRevival/Functions/OutGame/SaveLoadSystem.vb index e535695..a2dc8bc 100644 --- a/ShiftOS-TheRevival/Functions/OutGame/SaveLoadSystem.vb +++ b/ShiftOS-TheRevival/Functions/OutGame/SaveLoadSystem.vb @@ -56,6 +56,7 @@ Module SaveLoadSystem End Sub Public Sub FreeRoamMode() + IsConsoleParent = True 'Sets all features to as bought Strings.ComputerInfo(0) = "shiftos" Strings.ComputerInfo(1) = "user" diff --git a/ShiftOS-TheRevival/MainForms/Applications/Console.vb b/ShiftOS-TheRevival/MainForms/Applications/Console.vb index 421e3f2..63d3bbd 100644 --- a/ShiftOS-TheRevival/MainForms/Applications/Console.vb +++ b/ShiftOS-TheRevival/MainForms/Applications/Console.vb @@ -23,7 +23,9 @@ Public Class Console With ShortcutHandler .WorkerSupportsCancellation = True End With + 'MsgBox("Full!") Console_Full() + 'MsgBox("Initialize!") InitializeTerminal() End Sub diff --git a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/Desktop.Designer.vb b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/Desktop.Designer.vb index e44cce2..cc9992e 100644 --- a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/Desktop.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/Desktop.Designer.vb @@ -37,6 +37,7 @@ Partial Class Desktop Me.Button1.TabIndex = 0 Me.Button1.Text = "term" Me.Button1.UseVisualStyleBackColor = False + Me.Button1.Visible = False ' 'Desktop ' diff --git a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/DesktopManager.vb b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/DesktopManager.vb index 89d8b65..8b501ce 100644 --- a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/DesktopManager.vb +++ b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/DesktopManager.vb @@ -1,23 +1,47 @@ -Module DesktopManager +Imports System.Threading + +Module DesktopManager + Public IsStartG As Boolean + Public Sub StartG() + IsStartG = True Desktop.Show() Desktop.FormBorderStyle = FormBorderStyle.None Desktop.WindowState = FormWindowState.Maximized Desktop.TopMost = False IsConsoleParent = False - Console.Close() + Console.Dispose() WindowManagerChoose() Cursor.Show() End Sub Public Sub StopG() - DuWM_CurrentProcess = 0 - Strings.ProcessID(0) = 0 - Strings.ProcessID(1) = 0 - Cursor.Hide() + IsStartG = False + 'MsgBox("IsConsoleParent should be true!") IsConsoleParent = True + ''MsgBox("PID 0 0") + 'Strings.ProcessID(0) = 0 + ''MsgBox("PID 1 0") + 'Strings.ProcessID(1) = 0 + TerminateWindowApps() + 'MsgBox("Hide!") + Cursor.Hide() + MsgBox("this is not a bug, this is a feature") 'Use this messagebox to hold Console to stay open, because removing this line closes Console all together for some reason Console.Show() - Desktop.Close() + 'MsgBox("ADIOS!") + Desktop.Hide() + End Sub + + Public Sub TerminateWindowApps() + Dim MaxPID As Integer = 0 + Do + If MaxPID = 2 Then + Exit Do + Else + Strings.ProcessID(MaxPID) = 0 + MaxPID = MaxPID + 1 + End If + Loop End Sub Public Sub WindowManagerChoose() diff --git a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.Designer.vb b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.Designer.vb new file mode 100644 index 0000000..8e108b8 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.Designer.vb @@ -0,0 +1,30 @@ + _ +Partial Class ThisIsNotABugThisIsAFeature + 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() + components = New System.ComponentModel.Container + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Text = "ThisIsNotABugThisIsAFeature" + End Sub +End Class diff --git a/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.vb b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.vb new file mode 100644 index 0000000..7cae8ba --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/DesktopEnvironment/master/ThisIsNotABugThisIsAFeature.vb @@ -0,0 +1,3 @@ +Public Class ThisIsNotABugThisIsAFeature + +End Class \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index e43b6ae..6b96ee0 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -17,7 +17,8 @@ Public Class ShiftOSMenu Private Sub btn_Exit_Click(sender As Object, e As EventArgs) Handles btn_Exit.Click Select Case btn_Exit.Text Case "Exit" - Close() + 'Close() + Application.Exit() End Select End Sub diff --git a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_Main.vb b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_Main.vb index ddeea59..331927c 100644 --- a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_Main.vb +++ b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_Main.vb @@ -3,6 +3,7 @@ Public FirstWindow As Form Public SecondWindow As Form Public DuWM_CurrentProcess As Integer = 0 + Public DuWM_ChangeLayout As Boolean Public Sub DuWM_Initiate() Strings.ProcessID(0) = 0 @@ -66,7 +67,12 @@ NewWindow.Height = Desktop.Height - 20 NewWindow.Width = Desktop.Width - 20 NewWindow.Location = New Point(10, 10) + Case 2 + NewWindow.Height = Desktop.Height - 20 + NewWindow.Width = (Desktop.Width / 2) - 20 + NewWindow.Location = New Point((Desktop.Width / 2) + 10, 10) End Select + DuWM_ChangeLayout = True End Sub 'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer) diff --git a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.Designer.vb b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.Designer.vb index a0239ac..e6b186c 100644 --- a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.Designer.vb @@ -26,6 +26,7 @@ Partial Class DuWM_WindowContainer Me.DuWM_ContainerPanel = New System.Windows.Forms.Panel() Me.DuWM_WMCheck = New System.Windows.Forms.Timer(Me.components) Me.DuWM_ChildSize = New System.Windows.Forms.Timer(Me.components) + Me.DuWM_LayoutCheck = New System.Windows.Forms.Timer(Me.components) Me.SuspendLayout() ' 'DuWM_ContainerPanel @@ -43,6 +44,9 @@ Partial Class DuWM_WindowContainer 'DuWM_ChildSize ' ' + 'DuWM_LayoutCheck + ' + ' 'DuWM_WindowContainer ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -61,4 +65,5 @@ Partial Class DuWM_WindowContainer Friend WithEvents DuWM_ContainerPanel As Panel Friend WithEvents DuWM_WMCheck As Timer Friend WithEvents DuWM_ChildSize As Timer + Friend WithEvents DuWM_LayoutCheck As Timer End Class diff --git a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.resx b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.resx index aa1693b..27f4227 100644 --- a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.resx +++ b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.resx @@ -123,4 +123,7 @@ 168, 17 + + 312, 17 + \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb index f614a70..26b9d04 100644 --- a/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb +++ b/ShiftOS-TheRevival/MainForms/WindowManager/DualWindowManager/DuWM_WindowContainer.vb @@ -1,18 +1,22 @@ Public Class DuWM_WindowContainer - Public ChildForm As Form + Public ChildForm As New Form Public DuWM_PID As Integer Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load DuWM_WMCheck.Start() DuWM_ChildSize.Start() + DuWM_LayoutCheck.Start() End Sub Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick If ChildForm.Visible = False Then Strings.ProcessID(DuWM_PID) = 0 - Close() End If If Strings.ProcessID(DuWM_PID) = 0 Then + 'MsgBox(Convert.ToString(ChildForm)) + DuWM_CurrentProcess = DuWM_CurrentProcess - 1 + DuWM_ChangeLayout = True + DuWM_WMCheck.Stop() Close() End If End Sub @@ -20,4 +24,23 @@ Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick ChildForm.Size = DuWM_ContainerPanel.Size End Sub + + Private Sub DuWM_LayoutCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_LayoutCheck.Tick + If DuWM_ChangeLayout = True Then + Select Case DuWM_CurrentProcess + Case 1 + Height = Desktop.Height - 20 + Width = Desktop.Width - 20 + Location = New Point(10, 10) + Case 2 + Select Case DuWM_PID + Case 0 + Height = Desktop.Height - 20 + Width = (Desktop.Width / 2) - 20 + Location = New Point(10, 10) + End Select + End Select + DuWM_ChangeLayout = False + End If + 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 2b512d7..6a76b8e 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -130,6 +130,12 @@ Form + + ThisIsNotABugThisIsAFeature.vb + + + Form + Epilepsy.vb