diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-12-21 13:42:22 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-12-21 13:42:22 (GMT) |
commit | eff264857d005719f081eb9fea1e8b099670d395 (patch) | |
tree | a72e25a9f519ab3f910fcbd9dc1bb0f3514c720c /activity.py | |
parent | 1587e845fc046bb63c81a0babc155186bcaf2fe7 (diff) |
Fix cursor bug, try to fix journal data
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 18 |
1 files changed, 17 insertions, 1 deletions
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")) |