Skip to content

Commit

Permalink
The data collection for the mirror images is now finally fixed and we…
Browse files Browse the repository at this point in the history
… can start collecting usable data.
  • Loading branch information
Glas42 committed Jul 7, 2024
1 parent 2733ed9 commit 22b9bcf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions blog/V1.11.Minor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Made adjustments to the mirror data collection.
The data collection for the mirror images is now finally fixed and we can start collecting usable data.
2 changes: 1 addition & 1 deletion plugins/DataCollection/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.55
1.11.56

0 comments on commit 22b9bcf

Please sign in to comment.