From bf2d9ffa0052fbe2a025d871b9b3c5e91e9c7ff2 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 27 Jul 2013 22:34:33 +0000 Subject: more cleanup for v187 --- diff --git a/NEWS b/NEWS index d0385e9..f1f656e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +187 + +ENHANCEMENTS: +* New translations + +BUG FIX: +* Add missing turtle graphic (regression) + 185 ENHANCEMENTS: diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 3cef5e3..c6b88ea 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -44,8 +44,6 @@ from sugar.graphics.toolbutton import ToolButton from sugar.graphics.radiotoolbutton import RadioToolButton from sugar.graphics.alert import (ConfirmationAlert, NotifyAlert) from sugar.graphics import style -from sugar.graphics.combobox import ComboBox -from sugar.graphics.toolcombobox import ToolComboBox from sugar.graphics.objectchooser import ObjectChooser from sugar import mime from sugar.datastore import datastore @@ -144,7 +142,7 @@ class TurtleArtActivity(activity.Activity): if not hasattr(self, '_offsets'): self._offsets = {} if not hasattr(self, '_selected_challenge'): - self._offsets = {'confusion-01': [0, 0, 29]} + self._offsets = {'confusion-01': [0, 0, 33]} self._selected_challenge = os.path.join(activity.get_bundle_path(), 'challenges', 'confusion-01.svg') @@ -380,6 +378,15 @@ class TurtleArtActivity(activity.Activity): else: self._load_level(custom=True) + def _draw_cartoon(self): + pos = self.tw.turtles.get_active_turtle().get_xy() + self.tw.turtles.get_active_turtle().set_xy( + (int(-gtk.gdk.screen_width() / 2), 0), pendown=False) + self.tw.lc.insert_image(center=False, resize=False, + filepath=os.path.join( + activity.get_bundle_path(), 'images', 'turtle-a.png')) + self.tw.turtles.get_active_turtle().set_xy(pos, pendown=False) + def do_run_cb(self, button): ''' Callback for run button (rabbit) ''' self.run_button.set_icon('run-faston') @@ -943,7 +950,7 @@ class TurtleArtActivity(activity.Activity): self._overflow_box.remove(button) if self._overflow_palette_button in self._palette_toolbar: self._palette_toolbar.remove(self._overflow_palette_button) - if hasattr(self, '_levels_combo') and \ + if hasattr(self, '_levels_tool') and \ self._levels_tool in self._palette_toolbar: self._palette_toolbar.remove(self._levels_tool) @@ -1621,46 +1628,9 @@ in order to use the plugin.')) help_strings[name] = tooltip return button - def _combo_factory(self, options, tooltip, toolbar, callback, default=0): - ''' Combo box factory ''' - combo = ComboBox() - if hasattr(combo, 'set_tooltip_text'): - combo.set_tooltip_text(tooltip) - combo.connect('changed', callback) - for i, option in enumerate(options): - combo.append_item(i, option.replace('-', ' '), None) - combo.set_active(default) - combo.show() - tool = ToolComboBox(combo) - tool.show() - if hasattr(toolbar, 'insert'): - toolbar.insert(tool, -1) - else: - toolbar.props.page.insert(tool, -1) - return combo, tool - - def _get_levels(self, path): - ''' Look for level files in lessons directory. ''' - levels = glob.glob(os.path.join(activity.get_bundle_path(), - 'flags', '*.png')) - - level_files = [] - for level in levels: - level_files.append(level[:-4]) - - return level_files - - def _levels_cb(self, combobox=None): - ''' The combo box has changed. ''' - if hasattr(self, '_levels_combo'): - i = self._levels_combo.get_active() - if i != -1: # and i != self._level: - self._level = i - self._load_level() - self._custom_filepath = None - def _load_level(self, custom=False): self.tw.canvas.clearscreen() + self._draw_cartoon() if custom: self.tw.turtles.get_active_turtle().set_xy((0, 0), pendown=False) self.tw.lc.insert_image(center=True, @@ -1682,7 +1652,7 @@ in order to use the plugin.')) self.tw.lc.scale = scale self.tw.lc.insert_image(center=False, filepath=self._selected_challenge, - resize=True, + resize=False, offset=True) self.tw.lc.scale = save_scale self.tw.turtles.get_active_turtle().set_xy((0, 0), pendown=False) diff --git a/activity/activity.info b/activity/activity.info index 1104108..b0ba18d 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,6 +1,6 @@ [Activity] name = Turtle Confusion -activity_version = 186 +activity_version = 187 license = MIT bundle_id = org.laptop.TurtleConfusionActivity exec = sugar-activity TurtleArtActivity.TurtleArtActivity diff --git a/challenges/offsets b/challenges/offsets index 9d6101e..fd1993c 100644 --- a/challenges/offsets +++ b/challenges/offsets @@ -19,13 +19,13 @@ 19:-150,-150,33 20:-100,-111,33 21:-100,-100,33 -22:-100,-100,33 +22:-93,-93,33 23:-150,-150,33 -24:-175,-150,33 +24:-172,-147,33 25:-75,-94,33 26:-105,-125,33 27:-150,-150,33 -28:-107,-107,33 +28:-106,-104,33 29:-153,-160,33 30:-130,-152,33 31:0,-50,33 diff --git a/icons/challenges.svg b/icons/challenges.svg index 71771fb..c6c0305 100644 --- a/icons/challenges.svg +++ b/icons/challenges.svg @@ -2,210 +2,274 @@ ]> - - - + transform="matrix(0.63446135,0,0,0.63446135,-0.87740642,11.991621)" + id="g3882" + style="fill:none;stroke:&stroke_color;;stroke-width:2.36421013;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + + + + - - + transform="matrix(0.63446135,0,0,0.63446135,-1.2131341,11.94683)" + id="g3882-5" + style="fill:&fill_color;;fill-opacity:1;stroke:&stroke_color;;stroke-width:2.36421013;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"> + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + d="m 17.263333,25.546826 c -2.580355,0 -4.730544,2.573375 -4.730544,2.573375 0,0 2.150189,2.586065 4.730544,2.584796 2.581622,-0.0025 4.731812,-2.587333 4.731812,-2.587333 0,0 -2.15019,-2.572741 -4.731812,-2.570838 z m 0,4.388569 c -0.999277,0 -1.809485,-0.810207 -1.809485,-1.810118 0,-0.997373 0.810208,-1.809484 1.809485,-1.809484 0.998007,0 1.808214,0.812111 1.808214,1.809484 0,0.999911 -0.810207,1.810118 -1.808214,1.810118 z" + id="path3890-6" + style="fill:none;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + + + + + + + + + + + + + + d="m 37.399671,25.519133 c -2.580354,0 -4.730544,2.573375 -4.730544,2.573375 0,0 2.15019,2.586065 4.730544,2.584796 2.581623,-0.0025 4.731813,-2.587333 4.731813,-2.587333 0,0 -2.15019,-2.572741 -4.731813,-2.570838 z m 0,4.388569 c -0.999277,0 -1.809484,-0.810207 -1.809484,-1.810118 0,-0.997373 0.810207,-1.809484 1.809484,-1.809484 0.998008,0 1.808215,0.812111 1.808215,1.809484 0,0.999911 -0.810207,1.810118 -1.808215,1.810118 z" + id="path3890-6-9" + style="fill:&fill_color;;fill-opacity:1;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + + + + + + + + + + + + + + d="m 17.263333,41.546826 c -2.580355,0 -4.730544,2.573375 -4.730544,2.573375 0,0 2.150189,2.586065 4.730544,2.584796 2.581622,-0.0025 4.731812,-2.587333 4.731812,-2.587333 0,0 -2.15019,-2.572741 -4.731812,-2.570838 z m 0,4.388569 c -0.999277,0 -1.809485,-0.810207 -1.809485,-1.810118 0,-0.997373 0.810208,-1.809484 1.809485,-1.809484 0.998007,0 1.808214,0.812111 1.808214,1.809484 0,0.999911 -0.810207,1.810118 -1.808214,1.810118 z" + id="path3890-6-93" + style="fill:none;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + + + + + + + + + + + + + + d="m 37.399671,41.519133 c -2.580354,0 -4.730544,2.573375 -4.730544,2.573375 0,0 2.15019,2.586065 4.730544,2.584796 2.581623,-0.0025 4.731813,-2.587333 4.731813,-2.587333 0,0 -2.15019,-2.572741 -4.731813,-2.570838 z m 0,4.388569 c -0.999277,0 -1.809484,-0.810207 -1.809484,-1.810118 0,-0.997373 0.810207,-1.809484 1.809484,-1.809484 0.998008,0 1.808215,0.812111 1.808215,1.809484 0,0.999911 -0.810207,1.810118 -1.808215,1.810118 z" + id="path3890-6-9-8" + style="fill:none;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + + + + + + + + + + + + + + d="m 17.263333,9.546827 c -2.580355,0 -4.730544,2.573375 -4.730544,2.573375 0,0 2.150189,2.586064 4.730544,2.584796 2.581622,-0.0025 4.731812,-2.587334 4.731812,-2.587334 0,0 -2.15019,-2.5727404 -4.731812,-2.570837 z m 0,4.388569 c -0.999277,0 -1.809485,-0.810207 -1.809485,-1.810118 0,-0.997374 0.810208,-1.809484 1.809485,-1.809484 0.998007,0 1.808214,0.81211 1.808214,1.809484 0,0.999911 -0.810207,1.810118 -1.808214,1.810118 z" + id="path3890-6-7" + style="fill:none;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + + + + + + + + + + + + + + d="m 37.399671,9.5191343 c -2.580354,0 -4.730544,2.5733747 -4.730544,2.5733747 0,0 2.15019,2.586065 4.730544,2.584796 2.581623,-0.0025 4.731813,-2.587333 4.731813,-2.587333 0,0 -2.15019,-2.5727411 -4.731813,-2.5708377 z m 0,4.3885697 c -0.999277,0 -1.809484,-0.810208 -1.809484,-1.810119 0,-0.997373 0.810207,-1.809484 1.809484,-1.809484 0.998008,0 1.808215,0.812111 1.808215,1.809484 0,0.999911 -0.810207,1.810119 -1.808215,1.810119 z" + id="path3890-6-9-88" + style="fill:none;stroke:&stroke_color;;stroke-width:1.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + diff --git a/turtleconfusion.py b/turtleconfusion.py index d0ae573..f6ad237 100755 --- a/turtleconfusion.py +++ b/turtleconfusion.py @@ -114,6 +114,7 @@ class TurtleMain(): self._setup_gtk() self._build_window() self._run_gnome_plugins() + self._draw_cartoon() self._start_gtk() def _get_gconf_settings(self): @@ -674,8 +675,18 @@ Would you like to save before quitting?')) else: self._load_level(custom=True) + def _draw_cartoon(self): + pos = self.tw.turtles.get_active_turtle().get_xy() + self.tw.turtles.get_active_turtle().set_xy( + (int(-gtk.gdk.screen_width() / 2), 0), pendown=False) + self.tw.lc.insert_image(center=False, resize=False, + filepath=os.path.join( + self._get_execution_dir(), 'images', 'turtle-a.png')) + self.tw.turtles.get_active_turtle().set_xy(pos, pendown=False) + def _load_level(self, custom=False): self.tw.canvas.clearscreen() + self._draw_cartoon() if custom: self.tw.turtles.get_active_turtle().set_xy((0, 0), pendown=False) self.tw.lc.insert_image(center=True, -- cgit v0.9.1