This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FNVSGM_subroutines.ahk
148 lines (102 loc) · 3.24 KB
/
FNVSGM_subroutines.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
;subroutines for FNVSGM
;----------------------------
subScanForNewProfiles:
Gui, +Disabled
lstSavegames := doScanForSavegameNames(SAVEGAMESFOLDER)
lstLIVEFoldernames := doScanForLIVEFolderNames(SAVEGAMESFOLDER)
;create savegame (character) folders and LIVE subfolders
doCreateSavegameFolders( SAVEGAMESFOLDER, lstSavegames, lstLIVEFoldernames, PROFILESSUBFOLDER)
;copy all files to the approtiate folders (incl. LIVE folders)
doCopySavegames( SAVEGAMESFOLDER, lstSavegames, lstLIVEFoldernames, PROFILESSUBFOLDER)
doUpdateProfileDDL(SAVEGAMESFOLDER,PROFILESSUBFOLDER,ACTIVE)
Gui, -Disabled
;subScanForNewProfiles
Return
;---------------------
subSetupFNVSGM:
;check if INI file exists
IfNotExist, %FNVSGMINIFILENAME%
{
MsgBox, 0, ERROR, The INI file doesn't exist!`n(%FNVSGMINIFILENAME%)`n`nCreating new INI file...!
gosub subCreateNewINI
}
;get the path of the savegame folder
IniRead, SAVEGAMESFOLDER, %FNVSGMINIFILENAME%, general, FalloutNVsavegames,
;IF not setup already
If SAVEGAMESFOLDER =
{
;try to find at standard location
SAVEGAMESFOLDER = %A_MyDocuments%\My Games\FalloutNV
IfNotExist, %SAVEGAMESFOLDER%\Saves
{
MsgBox, 0, Critical Failure, Fallout New Vegas Savegame folder NOT FOUND`n(usually in ..My Documents\My Games\FalloutNV),
FileSelectFolder, SAVEGAMESFOLDER,,,Critical Failure`nFallout New Vegas Savegame folder NOT FOUNDPlease select Fallout New Vegas Savegame folder... `n(usually in ..My Documents\My Games\FalloutNV)
If ErrorLevel = 1
{
SAVEGAMESFOLDER =
}
}
;store the "my games\FalloutNV" location
IniWrite, %SAVEGAMESFOLDER%, %FNVSGMINIFILENAME%, general, FalloutNVsavegames
;get (from registry) and store the FalloutNV.exe location
strFalloutNVPath=
RegRead, strFalloutNVPath, HKEY_LOCAL_MACHINE, Software\Bethesda Softworks\FalloutNV, Installed Path
IniWrite, %strFalloutNVPath%FalloutNV.exe, %FNVSGMINIFILENAME%, advanced, playbuttonlink
}
;get the active profile and active/display
IniRead, ACTIVE, %FNVSGMINIFILENAME%, general, active
lstProfiles := doUpdateProfileDDL(SAVEGAMESFOLDER,PROFILESSUBFOLDER,ACTIVE)
;subSetupFNVSGM:
Return
;-------------------
subRunFalloutNV:
IniRead, strRunfile, %FNVSGMINIFILENAME%, advanced, playbuttonlink
SplitPath, strRunfile,, strRunfilepath
Run, %strRunfile%, %strRunfilepath%
;subRunFalloutNV
Return
;-----------------------
subActivateProfile:
if ACTIVE =
{
ACTIVE = STANDARD
}
FileSetAttrib, -R, %SAVEGAMESFOLDER%\Fallout.ini
;activate new profile
;
;only when profile folder exists
IfExist, %SAVEGAMESFOLDER%\%PROFILESSUBFOLDER%\%ddlCharacter%
{
;activate profile
IniWrite, %PROFILESSUBFOLDER%\%ACTIVE%\, %SAVEGAMESFOLDER%\Fallout.ini, General, SLocalSavePath
}
else
{
ACTIVE=STANDARD
}
if ACTIVE = STANDARD
{
;activate standard profile
IniWrite, Saves\, %SAVEGAMESFOLDER%\Fallout.ini, General, SLocalSavePath
}
;update FNVSGM ini
IniWrite, %ddlCharacter%, %FNVSGMINIFILENAME%, general, active
;subActivateProfile
Return
;-------------------------
subCreateNewINI:
FileAppend,
(
[general]
active=
FalloutNVsavegames=
[advanced]
playbuttonlink=
), %FNVSGMINIFILENAME%
;subCreateNewINI
Return
;--------------------------
subLaunchNexus:
Run, www.newvegasnexus.com
;subLaunchNexus
Return