Ignore:
Timestamp:
10/23/09 18:13:26 (10 years ago)
Author:
eliedebrauwer
Message:

Ticket #66: Patch by Saritor, This patch implements Kaydeth's camera fix as well as a fix for letting us be able to remove the PC entry on individual map files. However the very first map a player starts the game on will need such an entry. fixes[s:trac, t:66]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/world.py

    r338 r340  
    9999    def loadMap(self, map_name, filename): 
    100100        """Loads a map and stores it under the given name in the maps list. 
    101            @type map_name: text 
     101           @type map_name: String 
    102102           @param map_name: The name of the map to load  
    103            @type filename: text 
     103           @type filename: String 
    104104           @param filename: File which contains the map to be loaded 
    105            @return: None 
    106         """ 
     105           @return: None""" 
    107106        if not map_name in self.maps: 
    108             """Need to set active map before we load it because the map  
    109             loader uses call backs that expect to find an active map.  
    110             This needs to be reworked. 
    111             """ 
    112107            map = Map(self.engine, self.data) 
    113108            self.maps[map_name] = map         
     109            map.load(filename) 
     110        else: 
    114111            self.setActiveMap(map_name) 
    115             map.load(filename) 
    116112     
    117113    def setActiveMap(self, map_name): 
    118114        """Sets the active map that is to be rendered. 
    119            @type map_name: text 
     115           @type map_name: String 
    120116           @param map_name: The name of the map to load  
    121            @return: None 
    122         """ 
     117           @return: None""" 
     118        # Turn off the camera on the old map before we turn on the camera 
     119        # on the new map. 
     120        self.active_map.cameras[self.active_map.my_cam_id].setEnabled(False) 
     121        # Make the new map active. 
    123122        self.active_map = self.maps[map_name] 
    124123        self.active_map.makeActive() 
     
    128127           @type obj: fife.instance 
    129128           @param obj: object to draw over 
    130            @type text: text 
     129           @type text: String 
    131130           @param text: text to display over object 
    132131           @return: None""" 
     
    193192        elif(evt.getButton() == fife.MouseEvent.RIGHT): 
    194193            # is there an object here? 
    195             instances = self.active_map.cameras['main'].\ 
     194            instances = self.active_map.cameras[self.active_map.my_cam_id].\ 
    196195                            getMatchingInstances(scr_point, \ 
    197196                                                 self.active_map.agent_layer) 
     
    224223           @return: fife.Location 
    225224        """ 
     225        print position 
    226226        coord = fife.DoublePoint3D(float(position[0]), float(position[1]), 0) 
    227227        location = fife.Location(self.active_map.agent_layer) 
     
    235235           @return: None""" 
    236236        click = fife.ScreenPoint(evt.getX(), evt.getY()) 
    237         i=self.active_map.cameras['main'].getMatchingInstances(click, \ 
     237        i=self.active_map.cameras[self.active_map.my_cam_id].getMatchingInstances(click, \ 
    238238                                                self.active_map.agent_layer) 
    239239        # no object returns an empty tuple 
     
    274274           @rtype: fife.Location 
    275275           @return: The map coordinates""" 
    276         coord = self.active_map.cameras["main"].toMapCoordinates(click, False) 
     276        coord = self.active_map.cameras[self.active_map.my_cam_id].toMapCoordinates(click, False) 
    277277        coord.z = 0 
    278278        location = fife.Location(self.active_map.agent_layer) 
Note: See TracChangeset for help on using the changeset viewer.