forked from 1Defence/Client-Launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Launcher Utilites.ahk
67 lines (53 loc) · 1.65 KB
/
Launcher Utilites.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
#SingleInstance force
;set background to black
TransColor = 000000
Gui, Color, %transColor%
;add relevant buttons
Gui, Add, Button, x12 y9 w160 h60 gSETTINGS_PATH, Settings Path
Gui, Add, Button, x172 y9 w160 h60 gCLIENT_PATH, Client Path
Gui, Add, Button, x332 y9 w160 h60 gCLIENT_TITLE, Client Title
Gui, Add, Button, x12 y69 w480 h60 gRESET_CONFIGS, Reset all of the above
Gui, Add, Button, x12 y139 w160 h60 gRENAME_LAUNCHER, Rename Launcher
Gui, Add, Button, x172 y139 w160 h60 gDELETE_LAUNCHER, Delete Launcher
Gui, Add, Button, x332 y139 w160 h60 gDELETE_LAUNCHERS_ALL, Delete All Launchers
Gui, Add, Button, x12 y209 w480 h60 gTERMINATE_RUNNING_CLIENTS, Terminate All Running Clients
;show gui
Gui, Show, w507 h284, Launcher Utilities
return
;the below functions, will call the runahk function with the relevant ahk script name
SETTINGS_PATH:
RunAHK("Set Settings Path")
return
CLIENT_PATH:
RunAHK("Set Client Path")
return
CLIENT_TITLE:
RunAHK("Set Client Title")
return
RESET_CONFIGS:
RunAHK("Reset Configs")
return
RENAME_LAUNCHER:
RunAHK("Rename Launcher")
return
DELETE_LAUNCHER:
RunAHK("Delete Launcher")
return
DELETE_LAUNCHERS_ALL:
RunAHK("DELETE ALL LAUNCHERS")
return
TERMINATE_RUNNING_CLIENTS:
RunAHK("Kill All Active Clients")
return
;end of utility calls
RunAHK(ahkName){
;play notifcation feed back sound.
SoundPlay, %A_WinDir%\Media\notify.wav
;run the desired utility script
path := % """" . A_ScriptDir . "\utilities\" . ahkName . ".ahk" . """"
run %A_AhkPath% %path%
}
;Indicate that the script should exit automatically when the window is closed.
GuiClose:
ExitApp
return