diff --git a/blog/V1.11.Minor.md b/blog/V1.11.Minor.md index fdfc07bec..12d00f72a 100644 --- a/blog/V1.11.Minor.md +++ b/blog/V1.11.Minor.md @@ -23,6 +23,9 @@ title: Version 1.11 > Minor This changelog will contain all changes from 1.11.0 onwards before the next major version. !!! +==- Version 1.11.54 +The data collection for the mirror images is now finally fixed and we can start collecting usable data. +[!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="VehicleDetection, DataCollection"] ==- Version 1.11.54 Made adjustments to the mirror data collection. [!badge variant="dark" text="Glas42"] [!badge variant="ghost" text="VehicleDetection, DataCollection"] diff --git a/changelog.txt b/changelog.txt index 333f293f0..9d7885391 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1 +1 @@ -Made adjustments to the mirror data collection. \ No newline at end of file +The data collection for the mirror images is now finally fixed and we can start collecting usable data. \ No newline at end of file diff --git a/plugins/DataCollection/main.py b/plugins/DataCollection/main.py index 60ceff779..895499cbd 100644 --- a/plugins/DataCollection/main.py +++ b/plugins/DataCollection/main.py @@ -82,7 +82,7 @@ def CalculateMirrorCoordinates(window): mirrorDistanceFromTop = 262 mirrorWidth = 210 mirrorHeight = 190 - scale = window[3]/1080 + scale = (window[3] - window[1])/1080 xCoord = window[0] + (mirrorDistanceFromLeft * scale) yCoord = window[1] + (mirrorDistanceFromTop * scale) diff --git a/src/helpers.py b/src/helpers.py index 633068b15..f47f79382 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -558,9 +558,12 @@ def GetGameWindowPosition(): titles = gw.getAllTitles() for title in titles: if title == "Euro Truck Simulator 2" or title == "Euro Truck Simulator 2 - Multiplayer" or title == "American Truck Simulator" or title == "American Truck Simulator - Multiplayer": - window = gw.getWindowsWithTitle(title)[0] - window = window.topleft[0], window.topleft[1], window.bottomright[0], window.bottomright[1] - return window + hwnd = win32gui.FindWindow(None, title) + rect = win32gui.GetClientRect(hwnd) + tl = win32gui.ClientToScreen(hwnd, (rect[0], rect[1])) + br = win32gui.ClientToScreen(hwnd, (rect[2], rect[3])) + window_position = (tl[0], tl[1], br[0], br[1]) + return window_position return None def IsGameWindowForegroundWindow(): diff --git a/version.txt b/version.txt index 7f42d6b41..0c9970226 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.11.55 \ No newline at end of file +1.11.56 \ No newline at end of file