Added Paths module

This commit is contained in:
pfg github 2015-03-15 09:52:07 -07:00
parent c8d95621fb
commit 6975f73850
5 changed files with 46 additions and 14 deletions

View file

@ -382,9 +382,12 @@
End Sub End Sub
Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1 Try
Me.Hide() ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1
ShiftOSDesktop.setuppanelbuttons() Me.Hide()
ShiftOSDesktop.setuppanelbuttons()
Catch
End Try
End Sub End Sub
'end of general setup 'end of general setup
@ -2046,7 +2049,7 @@
ShiftOSDesktop.lastcolourpick = pnlnewcolour.BackColor ShiftOSDesktop.lastcolourpick = pnlnewcolour.BackColor
Shifter.setuppreshifterstuff() Shifter.setuppreshifterstuff()
End If End If
Me.Close() Me.Close()
End Sub End Sub

View file

@ -2,6 +2,7 @@
Private Command As String Private Command As String
Private NewModForm As New ModForm Private NewModForm As New ModForm
Public Sub UseCode(ByVal Path As String) Public Sub UseCode(ByVal Path As String)
Dim sr As System.IO.StreamReader Dim sr As System.IO.StreamReader

19
ShiftOS/Paths.vb Normal file
View file

@ -0,0 +1,19 @@
Module Paths
Public root As String = "C:\ShiftOS\"
Public progdata As String = "C:\ShiftOS\SoftwareData\"
Public advdata As String = "C:\ShiftOS\SoftwareData\AdvStart\"
Public kidata As String = "C:\ShiftOS\SoftwareData\KnowledgeInput\"
Public shiftnetdata As String = "C:\ShiftOS\SoftwareData\Shiftnet\"
Public dnldata As String = "C:\ShiftOS\SoftwareData\DownloadManager\"
Public savedata As String = "C:\ShiftOS\Shiftum42\"
Public home As String = "C:\ShiftOS\Home\"
Public desktop As String = "C:\ShiftOS\Home\Desktop\"
Public documents As String = "C:\ShiftOS\Home\Documents\"
Public music As String = "C:\ShiftOS\Home\Music\"
Public pictures As String = "C:\ShiftOS\Home\Pictures\"
Public skins As String = "C:\ShiftOS\Home\Skins\"
End Module

View file

@ -15,7 +15,7 @@
Public newgame As Boolean = False Public newgame As Boolean = False
Public lastcolourpick As Color = Color.Gray Public lastcolourpick As Color = Color.Gray
Public programsopen As Integer = 0 Public programsopen As Integer = 0
Public ShiftOSPath As String = "C:\ShiftOS\" Public ShiftOSPath As String = "C:\ShiftOS"
Private actualshiftversion As String = "0.0.8" Private actualshiftversion As String = "0.0.8"
Public ingameversion As String = "0.0.1.0" Public ingameversion As String = "0.0.1.0"
@ -1063,15 +1063,15 @@
If boughtdesktopicons = True Then savelines(614) = 11 Else savelines(614) = 10 If boughtdesktopicons = True Then savelines(614) = 11 Else savelines(614) = 10
If boughtadvapplauncher = True Then savelines(615) = 11 Else savelines(615) = 10 If boughtadvapplauncher = True Then savelines(615) = 11 Else savelines(615) = 10
IO.File.WriteAllLines(ShiftOSPath + "Shiftum42\Drivers\HDD.dri", savelines) IO.File.WriteAllLines(ShiftOSPath + "Shiftum42\Drivers\HDD.dri", savelines)
File_Crypt.EncryptFile(ShiftOSPath + "Shiftum42\Drivers\HDD.dri", "C:/ShiftOS/Shiftum42/SKernal.sft", sSecretKey) File_Crypt.EncryptFile(ShiftOSPath + "Shiftum42\Drivers\HDD.dri", "C:\ShiftOS\Shiftum42\SKernal.sft", sSecretKey)
Try Try
Dim sw As New IO.StreamWriter(ShiftOSPath & "SoftwareData\DownloadManager\Downloadhistory.lst") Dim sw As New IO.StreamWriter(Paths.dnldata & "Downloadhistory.lst")
sw.Write(downloadmanagerhistory) sw.Write(downloadmanagerhistory)
sw.Close() sw.Close()
Catch ex As Exception Catch ex As Exception
End Try End Try
Dim objWriter As New System.IO.StreamWriter("C:/ShiftOS/Shiftum42/HDAccess.sft", False) Dim objWriter As New System.IO.StreamWriter(Paths.savedata & "HDAccess.sft", False)
objWriter.Write(actualshiftversion) objWriter.Write(actualshiftversion)
objWriter.Close() objWriter.Close()
@ -1090,8 +1090,8 @@
End Sub End Sub
Private Sub loadgame() Private Sub loadgame()
File_Crypt.DecryptFile("C:/ShiftOS/Shiftum42/SKernal.sft", ShiftOSPath + "Shiftum42\Drivers\HDD.dri", sSecretKey) File_Crypt.DecryptFile(Paths.savedata & "SKernal.sft", Paths.savedata & "Drivers\HDD.dri", sSecretKey)
loadlines = IO.File.ReadAllLines(ShiftOSPath + "Shiftum42\Drivers\HDD.dri") loadlines = IO.File.ReadAllLines(Paths.savedata & "Drivers\HDD.dri")
If loadlines(0) = 11 Then boughttitlebar = True Else boughttitlebar = False If loadlines(0) = 11 Then boughttitlebar = True Else boughttitlebar = False
If loadlines(1) = 11 Then boughtgray = True Else boughtgray = False If loadlines(1) = 11 Then boughtgray = True Else boughtgray = False
@ -5077,6 +5077,7 @@
hideStart() hideStart()
Else Else
infobox.showinfo("Error", "Could not find app 'Pong'.") infobox.showinfo("Error", "Could not find app 'Pong'.")
End If
End Sub End Sub
Private Sub KnowledgeInputToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles KnowledgeInputToolStripMenuItem1.Click Private Sub KnowledgeInputToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles KnowledgeInputToolStripMenuItem1.Click

View file

@ -409,6 +409,7 @@ Module Skins
If Not loaddata(109) = "" Then enablebordercorners = loaddata(109) If Not loaddata(109) = "" Then enablebordercorners = loaddata(109)
'for adding extra features, check: 'for adding extra features, check:
If loaddata(110) = "" Or loaddata(110) = "End of skin data" Then loaddata(110) = enabledraggableicons Else enabledraggableicons = loaddata(110) If loaddata(110) = "" Or loaddata(110) = "End of skin data" Then loaddata(110) = enabledraggableicons Else enabledraggableicons = loaddata(110)
If loaddata(111) = "" Or loaddata(111) = "End of skin data" Then loaddata(111) = icontextcolor.ToArgb Else icontextcolor = Color.FromArgb(loaddata(111)) If loaddata(111) = "" Or loaddata(111) = "End of skin data" Then loaddata(111) = icontextcolor.ToArgb Else icontextcolor = Color.FromArgb(loaddata(111))
If loaddata(112) = "" Or loaddata(112) = "End of skin data" Then loaddata(112) = showicons Else showicons = loaddata(112) If loaddata(112) = "" Or loaddata(112) = "End of skin data" Then loaddata(112) = showicons Else showicons = loaddata(112)
@ -420,10 +421,17 @@ Module Skins
If loaddata(118) = "" Then startWidth = 320 Else startWidth = loaddata(118) If loaddata(118) = "" Then startWidth = 320 Else startWidth = loaddata(118)
If loaddata(119) = "" Then shutdownstring = "Shut Down ShiftOS" Else shutdownstring = loaddata(119) If loaddata(119) = "" Then shutdownstring = "Shut Down ShiftOS" Else shutdownstring = loaddata(119)
If loaddata(120) = "" Then userNamePosition = "Middle, Right" Else userNamePosition = loaddata(200) If loaddata(120) = "" Then userNamePosition = "Middle, Right" Else userNamePosition = loaddata(200)
If loaddata(121) = "" Then recentIconsHorizontal = False Else recentIconsHorizontal = loaddata(201) Try
If loaddata(122) = "" Then usernametextcolor = Color.White Else usernametextcolor = Color.FromArgb(loaddata(202)) If loaddata(121) = "" Then recentIconsHorizontal = False Else recentIconsHorizontal = loaddata(201)
If loaddata(123) = "" Then usernamefont = "Trebuchet MS" Else usernamefont = loaddata(203) If loaddata(122) = "" Then usernametextcolor = Color.White Else usernametextcolor = Color.FromArgb(loaddata(202))
If loaddata(124) = "" Then usernamefontsize = 12 Else usernamefontsize = loaddata(204) If loaddata(123) = "" Then usernamefont = "Trebuchet MS" Else usernamefont = loaddata(203)
If loaddata(124) = "" Then usernamefontsize = 12 Else usernamefontsize = loaddata(204)
Catch
usernametextcolor = Color.White
usernamefont = "Trebuchet MS"
recentIconsHorizontal = False
usernamefontsize = 12
End Try
If loaddata(125) = "" Then usernamefontstyle = FontStyle.Bold Else usernamefontstyle = loaddata(125) If loaddata(125) = "" Then usernamefontstyle = FontStyle.Bold Else usernamefontstyle = loaddata(125)
If loaddata(126) = "" Then userNamePanelBackgroundColor = Color.Gray Else userNamePanelBackgroundColor = Color.FromArgb(loaddata(126)) If loaddata(126) = "" Then userNamePanelBackgroundColor = Color.Gray Else userNamePanelBackgroundColor = Color.FromArgb(loaddata(126))
If loaddata(127) = "" Then powerPanelBackgroundColor = Color.Gray Else powerPanelBackgroundColor = Color.FromArgb(loaddata(127)) If loaddata(127) = "" Then powerPanelBackgroundColor = Color.Gray Else powerPanelBackgroundColor = Color.FromArgb(loaddata(127))