Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2012-04-10 16:07:04 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2012-04-10 16:07:04 (GMT)
commit43ad8fea2f92a2ebe248862b2cafd3cf8c69bbba (patch)
tree358a01ae36818eaf772965697b534fcdc2939fe7
parent0cbb96ec56dc0faf0d29428cfccf82788e5f7fb7 (diff)
going back to v16 because a regretion.
-rwxr-xr-xactivity.py36
-rw-r--r--activity/activity.info2
-rw-r--r--game.py7
-rwxr-xr-x[-rw-r--r--]po/Maze.pot10
-rw-r--r--po/da.po17
-rw-r--r--po/en.po15
-rw-r--r--po/en_GB.po13
-rw-r--r--po/en_US.po15
8 files changed, 65 insertions, 50 deletions
diff --git a/activity.py b/activity.py
index f21efdd..fec3947 100755
--- a/activity.py
+++ b/activity.py
@@ -1,9 +1,43 @@
+import gtk
import olpcgames
-from gettext import gettext as _
+import pygame
+from sugar.graphics.toolbutton import ToolButton
+from gettext import gettext as _
class MazeActivity(olpcgames.PyGameActivity):
game_name = 'game'
game_title = _('Maze')
game_size = None # let olpcgames pick a nice size for us
+
+ def build_toolbar(self):
+ """Build our Activity toolbar for the Sugar system."""
+ toolbar = super(MazeActivity, self).build_toolbar()
+
+ separator = gtk.SeparatorToolItem()
+ separator.set_expand(True)
+ separator.set_draw(False)
+ toolbar.insert(separator, 0)
+
+ harder_button = ToolButton('create-harder')
+ harder_button.set_tooltip(_('Harder level'))
+ harder_button.connect('clicked', self._harder_button_cb)
+ toolbar.insert(harder_button, 2)
+ harder_button.show()
+
+ easier_button = ToolButton('create-easier')
+ easier_button.set_tooltip(_('Easier level'))
+ easier_button.connect('clicked', self._easier_button_cb)
+ toolbar.insert(easier_button, 2)
+ easier_button.show()
+
+ return toolbar
+
+ def _easier_button_cb(self, button):
+ pygame.event.post(olpcgames.eventwrap.Event(
+ pygame.USEREVENT, action='easier_button'))
+
+ def _harder_button_cb(self, button):
+ pygame.event.post(olpcgames.eventwrap.Event(
+ pygame.USEREVENT, action='harder_button'))
diff --git a/activity/activity.info b/activity/activity.info
index 71c551f..45c5bfc 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -3,7 +3,7 @@ name = Maze
exec = sugar-activity activity.MazeActivity
icon = activity-maze
-activity_version = 15
+activity_version = 16
show_launcher = yes
host_version = 1
license = GPLv3+
diff --git a/game.py b/game.py
index 8482123..e9ec3b4 100644
--- a/game.py
+++ b/game.py
@@ -298,8 +298,13 @@ class MazeGame:
print "Message from unknown buddy?"
elif event.type == pygame.USEREVENT:
+ # process our buttons
+ if hasattr(event, 'action') and event.action == 'harder_button':
+ self.harder()
+ elif hasattr(event, 'action') and event.action == 'easier_button':
+ self.easier()
# process file save / restore events
- if event.code == olpcgames.FILE_READ_REQUEST:
+ elif event.code == olpcgames.FILE_READ_REQUEST:
log.debug('Loading the state of the game...')
state = json.loads(event.metadata['state'])
log.debug('Loaded data: %s', state)
diff --git a/po/Maze.pot b/po/Maze.pot
index 967069f..a4b504f 100644..100755
--- a/po/Maze.pot
+++ b/po/Maze.pot
@@ -8,19 +8,15 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 00:31-0400\n"
+"POT-Creation-Date: 2011-08-18 15:47-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: activity/activity.info:2 activity.py:8
+#: activity.py:8 activity/activity.info:2
msgid "Maze"
msgstr ""
-
-#: olpcgames/canvas.py:151
-#, python-format
-msgid "%s Source"
-msgstr ""
diff --git a/po/da.po b/po/da.po
index 31fa8be..cc4f1f0 100644
--- a/po/da.po
+++ b/po/da.po
@@ -6,22 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 00:31-0400\n"
-"PO-Revision-Date: 2012-03-30 05:13+0200\n"
-"Last-Translator: Aputsiaq Niels <aj@isit.gl>\n"
+"POT-Creation-Date: 2011-08-18 15:47-0500\n"
+"PO-Revision-Date: 2011-02-26 14:55+0200\n"
+"Last-Translator: Chris <cjl@laptop.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: da\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 2.0.5\n"
+"X-Generator: Pootle 2.0.1\n"
-#: activity/activity.info:2 activity.py:8
+#: activity.py:8 activity/activity.info:2
msgid "Maze"
msgstr "Labyrint"
-
-#: olpcgames/canvas.py:151
-#, python-format
-msgid "%s Source"
-msgstr "%s kilde"
diff --git a/po/en.po b/po/en.po
index c2fa244..9ec3817 100644
--- a/po/en.po
+++ b/po/en.po
@@ -6,22 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 00:31-0400\n"
-"PO-Revision-Date: 2012-03-30 02:53+0200\n"
+"POT-Creation-Date: 2011-08-18 15:47-0500\n"
+"PO-Revision-Date: 2011-02-10 07:43+0200\n"
"Last-Translator: Chris <cjl@laptop.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: en\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 2.0.5\n"
+"X-Generator: Pootle 2.0.3\n"
-#: activity/activity.info:2 activity.py:8
+#: activity.py:8 activity/activity.info:2
msgid "Maze"
msgstr "Maze"
-
-#: olpcgames/canvas.py:151
-#, python-format
-msgid "%s Source"
-msgstr "%s Source"
diff --git a/po/en_GB.po b/po/en_GB.po
index 16289bc..12f6ff4 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 00:31-0400\n"
-"PO-Revision-Date: 2012-03-30 02:59+0200\n"
+"POT-Creation-Date: 2011-02-01 11:32+0000\n"
+"PO-Revision-Date: 2011-03-04 13:45+0200\n"
"Last-Translator: Chris <cjl@laptop.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en_GB\n"
@@ -15,13 +15,8 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 2.0.5\n"
+"X-Generator: Pootle 2.0.1\n"
-#: activity/activity.info:2 activity.py:8
+#: activity/activity.info:2
msgid "Maze"
msgstr "Maze"
-
-#: olpcgames/canvas.py:151
-#, python-format
-msgid "%s Source"
-msgstr "%s Source"
diff --git a/po/en_US.po b/po/en_US.po
index 2b3c3b7..fab594a 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -6,22 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 00:31-0400\n"
-"PO-Revision-Date: 2012-03-30 03:02+0200\n"
+"POT-Creation-Date: 2011-08-18 15:47-0500\n"
+"PO-Revision-Date: 2011-02-10 07:42+0200\n"
"Last-Translator: Chris <cjl@laptop.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: en_US\n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Pootle 2.0.5\n"
+"X-Generator: Pootle 2.0.3\n"
-#: activity/activity.info:2 activity.py:8
+#: activity.py:8 activity/activity.info:2
msgid "Maze"
msgstr "Maze"
-
-#: olpcgames/canvas.py:151
-#, python-format
-msgid "%s Source"
-msgstr "%s Source"