Bugfix in Hotkeygroups

This commit is contained in:
g0nzo83
2024-02-24 16:46:43 +01:00
parent 0b59664f4e
commit 87bbbcf926
2 changed files with 17 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ A_MaxHotKeysPerInterval := 10000
TODO #########################
*/
;@Ahk2Exe-Let U_version = 1.0.1.
;@Ahk2Exe-Let U_version = 1.0.2.
;@Ahk2Exe-SetVersion %U_version%
;@Ahk2Exe-SetFileVersion %U_version%
;@Ahk2Exe-SetCopyright gonzo83
@@ -68,7 +68,7 @@ Load_JSON() {
DJSON,
JSON.Load(FileRead("EVE-X-Preview.json"))
)
FileDelete("EVE-X-Preview.json")
FileDelete("EVE-X-Preview.json")
FileAppend(JSON.Dump(_JSON,," " ), "EVE-X-Preview.json")
}
catch as e {

View File

@@ -223,7 +223,7 @@ Class Main_Class extends ThumbWindow {
if(This.Global_Hotkeys) {
if( v["ForwardsHotkey"] != "" ) {
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
HotIf (*) => This.OneWinExist(Arr) && !WinActive("EVE-X-Preview - Settings")
HotIf ObjBindMethod(This, "OnWinExist", Arr)
try {
Hotkey( v["ForwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"ForwardsHotkey"), "P1")
}
@@ -233,7 +233,7 @@ Class Main_Class extends ThumbWindow {
}
if( v["BackwardsHotkey"] != "" ) {
Fkey := v["BackwardsHotkey"], Arr := v["Characters"]
HotIf (*) => This.OneWinExist(Arr) && !WinActive("EVE-X-Preview - Settings")
HotIf ObjBindMethod(This, "OnWinExist", Arr)
try {
Hotkey( v["BackwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"BackwardsHotkey"), "P1")
}
@@ -246,7 +246,7 @@ Class Main_Class extends ThumbWindow {
else {
if( v["ForwardsHotkey"] != "" ) {
Fkey := v["ForwardsHotkey"], Arr := v["Characters"]
HotIf (*) => This.OneWinExist(Arr) && WinActive("Ahk_exe exefile.exe")
HotIf ObjBindMethod(This, "OnWinActive", Arr)
try {
Hotkey( v["ForwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"ForwardsHotkey"), "P1")
}
@@ -256,7 +256,7 @@ Class Main_Class extends ThumbWindow {
}
if( v["BackwardsHotkey"] != "" ) {
Fkey := v["BackwardsHotkey"], Arr := v["Characters"]
HotIf (*) => This.OneWinExist(Arr) && WinActive("Ahk_exe exefile.exe")
HotIf ObjBindMethod(This, "OnWinActive", Arr)
try {
Hotkey( v["BackwardsHotkey"], ObjBindMethod(This, "Cycle_Hotkey_Groups",Arr,"BackwardsHotkey"), "P1")
}
@@ -281,7 +281,7 @@ Class Main_Class extends ThumbWindow {
if (Index > length)
Index := 1
if (This.OneWinExist(Arr)) {
if (This.OnWinExist(Arr)) {
Try {
if !(WinExist("EVE - " This.CleanTitle(Arr[Index]))) {
while (!(WinExist("EVE - " This.CleanTitle(Arr[Index])))) {
@@ -301,7 +301,7 @@ Class Main_Class extends ThumbWindow {
if (Index <= 0)
Index := length
if (This.OneWinExist(Arr)) {
if (This.OnWinExist(Arr)) {
if !(WinExist("EVE - " This.CleanTitle(Arr[Index]))) {
while (!(WinExist("EVE - " This.CleanTitle(Arr[Index])))) {
Index -= 1
@@ -323,13 +323,19 @@ Class Main_Class extends ThumbWindow {
}
; To Check if atleast One Win stil Exist in the Array for the cycle groups hotkeys
OneWinExist(Arr, *) {
OnWinExist(Arr, *) {
for index, Name in Arr {
If WinExist("EVE - " Name " Ahk_Exe exefile.exe")
If ( WinExist("EVE - " Name " Ahk_Exe exefile.exe") && !WinActive("EVE-X-Preview - Settings") ) {
return true
}
}
return false
}
OnWinActive(Arr, *) {
If (This.OnWinExist(Arr) && WinActive("Ahk_exe exefile.exe")) {
return true
}
return false
}
;## Updates the Thumbnail in the GUI after Activation