Add new functions

Add Option to disable Thumbnails completly.
Add function to cycle through clients in char-selection screen.
Maintain Thumbnailposition if the clients goes into char-selection screen.

Co-Authored-By: cryonox <113977326+cryonox@users.noreply.github.com>
This commit is contained in:
g0nzo83
2025-04-21 12:42:52 +02:00
parent b5902250f8
commit ace311634b
6 changed files with 129 additions and 82 deletions

View File

@@ -68,6 +68,7 @@ Class Main_Class extends ThumbWindow {
; The Timer property for Asycn Minimizing.
this.timer := ObjBindMethod(this, "EVEMinimize")
This.Register_CharSelectionScreen_Hotkeys()
;margins for DwmExtendFrameIntoClientArea. higher values extends the shadow
This.margins := Buffer(16, 0)
@@ -90,6 +91,7 @@ Class Main_Class extends ThumbWindow {
;Register the Hotkeys for cycle groups
This.Register_Hotkey_Groups()
This.BorderActive := 0
This.ClientsInCharScreen := Map()
return This
}
@@ -102,26 +104,42 @@ Class Main_Class extends ThumbWindow {
return
; If any EVE Window exist
if (WinList.Length) {
try {
;Check if a window exist without Thumbnail and if the user is in Character selection screen or not
for index, hwnd in WinList {
WinList.%hwnd% := { Title: This.CleanTitle(WinGetTitle(hwnd)) }
if !This.ThumbWindows.HasProp(hwnd) {
This.EVE_WIN_Created(hwnd, WinList.%hwnd%.title)
if (!This.HideThumbnailsOnLostFocus)
This.ShowThumb(hwnd, "Show")
HideShowToggle := 1
}
;if in Character selection screen
else if (This.ThumbWindows.HasProp(hwnd)) {
if (This.ThumbWindows.%hwnd%["Window"].Title != WinList.%hwnd%.Title) {
This.EVENameChange(hwnd, WinList.%hwnd%.Title)
}
}
;Check if a window exist without Thumbnail and if the user is in Character selection screen or not
for index, hwnd in WinList {
WinList.%hwnd% := { Title: This.CleanTitle(WinGetTitle(hwnd)) }
if (WinList.%hwnd%.Title == "") {
This.ClientsInCharScreen[hwnd] := WinList.%hwnd%.Title
}
;if the User disables the Thumbnails we can skip all the code below this
if (This.DisableLiveThumbnail) {
This.DisableLiveThumb(hwnd, WinList.%hwnd%.Title, WinList)
continue
}
if !This.ThumbWindows.HasProp(hwnd) {
This.EVE_WIN_Created(hwnd, WinList.%hwnd%.title)
if (!This.HideThumbnailsOnLostFocus)
This.ShowThumb(hwnd, "Show")
HideShowToggle := 1
}
;if in Character selection screen
else if (This.ThumbWindows.HasProp(hwnd)) {
if (This.ThumbWindows.%hwnd%["Window"].Title != WinList.%hwnd%.Title && WinList.%hwnd%.Title = "") {
This.ThumbWindows.%hwnd%["Window"].Title := "Char Screen"
;This.ThumbWindows.%hwnd%["TextOverlay"]["OverlayText"].value := "Char Screen"
if (This.ThumbWindows.%hwnd%["Window"].Title == "Char Screen" && WinList.%hwnd%.Title != "") {
This.EVENameChange(hwnd, WinList.%hwnd%.Title)
}
}
else if (This.ThumbWindows.%hwnd%["Window"].Title != WinList.%hwnd%.Title) {
This.EVENameChange(hwnd, WinList.%hwnd%.Title)
}
}
}
catch
return
try {
;if HideThumbnailsOnLostFocus is selectet check if a eve window is still in foreground, runs a timer once with a delay to prevent stuck thumbnails
@@ -214,6 +232,52 @@ Class Main_Class extends ThumbWindow {
}
}
Register_CharSelectionScreen_Hotkeys(){
if (This.CharScreenHotkey != "" ) {
HotIf (*) => WinExist("ahk_exe " This.EVEExe)
try {
Hotkey(This.CharScreenHotkey, ObjBindMethod(This, "CycleCharScreen"),"P1" )
}
}
}
CycleCharScreen(*){
static Index := 1
Arr := []
list := ""
WinList := WinGetList(This.EVEExe)
if (WinList != "") {
for index, hwnd in WinList {
if (This.CleanTitle(WinGetTitle(hwnd)) = "")
Arr.Push(hwnd)
}
if (Arr.Length >= 1 ) {
for i, hwnds in Arr {
list .= hwnds ","
}
list := Sort(list, "N D,")
Arr := StrSplit(list, ",")
Arr.Pop()
for i, hwnds in Arr {
index := i
if (WinActive("ahk_id " hwnds)) {
index := i + 1
if (index > Arr.Length)
index := 1
break
}
else {
index := 1
}
}
This.ActivateEVEWindow(Arr[index],,)
}
}
}
;Register the Hotkeys for cycle Groups if any set
Register_Hotkey_Groups() {
static Fkey := "", BKey := "", Arr := []
@@ -321,6 +385,18 @@ Class Main_Class extends ThumbWindow {
return false
}
}
DisableLiveThumb(hwnd, title, arr) {
for hwnds, name in This.ThumbWindows.Clone().OwnProps() {
if (!arr.HasProp(hwnds)) {
This.ThumbWindows.DeleteProp(hwnds)
}
}
if !(This.ThumbWindows.HasProp(hwnd)) {
This.ThumbWindows.%hwnd% := ""
This.RegisterHotkeys(title, hwnd)
}
}
; To Check if atleast One Win stil Exist in the Array for the cycle groups hotkeys
OnWinExist(Arr, *) {
@@ -551,7 +627,7 @@ Class Main_Class extends ThumbWindow {
; gets called by the timer to run async
EVEMinimize() {
for EveHwnd, GuiObj in This.ThumbWindows.OwnProps() {
ThumbHwnd := GuiObj["Window"].Hwnd
;ThumbHwnd := GuiObj["Window"].Hwnd
try
WinTitle := WinGetTitle("Ahk_Id " EveHwnd)
catch

View File

@@ -33,11 +33,19 @@ class Propertys extends TrayMenu {
;######################
;## global Settings
CharScreenHotkey {
get => This._JSON["global_Settings"]["CharScreenHotkey"]
set => This._JSON["global_Settings"]["CharScreenHotkey"] := value
}
DisableLiveThumbnail {
get => This._JSON["global_Settings"]["DisableLiveThumbnail"]
set => This._JSON["global_Settings"]["DisableLiveThumbnail"] := value
}
ThumbnailStartLocation[key] {
get => This._JSON["global_Settings"]["ThumbnailStartLocation"][key]
set => This._JSON["global_Settings"]["ThumbnailStartLocation"][key] := value
}
Minimizeclients_Delay {

View File

@@ -108,8 +108,9 @@
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 h280 w500")
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("Text", "xp+15 yp+20 Section", "Suspend Hotkeys - 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+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:")
@@ -117,9 +118,13 @@
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Thumbnail Snap:")
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Thumbnail Snap Distance:")
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Minimize EVE Window Delay:")
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Text", "xs y+15", "Disable Live Thumbnail")
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Edit", "xs+230 ys-3 w150 Section vSuspend_Hotkeys_Hotkey", This.Suspend_Hotkeys_Hotkey)
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Edit", "xs+230 ys-37 w150 Section vSuspend_Hotkeys_Hotkey", This.Suspend_Hotkeys_Hotkey)
This.S_Gui["Suspend_Hotkeys_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("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))
@@ -164,6 +169,9 @@
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("Edit", "xp+80 yp-3 w40 vMinimizeclients_Delay", This.Minimizeclients_Delay)
This.S_Gui["Minimizeclients_Delay"].OnEvent("Change", (obj, *) => gSettings_EventHandler(obj))
This.S_Gui.Controls.Global_Settings.Push This.S_Gui.Add("CheckBox", "xs y+10 vDisableLiveThumbnail Checked" This.DisableLiveThumbnail)
This.S_Gui["DisableLiveThumbnail"].OnEvent("Click", (obj, *) => gSettings_EventHandler(obj))
gSettings_EventHandler(obj) {
if (obj.name = "Suspend_Hotkeys_Hotkey") {
This.Suspend_Hotkeys_Hotkey := Trim(obj.value, "`n ")
@@ -208,6 +216,14 @@
This.Minimizeclients_Delay := obj.value
This.NeedRestart := 1
}
else if (obj.name = "DisableLiveThumbnail") {
This.DisableLiveThumbnail := obj.value
This.NeedRestart := 1
}
else if (obj.name = "CharScreenHotkey") {
This.CharScreenHotkey := obj.value
This.NeedRestart := 1
}
SetTimer(This.Save_Settings_Delay_Timer, -200)
}
}