@@ -1,3 +1,4 @@
1+from unity8 import get_grid_size
12from unity8.shell.emulators import Unity8EmulatorBase
23from autopilot.input import Touch
34
@@ -40,13 +41,9 @@ class Hud(Unity8EmulatorBase):
4041 x, y = self.get_close_button_coords()
4142 touch.tap(x, y)
4243
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):
4845 """Returns the coordinates of the Huds close button bar."""
4946 rect = self.globalRect
5047 x = int(rect[0] + rect[2] / 2)
51− y = rect[1] + grid_size
48+ y = rect[1] + get_grid_size()
5249 return x, y