-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, - Upgrade sugargame to v1.2 - Add ToolbarBox - Minor fixes
- Loading branch information
Showing
8 changed files
with
239 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
iknowMadagascar | ||
=============== | ||
|
||
A sugar game about he geography of Madagascar | ||
A sugar game about the geography of Madagascar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import sugargame | ||
import sugargame.canvas | ||
from sugar.activity import activity | ||
from gettext import gettext as _ | ||
|
||
import gi | ||
gi.require_version('Gtk', '3.0') | ||
from gi.repository import Gtk | ||
|
||
|
||
from sugar3.activity import activity | ||
from sugar3.graphics.toolbarbox import ToolbarBox | ||
from sugar3.activity.widgets import ActivityToolbarButton, StopButton | ||
|
||
import pygame | ||
import sugargame.canvas | ||
import conozco | ||
|
||
class Activity(activity.Activity): | ||
|
||
def __init__(self, handle): | ||
activity.Activity.__init__(self, handle) | ||
|
||
self.max_participants = 1 | ||
self.actividad = conozco.Conozco(self) | ||
self._pygamecanvas = sugargame.canvas.PygameCanvas(self) | ||
self.set_canvas(self._pygamecanvas) | ||
self._pygamecanvas.grab_focus() | ||
self._pygamecanvas.run_pygame(self.actividad.principal) | ||
|
||
toolbox = ToolbarBox() | ||
|
||
activity_button = ActivityToolbarButton(self) | ||
toolbox.toolbar.insert(activity_button, 0) | ||
activity_button.show() | ||
|
||
separator = Gtk.SeparatorToolItem() | ||
separator.props.draw = False | ||
separator.set_expand(True) | ||
toolbox.toolbar.insert(separator, -1) | ||
separator.show() | ||
|
||
stop_button = StopButton(self) | ||
stop_button.props.accelerator = _('<Ctrl>Q') | ||
toolbox.toolbar.insert(stop_button, -1) | ||
stop_button.show() | ||
|
||
toolbox.show() | ||
self.set_toolbar_box(toolbox) | ||
self.show_all() | ||
|
||
self.game = conozco.Conozco(self) | ||
self.game.canvas = sugargame.canvas.PygameCanvas(self, | ||
main=self.game.run, | ||
modules=[pygame.display, pygame.font, pygame.mixer]) | ||
self.set_canvas(self.game.canvas) | ||
self.game.canvas.grab_focus() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#! /usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from sugar.activity import bundlebuilder | ||
from sugar3.activity import bundlebuilder | ||
if __name__ == "__main__": | ||
bundlebuilder.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.1' | ||
__version__ = '1.2' |
Oops, something went wrong.