diff --git a/EVE-X-Preview.json b/EVE-X-Preview.json index c6382cd..dddeb19 100644 --- a/EVE-X-Preview.json +++ b/EVE-X-Preview.json @@ -268,6 +268,111 @@ "AutoForwardToggleHotkey":"SC029", "BackwardsHotkey":"+Tab", "Characters":[ + "Tertiale", + "Quartio", + "PhatPhuckDave" + ], + "ForwardsHotkey":"Tab" + } + }, + "Hotkeys":[ + { + "PhatPhuckDave":"lalt & 1" + }, + { + "Primorium":"lalt & 2" + }, + { + "Secundamen":"lalt & 3" + }, + { + "Tertiale":"lalt & 4" + }, + { + "Quartio":"lalt & 5" + } + ], + "Thumbnail Positions":{}, + "Thumbnail Settings":{ + "ClientHighligtBorderthickness":4, + "ClientHighligtColor":"#E36A0D", + "HideThumbnailsOnLostFocus":0, + "InactiveClientBorderColor":"#8A8A8A", + "InactiveClientBorderthickness":2, + "ShowAllColoredBorders":0, + "ShowClientHighlightBorder":1, + "ShowThumbnailTextOverlay":1, + "ShowThumbnailsAlwaysOnTop":1, + "ThumbnailOpacity":80, + "ThumbnailTextColor":"#FAC57A", + "ThumbnailTextFont":"Gill Sans MT", + "ThumbnailTextMargins":{ + "x":15, + "y":5 + }, + "ThumbnailTextSize":12 + }, + "Thumbnail Visibility":{} + }, + "Alternate 02":{ + "Client Possitions":{ + "PhatPhuckDave":{ + "IsMaximized":0, + "height":1440, + "width":2560, + "x":0, + "y":0 + }, + "Primorium":{ + "IsMaximized":0, + "height":1440, + "width":2560, + "x":0, + "y":0 + }, + "Secundamen":{ + "IsMaximized":0, + "height":1440, + "width":2560, + "x":0, + "y":0 + } + }, + "Client Settings":{ + "AlwaysMaximize":0, + "Dont_Minimize_Clients":[ + "Example Name1", + "Example Name2", + "Example Name3" + ], + "MinimizeInactiveClients":0, + "TrackClientPossitions":1 + }, + "Custom Colors":{ + "cColorActive":"0", + "cColors":{ + "Bordercolor":[ + "FFFFFF" + ], + "CharNames":[ + "PhatPhuckDave" + ], + "IABordercolor":[ + "FFFFFF" + ], + "TextColor":[ + "FFFFFF" + ] + } + }, + "Hotkey Groups":{ + "Daves":{ + "AutoForwardOnKeypress":1, + "AutoForwardToggle":1, + "AutoForwardToggleHotkey":"SC029", + "BackwardsHotkey":"+Tab", + "Characters":[ + "PhatPhuckDave", "Tertiale", "Quartio" ], @@ -381,6 +486,7 @@ } }, "global_Settings":{ + "AddCharacterToGroupHotkey":"^SC029", "AutoForwardDelay":15, "CharScreenHotkey":"", "CharacterNameOverlayHotkeyColor":"AAAAAA", diff --git a/Lib/DefaultJSON.ahk b/Lib/DefaultJSON.ahk index d6de3f9..8f1644c 100644 --- a/Lib/DefaultJSON.ahk +++ b/Lib/DefaultJSON.ahk @@ -31,7 +31,8 @@ "CharacterNameOverlayTextBold": true, "CharacterNameOverlayHotkeySize": 14, "CharacterNameOverlayHotkeyColor": "AAAAAA", - "AutoForwardDelay": 0 + "AutoForwardDelay": 0, + "AddCharacterToGroupHotkey": "" }, "_Profiles": { "Default": { diff --git a/src/Main_Class.ahk b/src/Main_Class.ahk index 1115546..ac23c34 100644 --- a/src/Main_Class.ahk +++ b/src/Main_Class.ahk @@ -49,6 +49,7 @@ AutoForwardTimerPending := false ; Flag to prevent multiple timers from being scheduled CharacterNameOverlay := 0 ; GUI overlay for displaying current character name CharacterNameOverlayLastText := "" ; Track last displayed text to prevent flashing + LastActiveCharacter := "" ; Track last active character for AddCharacterToGroup CharacterNameOverlayX := 0 ; Stored X position for dragging CharacterNameOverlayY := 0 ; Stored Y position for dragging CharacterNameOverlayDragging := false ; Flag for drag state @@ -91,6 +92,17 @@ } } + ; Register Hotkey for Add Character to Group if the user has it Set + if (This.AddCharacterToGroupHotkey != "") { + HotIf (*) => WinExist(This.EVEExe) + try { + Hotkey This.AddCharacterToGroupHotkey, ( * ) => This.AddCharacterToGroup(), "S1" + } + catch ValueError as e { + MsgBox(e.Message ": --> " e.Extra " <-- in: Global Settings -> Add Character to Group-Hotkey" ) + } + } + ; The Timer property for Asycn Minimizing. this.timer := ObjBindMethod(this, "EVEMinimize") This.Register_CharSelectionScreen_Hotkeys() @@ -161,6 +173,8 @@ if (WinActive(This.EVEExe)) { activeTitle := This.CleanTitle(WinGetTitle("A")) if (activeTitle != "" && activeTitle != This.CharacterNameOverlayLastText) { + if (This.CharacterNameOverlayLastText != "") + This.LastActiveCharacter := This.CharacterNameOverlayLastText This.CharacterNameOverlayLastText := activeTitle This.CharacterNameOverlay["CharacterNameText"].Text := activeTitle } @@ -1189,6 +1203,53 @@ } + AddCharacterToGroup(*) { + if (!WinActive(This.EVEExe)) + return + + currentTitle := This.CleanTitle(WinGetTitle("A")) + if (currentTitle = "") + return + + targetGroupName := "" + searchCharacter := This.LastActiveCharacter != "" ? This.LastActiveCharacter : currentTitle + + if (IsObject(This.Hotkey_Groups) && This.Hotkey_Groups.Count != 0) { + for groupName, groupData in This.Hotkey_Groups { + if (IsObject(groupData["Characters"])) { + for index, charName in groupData["Characters"] { + if (charName = searchCharacter) { + targetGroupName := groupName + break + } + } + if (targetGroupName != "") + break + } + } + } + + if (targetGroupName = "") + return + + if (!IsObject(This.Hotkey_Groups[targetGroupName]["Characters"])) + This.Hotkey_Groups[targetGroupName]["Characters"] := [] + + alreadyInGroup := false + for index, charName in This.Hotkey_Groups[targetGroupName]["Characters"] { + if (charName = currentTitle) { + alreadyInGroup := true + break + } + } + + if (!alreadyInGroup) { + This.Hotkey_Groups[targetGroupName]["Characters"].Push(currentTitle) + SetTimer(This.Save_Settings_Delay_Timer, -200) + This.NeedRestart := 1 + } + } + SaveJsonToFile() { FileDelete("EVE-X-Preview.json") FileAppend(JSON.Dump(This._JSON, , " "), "EVE-X-Preview.json") diff --git a/src/Propertys.ahk b/src/Propertys.ahk index 0d47108..d31a564 100644 --- a/src/Propertys.ahk +++ b/src/Propertys.ahk @@ -124,6 +124,11 @@ class Propertys extends TrayMenu { set => This._JSON["global_Settings"]["AutoForwardDelay"] := value } + AddCharacterToGroupHotkey { + get => This._JSON["global_Settings"]["AddCharacterToGroupHotkey"] + set => This._JSON["global_Settings"]["AddCharacterToGroupHotkey"] := value + } + ;######################## ;## Profile ThumbnailSettings diff --git a/src/Settings_Gui.ahk b/src/Settings_Gui.ahk index d14465b..14d19d8 100644 --- a/src/Settings_Gui.ahk +++ b/src/Settings_Gui.ahk @@ -108,9 +108,10 @@ Global_Settings(visible?) { This.S_Gui.Controls.Global_Settings := [] This.S_Gui.SetFont("s10 w400") - This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("GroupBox", "x20 y80 h340 w500") + This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("GroupBox", "x20 y80 h360 w500") This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xp+15 yp+20 Section", "Reload Script - Hotkey:") This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+20 Section", "Char selection Screen- Hotkey:") + This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+20", "Add Character to Group - Hotkey:") This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Hotkey activation Scope:") This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Thumbnail Background Color:") This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Thumbnail Default Location:") @@ -125,6 +126,8 @@ This.S_Gui["Reload_Script_Hotkey"].OnEvent("Change", (obj, *) => gSettings_EventHandler(obj)) This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Edit", "xp y+10 w150 Section vCharScreenHotkey", This.CharScreenHotkey) This.S_Gui["CharScreenHotkey"].OnEvent("Change", (obj, *) => gSettings_EventHandler(obj)) + This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Edit", "xp y+10 w150 Section vAddCharacterToGroupHotkey", This.AddCharacterToGroupHotkey) + This.S_Gui["AddCharacterToGroupHotkey"].OnEvent("Change", (obj, *) => gSettings_EventHandler(obj)) This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("DDL", "xp y+5 w180 vTTT vHotkey_Scoope Choose" (This.Global_Hotkeys ? 1 : 2), ["Global", "If an EVE window is Active"]) This.S_Gui["Hotkey_Scoope"].OnEvent("Change", (obj, *) => gSettings_EventHandler(obj)) @@ -224,6 +227,10 @@ This.CharScreenHotkey := obj.value This.NeedRestart := 1 } + else if (obj.name = "AddCharacterToGroupHotkey") { + This.AddCharacterToGroupHotkey := obj.value + This.NeedRestart := 1 + } SetTimer(This.Save_Settings_Delay_Timer, -200) } } @@ -805,6 +812,8 @@ Refresh_ControlValues() { ; Global Settings This.S_Gui["Reload_Script_Hotkey"].value := This.Reload_Script_Hotkey + This.S_Gui["CharScreenHotkey"].value := This.CharScreenHotkey + This.S_Gui["AddCharacterToGroupHotkey"].value := This.AddCharacterToGroupHotkey This.S_Gui["Hotkey_Scoope"].value := (This.Global_Hotkeys ? 1 : 2) This.S_Gui["ThumbnailBackgroundColor"].value := This.ThumbnailBackgroundColor This.S_Gui["ThumbnailStartLocationx"].value := This.ThumbnailStartLocation["x"]