-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.ahk
More file actions
40 lines (34 loc) · 1.3 KB
/
Copy pathutils.ahk
File metadata and controls
40 lines (34 loc) · 1.3 KB
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
hide := false
; official AHK v2 documentation says "/restart" works compiled, but it doesn't seem to recognize the argument
; on reload and starts it as a new session. "/reload /restart" is being used here instead, because "/restart"
; terminates the instance, while "/reload" ensures it's handled as the current session since it isn't a switch
; this is so ShowHotkeys() is only shown on a new session, as it might be a nuisance to close it every reload.
ReloadProgram := () => Run(A_IsCompiled
? A_ScriptFullPath . " /reload /restart" ; .exe
: A_AhkPath . " " . A_ScriptFullPath . " /reload /restart" ; .ahk
)
WaitToContinue(ms, Callback) {
Sleep(ms)
Callback()
}
ShowHotkeys() {
MsgBox(" "
. " F8: Hide Overlay `n`n"
. "F12: Reload Program"
, "Hotkeys"
)
}
HideOverlay(overlay) {
global hide
hide := !hide
hide ? overlay.Hide() : overlay.Show()
}
TempMsgBox(text, timeout := 3000) {
message := Gui("+AlwaysOnTop +ToolWindow -Caption")
message.Add("Text", , text)
message.Show("AutoSize Center")
SetTimer(() => message.Destroy(), -timeout)
}
WarningBox(message, title := "Warning", Callback := (*) => "") {
MsgBox(message, title, "OKCancel Icon!") = "OK" ? Callback() : ExitApp()
}