-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesignOps.ahk
More file actions
101 lines (85 loc) · 2.47 KB
/
DesignOps.ahk
File metadata and controls
101 lines (85 loc) · 2.47 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
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
/*
PROJECT: DesignOps Assistant
VERSION: 21.1 (Hotfix: Function Conflict)
DESCRIPTION: Главный файл. Исправлено дублирование функции TrayExitApp.
*/
#Requires AutoHotkey v2.0
#SingleInstance Force
FileEncoding "UTF-8"
; === ЗАВИСИМОСТИ ===
; Подключаем JSON здесь для использования в GUI и Config
#Include "Lib\JSON.ahk"
global AppPrompts := Map()
global AppSnippets := Map()
global AppPlugins := Map()
global AppList := Map()
global ScriptActive := true
global GuiDirty := false
; Подключаем модули
#Include "Lib\Config.ahk"
global Config := DesignConfig()
Config.InitDatabase()
#Include "Lib\Runtime.ahk"
#Include "Lib\GUI.ahk"
; --- TRAY MENU ---
A_TrayMenu.Delete()
A_TrayMenu.Add("⚙️ Настройки", TrayOpenSettings)
A_TrayMenu.Add("🔄 Перезагрузить", TrayReloadApp)
A_TrayMenu.Add("❌ Выход", TrayExitApp)
TrayOpenSettings(*) {
ShowSettingsGui()
}
TrayReloadApp(*) {
; Важно: Завершаем воркер перед перезагрузкой, чтобы не оставлять зомби-процессы
try AIWorkerManager.Terminate()
Reload()
}
TrayExitApp(*) {
ExitApp()
}
if FileExist(Config.Assets.IconOn)
TraySetIcon(Config.Assets.IconOn)
; --- BOOTSTRAP ---
RegisterAppHotkeys()
RegisterActiveHotkeys()
; --- CONTROLLER ---
CapsLock:: {
global ScriptActive := !ScriptActive
if (ScriptActive) {
if FileExist(Config.Assets.IconOn)
TraySetIcon(Config.Assets.IconOn)
if (Config.System.UseSounds)
PlaySound(Config.Assets.SoundOn, 1000)
ShowTooltip("🚀 Design Mode: ON")
} else {
if FileExist(Config.Assets.IconOff)
TraySetIcon(Config.Assets.IconOff)
if (Config.System.UseSounds)
PlaySound(Config.Assets.SoundOff, 500)
ShowTooltip("💤 Design Mode: OFF")
}
}
; --- TYPOGRAPHY ---
#HotIf ScriptActive
!-:: Send "{U+2014}"
!SC00C:: Send "{U+2014}"
!+-:: Send "{U+2212}"
!.:: Send "{U+2026}"
!SC034:: Send "{U+2026}"
!Space:: Send "{U+00A0}"
^!Space:: Send "{U+2009}"
!x:: Send "{U+00D7}"
!SC02D:: Send "{U+00D7}"
!r:: Send "{U+20BD}"
!SC013:: Send "{U+20BD}"
!SC01A:: Send "{U+00AB}"
!SC01B:: Send "{U+00BB}"
!SC028:: Send "{U+0301}"
#HotIf
; --- CLEANUP ---
OnExit(AppExit)
AppExit(ExitReason, ExitCode) {
try AIWorkerManager.Terminate()
if FileExist("data.json.tmp")
try FileDelete("data.json.tmp")
}