From eff264857d005719f081eb9fea1e8b099670d395 Mon Sep 17 00:00:00 2001 From: Daniel Francis Date: Fri, 21 Dec 2012 13:42:22 +0000 Subject: Fix cursor bug, try to fix journal data Signed-off-by: Daniel Francis --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index b61d732..764470b 100644 --- a/activity.py +++ b/activity.py @@ -37,6 +37,8 @@ except ImportError: # <= 0.84 toolbars pass +import olpcgamesutil + class PhysicsActivity(activity.Activity): def __init__(self, handle): @@ -56,7 +58,20 @@ class PhysicsActivity(activity.Activity): # Start the game running. self._canvas.run_pygame(self.game.run) - + + def read_file(self, file_path): + event = pygame.event.Event(pygame.USEREVENT) + event.code = olpcgamesutil.FILE_READ_REQUEST + event.filename = file_path + event.metadata = self.metadata + self._canvas.translator._post(event) + + def write_file(self, file_path): + event = pygame.event.Event(pygame.USEREVENT, + code = olpcgamesutil.FILE_WRITE_REQUEST, + filename = file_path, + metadata = self.metadata) + self.canvas.translator._post(event) def get_preview(self): """Custom preview code to get image from pygame. @@ -181,6 +196,7 @@ class PhysicsActivity(activity.Activity): pygame.event.post(pygame.event.Event(pygame.USEREVENT, action="focus_out")) else: + self.game.show_fake_cursor = True pygame.event.post(pygame.event.Event(pygame.USEREVENT, action="focus_in")) -- cgit v0.9.1