changeset 113:c5d6d0ba3b2b

Fill in more toolbar stuff
author Neil Muller <drnlmuller@gmail.com>
date Sun, 11 Sep 2011 20:26:51 +0200
parents 62a705f4e876
children b3985414d4d6
files mamba/habitats/editor.py
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mamba/habitats/editor.py	Sun Sep 11 20:29:00 2011 +0200
+++ b/mamba/habitats/editor.py	Sun Sep 11 20:26:51 2011 +0200
@@ -7,7 +7,7 @@
 from mamba.widgets.level import LevelWidget
 from mamba.widgets.text import TextWidget
 from mamba.widgets.imagebutton import ImageButtonWidget
-from mamba.level import Level, Tileset
+from mamba.level import Level, TILE_MAP
 from mamba.constants import SCREEN, EDIT_SCREEN, NAME, ESCAPE_KEYS
 
 
@@ -62,3 +62,18 @@
                 (button_left, button_height), self.level.tileset.floor,
                 'Floor', color='white')
         self.container.add(floor_button)
+        button_height += floor_button.surface.get_height() + button_padding
+        for tile_char in TILE_MAP:
+            try:
+                tile = self.level.tileset[tile_char]
+            except pygame.error:
+                # Ignore stuff we can't load for now
+                continue
+            if tile is None:
+                continue
+            tile_button = ImageButtonWidget(
+                    (button_left, button_height), tile.image,
+                    'Tile', color='white')
+            self.container.add(tile_button)
+            button_height += \
+                    tile_button.surface.get_height() + button_padding