1
1
Imports System.IO
2
2
Imports GHOSTbackup.BackupHelper
3
- Imports GHOSTbackup.Settings
4
3
Imports GHOSTbackup.Updater
5
4
Imports GHOSTbackup.UplayHelper
6
5
Imports GHOSTbackup.Var
7
6
Imports GHOSTbackup.WildlandsHelper
8
7
9
8
Public Class Form1
10
- Private Sub LoadFormPosition()
11
- If My.Settings.RememberFormPosition = True Then
12
- Dim FormLocation As Point = My.Settings.WindowLocation
13
-
14
- If (FormLocation.X = - 1 ) And (FormLocation.Y = - 1 ) Then
15
- Return
16
- End If
17
-
18
- Dim LocationVisible As Boolean = False
19
- For Each S As Screen In Screen.AllScreens
20
- If S.Bounds.Contains(FormLocation) Then
21
- LocationVisible = True
22
- End If
23
- Next
24
-
25
- If Not LocationVisible Then
26
- Return
27
- End If
28
-
29
- StartPosition = FormStartPosition.Manual
30
- Location = FormLocation
31
- End If
32
- End Sub
33
-
34
9
Private Sub HelpToolTip_Draw(sender As Object , e As DrawToolTipEventArgs) Handles HelpToolTip.Draw
35
10
'Draw tooltip with custom colors
36
11
e.DrawBackground()
@@ -39,14 +14,29 @@ Public Class Form1
39
14
e.DrawText()
40
15
End Sub
41
16
42
- Private Sub Form1_Load(sender As Object , e As EventArgs) Handles MyBase .Load
43
- 'Migrate settings from the old version
44
- UpgradeSettings()
17
+ Private Sub LoadFormPosition()
18
+ If Settings.RememberFormPosition = True Then
19
+ Dim FormLocation As Point = Settings.FormPosition
20
+
21
+ If FormLocation.X <> - 1 Or FormLocation.Y <> - 1 Then
22
+ Dim LocationVisible As Boolean = False
23
+ For Each S As Screen In Screen.AllScreens
24
+ If S.Bounds.Contains(FormLocation) Then
25
+ LocationVisible = True
26
+ End If
27
+ Next
45
28
46
- 'Load settings and set defaults
47
- LoadSettings()
29
+ If LocationVisible Then
30
+ StartPosition = FormStartPosition.Manual
31
+ Location = FormLocation
32
+ End If
33
+ End If
34
+ End If
35
+ End Sub
48
36
49
- 'Set window position
37
+ Private Sub Form1_Load(sender As Object , e As EventArgs) Handles MyBase .Load
38
+ 'Load settings and set defaults
39
+ Settings.Init()
50
40
LoadFormPosition()
51
41
52
42
'Start logging session
@@ -89,10 +79,10 @@ Public Class Form1
89
79
If CustomMsgBox.DialogResult = DialogResult.No OrElse CustomMsgBox.DialogResult = DialogResult.Cancel Then
90
80
e.Cancel = True
91
81
Else
92
- SaveSettings ()
82
+ Settings.Save ()
93
83
End If
94
84
Else
95
- SaveSettings ()
85
+ Settings.Save ()
96
86
End If
97
87
End Sub
98
88
@@ -430,7 +420,6 @@ Public Class Form1
430
420
O.Description = "Select where you want to save the event log file to."
431
421
If O.ShowDialog = DialogResult.OK Then
432
422
SettingsLogFilePathTextBox.Text = O.SelectedPath & "\event.log"
433
- My.Settings.LogFilePath = SettingsLogFilePathTextBox.Text
434
423
Logger.Log( "[INFO] Log file path set to: " & SettingsLogFilePathTextBox.Text)
435
424
End If
436
425
End Using
@@ -465,7 +454,6 @@ Public Class Form1
465
454
O.Title = "Select Wildlands executable"
466
455
If O.ShowDialog = DialogResult.OK Then
467
456
SettingsCustomExeTextBox.Text = O.FileName
468
- My.Settings.CustomExeLoc = SettingsCustomExeTextBox.Text
469
457
Logger.Log( "[INFO] Custom Wildlands executable set: " & O.FileName)
470
458
End If
471
459
End Using
0 commit comments