Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Elements-0.12-py2.5.eggbin55899 -> 0 bytes
-rw-r--r--lib/Elements-0.12-py2.6.eggbin0 -> 57149 bytes
-rw-r--r--physics.py2
-rw-r--r--tools.py8
4 files changed, 9 insertions, 1 deletions
diff --git a/lib/Elements-0.12-py2.5.egg b/lib/Elements-0.12-py2.5.egg
deleted file mode 100644
index d9bc609..0000000
--- a/lib/Elements-0.12-py2.5.egg
+++ /dev/null
Binary files differ
diff --git a/lib/Elements-0.12-py2.6.egg b/lib/Elements-0.12-py2.6.egg
new file mode 100644
index 0000000..224ad46
--- /dev/null
+++ b/lib/Elements-0.12-py2.6.egg
Binary files differ
diff --git a/physics.py b/physics.py
index a9f2cef..b945671 100644
--- a/physics.py
+++ b/physics.py
@@ -20,7 +20,7 @@ import pygame
from pygame.locals import *
from pygame.color import *
import olpcgames
-sys.path.append("lib/Elements-0.12-py2.5.egg")
+sys.path.append("lib/Elements-0.12-py2.6.egg")
sys.path.append("lib/Box2D-2.0.2b1-py2.5-linux-i686.egg")
import Box2D as box2d
import elements
diff --git a/tools.py b/tools.py
index 1b20da9..2aced3e 100644
--- a/tools.py
+++ b/tools.py
@@ -4,6 +4,7 @@
# By Alex Levenson
#==================================================================
import pygame
+import olpcgames
from pygame.locals import *
from helpers import *
from inspect import getmro
@@ -33,6 +34,13 @@ class Tool(object):
elif event.type == USEREVENT:
if hasattr(event,"action"):
if self.game.toolList.has_key(event.action): self.game.setTool(event.action)
+ if hasattr(event,"code"):
+ if event.code == olpcgames.FILE_WRITE_REQUEST:
+ #saving to journal
+ self.game.world.pickle_save(event.filename)
+ if event.code == olpcgames.FILE_READ_REQUEST:
+ #loading from journal
+ self.game.world.pickle_load(event.filename)
elif event.type == MOUSEBUTTONDOWN and event.button == 1:
self.game.canvas.grab_focus()
handled = False