forked from ori-community/wotw-rando-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRandoSettings.ahk
295 lines (231 loc) · 13.1 KB
/
RandoSettings.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
#NoEnv ; don't populate environment variables automatically
#SingleInstance, Force ; One instance to prevent mismatches in settings
SetWorkingDir, %A_ScriptDir% ; start where we at
; Reading the settings file and setting variables
inipath = settings.ini
if not (FileExist(inipath)) {
MsgBox, 16, Ori WotW Rando Settings editor - Error, File %A_ScriptDir%\settings.ini not found!
ExitApp, 1
}
IniRead, varSkipUpdate, %inipath%, Flags, SkipUpdate, false
IniRead, varLaunchTracker, %inipath%, Flags, LaunchWithTracker, false
IniRead, varShowShortCutscenes, %inipath%, Flags, ShowShortCutscenes, false
IniRead, varShowLongCutscenes, %inipath%, Flags, ShowLongCutscenes, false
IniRead, varUseWinStore, %inipath%, Flags, UseWinStore, false
IniRead, varCursorLock, %inipath%, Flags, CursorLock, false
IniRead, varAlwaysShowKS, %inipath%, Flags, AlwaysShowKeystones, false
IniRead, varInvertSwim, %inipath%, Flags, InvertSwim, false
IniRead, varDisableDebug, %inipath%, Flags, DisableDebugControls, false
IniRead, varDisableQuestSnap, %inipath%, Flags, QuestFocusOnAbility3, false
IniRead, varRandomCurrencyNames, %inipath%, Flags, BoringMoney, true
IniRead, varMouseBurrow, %inipath%, Flags, BurrowMouseControl, false
IniRead, varMouseWDash, %inipath%, Flags, WaterDashMouseControl, false
IniRead, varMouseGrapple, %inipath%, Flags, GrappleMouseControl, false
IniRead, varBetaVersions, %inipath%, Flags, BetaVersions, true
IniRead, varHideQuestFilter, %inipath%, Flags, HideQuestFilter, false
IniRead, varHideWarpFilter, %inipath%, Flags, HideWarpFilter, false
IniRead, varHideCollectableFilter, %inipath%, Flags, HideCollectableFilter, false
IniRead, varAlwaysShowWarps, %inipath%, Flags, AlwaysShowWarps, false
IniRead, varDisableNetcode, %inipath%, Flags, DisableNetcode, false
IniRead, varSteamPath, %inipath%, Paths, Steam
parseNumtoBool(var) {
If (var == 1)
return "true"
return "false"
}
parseBooltoNum(var) {
If (var == "true")
Return 1
Return 0
}
; Parsing the booleans into somehting AHK can work with
ahkvarShowShortCutscenes := parseBooltoNum(varShowShortCutscenes)
ahkvarShowLongCutscenes := parseBooltoNum(varShowLongCutscenes)
ahkvarUseWinStore := parseBooltoNum(varUseWinStore)
ahkvarCursorLock := parseBooltoNum(varCursorLock)
ahkVarAlwaysShowKS := parseBooltoNum(varAlwaysShowKS)
ahkvarInvertSwim := parseBooltoNum(varInvertSwim)
ahkvarDisableDebug := parseBooltoNum(varDisableDebug)
ahkvarRandomCurrencyNames := 1-parseBooltoNum(varRandomCurrencyNames)
ahkvarAutoUpdate := 1-parseBooltoNum(varSkipUpdate)
ahkvarDisableQuestSnap := parseBooltoNum(varDisableQuestSnap)
ahkVarLaunchTracker := parseBooltoNum(varLaunchTracker)
ahkVarMouseBurrow := parseBooltoNum(varMouseBurrow)
ahkVarMouseWDash := parseBooltoNum(varMouseWDash)
ahkVarMouseGrapple := parseBooltoNum(varMouseGrapple)
ahkVarBetaVersions := parseBooltoNum(varBetaVersions)
ahkVarHideQuestFilter := parseBooltoNum(varHideQuestFilter)
ahkVarHideWarpFilter := parseBooltoNum(varHideWarpFilter)
ahkVarHideCollectableFilter := parseBooltoNum(varHideCollectableFilter)
ahkVarAlwaysShowWarps := parseBooltoNum(varAlwaysShowWarps)
ahkvarDisableNetcode := parseBooltoNum(varDisableNetcode)
; Adding all the buttons and text in the Window.
col2 := 260
Gui, Font, s15
Gui, Add, Text, Center, Ori WotW Randomizer settings
Gui, Font, s10 italic
Gui, Add, Text, x20, (mouse over options for more info)
Gui, Font, s10 norm
Gui, Add, Text, x20 section, Setting
Gui, Add, Text, x%col2% ys, Enabled
Gui, Add, Text, x20 y+20 section, Cursor Lock
Gui, Add, Checkbox, x%col2% ys checked%ahkvarCursorLock% vahkvarCursorLock gwritetofile
Gui, Add, Text, x20 section, Always Show Keystones
Gui, Add, Checkbox, x%col2% ys checked%ahkVarAlwaysShowKS% vahkVarAlwaysShowKS gwritetofile
Gui, Add, Text, x20 section, Invert Swim Speeds
Gui, Add, Checkbox, x%col2% ys checked%ahkvarInvertSwim% vahkvarInvertSwim gwritetofile
Gui, Add, Text, x20 section, Disable Quest Snap on Mouseover
Gui, Add, Checkbox, x%col2% ys checked%ahkvarDisableQuestSnap% vahkvarDisableQuestSnap gwritetofile
Gui, Add, Text, x20 section, Disable Debug Controls
Gui, Add, Checkbox, x%col2% ys checked%ahkvarDisableDebug% vahkvarDisableDebug gwritetofile
Gui, Add, Text, x20 section, Random Currency Names
Gui, Add, Checkbox, x%col2% ys checked%ahkvarRandomCurrencyNames% vahkvarRandomCurrencyNames gwritetofile
Gui, Add, Text, x20 y+30 section, Mouse Aiming: Grapple
Gui, Add, Checkbox, x%col2% ys checked%ahkvarMouseGrapple% vahkvarMouseGrapple gwritetofile
Gui, Add, Text, x20 section, Mouse Aiming: Burrow
Gui, Add, Checkbox, x%col2% ys checked%ahkvarMouseBurrow% vahkvarMouseBurrow gwritetofile
Gui, Add, Text, x20 section, Mouse Aiming: Water Dash
Gui, Add, Checkbox, x%col2% ys checked%ahkvarMouseWDash% vahkvarMouseWDash gwritetofile
Gui, Add, Text, x20 y+30 section, Hide Quest Filter
Gui, Add, Checkbox, x%col2% ys checked%ahkVarHideQuestFilter% vahkVarHideQuestFilter gwritetofile
Gui, Add, Text, x20 section, Hide Warp Filter
Gui, Add, Checkbox, x%col2% ys checked%ahkVarHideWarpFilter% vahkVarHideWarpFilter gwritetofile
Gui, Add, Text, x20 section, Hide Collectable Filter
Gui, Add, Checkbox, x%col2% ys checked%ahkVarHideCollectableFilter% vahkVarHideCollectableFilter gwritetofile
Gui, Add, Text, x20 section, Always Show Warps
Gui, Add, Checkbox, x%col2% ys checked%ahkVarAlwaysShowWarps% vahkVarAlwaysShowWarps gwritetofile
Gui, Add, Text, x20 y+30 section, Restore Short Cutscenes
Gui, Add, Checkbox, x%col2% ys checked%ahkvarShowShortCutscenes% vahkvarShowShortCutscenes gwritetofile
Gui, Add, Text, x20 section, Restore Long Cutscenes
Gui, Add, Checkbox, x%col2% ys checked%ahkvarShowLongCutscenes% vahkvarShowLongCutscenes gwritetofile
Gui, Add, Text, x20 y+30 section, Launch with Item Tracker
Gui, Add, Checkbox, x%col2% ys checked%ahkvarLaunchTracker% vahkvarLaunchTracker gwritetofile
Gui, Add, Text, x20 section, Automatic Updates
Gui, Add, Checkbox, x%col2% ys checked%ahkvarAutoUpdate% vahkvarAutoUpdate gwritetofile
Gui, Add, Text, x20 section, Beta Versions
Gui, Add, Checkbox, x%col2% ys checked%ahkvarBetaVersions% vahkvarBetaVersions gwritetofile
Gui, Add, Text, x20 section, Disable Netcode
Gui, Add, Checkbox, x%col2% ys checked%ahkvarDisableNetcode% vahkvarDisableNetcode gwritetofile
Gui, Add, Text, x20 section, Use Windows Store
Gui, Add, Checkbox, x%col2% ys checked%ahkvarUseWinStore% vahkvarUseWinStore gwritetofile
Gui, Add, Text, x20 y+30, Steam path:
Gui, Add, Text, x20 vvarSteamPath, %varSteamPath%
Gui, Add, Button, x20 section gchangesteampath, Change Steam path
Gui, Add, Button, x%col2% ys gquit, Done
Gui, Show, , WotW Rando Settings
OnMessage(0x200, "Help")
Return
quit:
if(!A_IsCompiled)
Reload
ExitApp
changesteampath:
; label that gets called when the change button is pressed
oldsteampath := varSteamPath
SplitPath, oldsteampath,, oldDir
FileSelectFile, varSteamPath, 3, %oldDir%, Select Steam.exe, *.exe ; Possibly want to use the missing arg with the current location. have to split %varSteamPath% into folder and file for that.
if (varSteamPath= "") {
varSteamPath := oldsteampath
return
}
GuiControl, Text, varSteamPath, %varSteamPath%
gosub, writetofile
Return
writetofile:
; Function that's called when the save button is pressed.
Gui, Submit, NoHide
; Parsing the ahk variables back into boolean format
varShowShortCutscenes := parseNumtoBool(ahkvarShowShortCutscenes)
varShowLongCutscenes := parseNumtoBool(ahkvarShowLongCutscenes)
varUseWinStore := parseNumtoBool(ahkvarUseWinStore)
varCursorLock := parseNumtoBool(ahkvarCursorLock)
varAlwaysShowKS := parseNumtoBool(ahkvarAlwaysShowKS)
varInvertSwim := parseNumtoBool(ahkvarInvertSwim)
varDisableDebug := parseNumToBool(ahkvarDisableDebug)
varDisableQuestSnap := parseNumtoBool(ahkvarDisableQuestSnap)
varRandomCurrencyNames := parseNumtoBool(1-ahkvarRandomCurrencyNames)
varLaunchTracker := parseNumtoBool(ahkvarLaunchTracker)
varSkipUpdate := parseNumtoBool(1-ahkvarAutoUpdate)
varMouseBurrow := parseNumtoBool(ahkvarMouseBurrow)
varMouseWDash := parseNumtoBool(ahkvarMouseWDash)
varMouseGrapple := parseNumtoBool(ahkvarMouseGrapple)
varBetaVersions := parseNumtoBool(ahkvarBetaVersions)
varHideQuestFilter := parseNumtoBool(ahkvarHideQuestFilter)
varHideWarpFilter := parseNumtoBool(ahkvarHideWarpFilter)
varHideCollectableFilter := parseNumtoBool(ahkvarHideCollectableFilter)
varAlwaysShowWarps := parseNumtoBool(ahkvarAlwaysShowWarps)
varDisableNetcode := parseNumtoBool(ahkvarDisableNetcode)
; Writing the new values to file.
IniWrite, %varSkipUpdate%, %inipath%, Flags, SkipUpdate
IniWrite, %varShowShortCutscenes%, %inipath%, Flags, ShowShortCutscenes
IniWrite, %varShowLongCutscenes%, %inipath%, Flags, ShowLongCutscenes
IniWrite, %varUseWinStore%, %inipath%, Flags, UseWinStore
IniWrite, %varCursorLock%, %inipath%, Flags, CursorLock
IniWrite, %varAlwaysShowKS%, %inipath%, Flags, AlwaysShowKeystones
IniWrite, %varInvertSwim%, %inipath%, Flags, InvertSwim
IniWrite, %varDisableDebug%, %inipath%, Flags, DisableDebugControls
IniWrite, %varDisableQuestSnap%, %inipath%, Flags, QuestFocusOnAbility3
IniWrite, %varRandomCurrencyNames%, %inipath%, Flags, BoringMoney
IniWrite, %varLaunchTracker%, %inipath%, Flags, LaunchWithTracker
IniWrite, %varMouseBurrow%, %inipath%, Flags, BurrowMouseControl
IniWrite, %varMouseWDash%, %inipath%, Flags, WaterDashMouseControl
IniWrite, %varMouseGrapple%, %inipath%, Flags, GrappleMouseControl
IniWrite, %varBetaVersions%, %inipath%, Flags, BetaVersions
IniWrite, %varHideQuestFilter%, %inipath%, Flags, HideQuestFilter
IniWrite, %varHideWarpFilter%, %inipath%, Flags, HideWarpFilter
IniWrite, %varHideCollectableFilter%, %inipath%, Flags, HideCollectableFilter
IniWrite, %varAlwaysShowWarps%, %inipath%, Flags, AlwaysShowWarps
IniWrite, %varSteamPath%, %inipath%, Paths, Steam
IniWrite, %varDisableNetcode%, %inipath%, Flags, DisableNetcode
return
Help(wParam, lParam, Msg) {
MouseGetPos,,,, OutputVarControl
ControlGetText, HoverText, %OutputVarControl%
IfEqual, HoverText, Cursor Lock ; Text based recognition didnt seem to work sadly.
Help := "Locks the cursor to the game window, preventing the mouse from moving off screen."
else IfEqual, HoverText, Invert Swim Speeds
Help := "Inverts the hold-space-to-swim-faster mechanic.`nHolding space will make you swim slower instead."
else IfEqual, HoverText, Disable Quest Snap on Mouseover
Help := "Checking this option prevents the map from scrolling to a quest location when hovering over a quest in the`nquest list. (You can still scroll to a quest by pressing your Ability3 bind while hovering)"
else IfEqual, HoverText, Disable Debug Controls
Help := "Disables debug controls on game launch.`nToggle debug controls on/off with Ctrl+Alt+D."
else IfEqual, HoverText, Restore Short Cutscenes
Help := "Enables the short-but-unskippable cutscenes normally removed by the randomizer."
else IfEqual, HoverText, Restore Long Cutscenes
Help := "Enables the long, unskippable cutscenes normally removed by the randomizer."
else IfEqual, HoverText,Hide Quest Filter
Help := "Never show the Quests filter in the in-game map"
else IfEqual, HoverText,Hide Warp Filter
Help := "Never show the Warp filter in the in-game map"
else IfEqual, HoverText,Hide Collectable Filter
Help := "Never show the Collectables filter in the in-game map"
else IfEqual, HoverText,Always Show Warps
Help := "Always show Spirit Wells on the in-game map, no matter what filter"
else IfEqual, HoverText, Mouse Aiming: Water Dash
Help := "Enables aiming Water Dash with your mouse cursor"
else IfEqual, HoverText, Mouse Aiming: Burrow
Help := "Enables aiming Burrow with your mouse cursor"
else IfEqual, HoverText, Mouse Aiming: Grapple
Help := "Enables aiming Grapple with your mouse cursor"
else IfEqual, HoverText, Automatic Updates
Help := "Allows the randomizer to check for new updates on launch. Highly recommended!"
else IfEqual, HoverText,Beta Versions
Help := "Allows the randomizer to update to beta versions in need of testing. We appreciate the help!"
else IfEqual, HoverText, Use Windows Store
Help := "Launch the rando using the windows store version of the game."
else IfEqual, HoverText, Launch with Item Tracker
Help := "Automatically open the item tracker when launching the randomizer"
else IfEqual, HoverText, Disable Netcode
Help := "Checking this option prevents the randomizer from communicating with the rando server.`nWith netcode disabled, bingo autotracking and other networked features will be unavailable.`nNote: Netcode uses Discord OAuth to identify users to the webserver."
else IfEqual, HoverText, Random Currency Names
Help := "This option changes the text of Spirit Light pickups to a random currency name.`nIt has no impact on gameplay."
else IfEqual, HoverText, Always Show Keystones
Help := "Always display your keystone count in the top left corner."
SetTimer, DisableTT, -3000
ToolTip % Help
}
DisableTT:
ToolTip,
return
GuiClose:
ExitApp