@@ -1,3 +1,4 @@
1+from unity8 import get_grid_size
1from unity8.shell.emulators import Unity8EmulatorBase
2from unity8.shell.emulators import Unity8EmulatorBase
2from autopilot.input import Touch
3from autopilot.input import Touch
@@ -40,13 +41,9 @@ class Hud(Unity8EmulatorBase):
40 x, y = self.get_close_button_coords()
41 x, y = self.get_close_button_coords()
41 touch.tap(x, y)
42 touch.tap(x, y)
43− # TODO: Should grid_size be passed in or should we have a get_grid_size in
44− # unity8.__init__ that reads it from the env.
45− # Yeah I think so as it doesn't seem to make sense when passing it in.
46− # Plus as above shows, we don't always have it.
47− def get_close_button_coords(self, grid_size):
44+ def get_close_button_coords(self):
48 """Returns the coordinates of the Huds close button bar."""
45 """Returns the coordinates of the Huds close button bar."""
49 rect = self.globalRect
46 rect = self.globalRect
50 x = int(rect[0] + rect[2] / 2)
47 x = int(rect[0] + rect[2] / 2)
51− y = rect[1] + grid_size
48+ y = rect[1] + get_grid_size()
52 return x, y
49 return x, y