Changeset 201:fe1e9c18d4d7


Ignore:
Timestamp:
Sep 4, 2009, 8:16:51 PM (11 years ago)
Author:
Adrianna Pińska <adrianna.pinska@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@202
Message:

layering bugfix; indoor chickens now use normal chicken icons

Files:
4 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • gamelib/animal.py

    r200 r201  
    9595        layers.sort(key=lambda l: l[2])
    9696
    97         self.image_left = layers[0][0]
    98         self.image_right = layers[0][1]
    99         for l in layers[1:]:
     97        # these always go on the bottom so that other layers don't get overwritten
     98        self.image_left = self._image_left.copy()
     99        self.image_right = self._image_right.copy()
     100        for l in layers:
    100101            self.image_left.blit(l[0], (0,0))
    101102            self.image_right.blit(l[1], (0,0))
  • gamelib/gameboard.py

    r200 r201  
    350350                    place = building.first_empty_place()
    351351                    self.relocate_animal(self.animal_to_place, place=place)
     352                    self.animal_to_place.equip(equipment.Nest())
    352353                    self.select_animal_to_place(None)
    353354                    pygame.mouse.set_cursor(*cursors.cursors['select'])
     
    359360        if self.tv.get(tile_pos) == self.GRASSLAND:
    360361            if self.animal_to_place is not None:
     362                self.animal_to_place.unequip_by_name("nest")
    361363                self.relocate_animal(self.animal_to_place, tile_pos=tile_pos)
    362364
     
    423425            """Set occupant of a given place."""
    424426            if self.animal_to_place is not None:
    425                 button.value = icons.CHKN_NEST_ICON
     427                button.value = icons.animal_icon(self.animal_to_place)
    426428                button.disconnect(gui.CLICK, set_occupant)
    427429                button.connect(gui.CLICK, select_occupant, place, button,
     
    455457                                sell_callback)
    456458                    else:
    457                         button = gui.Button(icons.CHKN_NEST_ICON)
     459                        button = gui.Button(icons.animal_icon(place.occupant))
    458460                        button.connect(gui.CLICK, select_occupant, place, button,
    459461                                sell_callback)
  • gamelib/icons.py

    r123 r201  
    77KILLED_FOX = Image(imagecache.load_image('icons/killed_fox.png'))
    88CHKN_ICON = Image(imagecache.load_image('icons/chkn.png'))
    9 EMPTY_NEST_ICON = Image(imagecache.load_image('sprites/emptynest.png'))
    10 CHKN_NEST_ICON = Image(imagecache.load_image('sprites/chknnest.png'))
     9EMPTY_NEST_ICON = Image(imagecache.load_image('sprites/nest.png'))
     10
     11def animal_icon(animal):
     12    return Image(animal.image_left)
  • regenerate-pngs.py

    r184 r201  
    7474        ("watchtower", 40, 40),
    7575        ("select_watchtower", 40, 40),
    76         ("chknnest", 20, 20),
    77         ("emptynest", 20, 20),
    7876        ("nest", 20, 20),
    7977    ]
Note: See TracChangeset for help on using the changeset viewer.