comparison src/parpg/gamesceneview.py @ 69:ad75fa042b99

Changes to make PARPG "runable" with grease. (With the correct modified assets)
author KarstenBock@gmx.net
date Tue, 06 Sep 2011 15:22:51 +0200
parents 1fd2201f5c36
children 62cff91a19cb
comparison
equal deleted inserted replaced
68:d7286cba42df 69:ad75fa042b99
60 obj.say(str(text), time) 60 obj.say(str(text), time)
61 61
62 def onWalk(self, click): 62 def onWalk(self, click):
63 """Callback sample for the context menu.""" 63 """Callback sample for the context menu."""
64 self.hud.hideContainer() 64 self.hud.hideContainer()
65 self.model.game_state.player_character.run(click) 65 self.model.game_state.getObjectById("PlayerCharacter").fifeagent.run(click)
66 66
67 def refreshTopLayerTransparencies(self): 67 def refreshTopLayerTransparencies(self):
68 """Fade or unfade TopLayer instances if the PlayerCharacter 68 """Fade or unfade TopLayer instances if the PlayerCharacter
69 is under them.""" 69 is under them."""
70 if not self.model.active_map: 70 if not self.model.active_map:
71 return 71 return
72 72
73 # get the PlayerCharacter's screen coordinates 73 # get the PlayerCharacter's screen coordinates
74 camera = self.model.active_map.cameras[self.model.active_map.my_cam_id] 74 camera = self.model.active_map.cameras[self.model.active_map.my_cam_id]
75 point = self.model.game_state.player_character.\ 75 point = self.model.game_state.getObjectById("PlayerCharacter").fifeagent.\
76 behaviour.agent.getLocation() 76 behaviour.agent.getLocation()
77 scr_coords = camera.toScreenCoordinates(point.getMapCoordinates()) 77 scr_coords = camera.toScreenCoordinates(point.getMapCoordinates())
78 78
79 # find all instances on TopLayer that fall on those coordinates 79 # find all instances on TopLayer that fall on those coordinates
80 instances = camera.getMatchingInstances(scr_coords, 80 instances = camera.getMatchingInstances(scr_coords,
121 137, 255, 2) 121 137, 255, 2)
122 # get the text 122 # get the text
123 item = self.model.objectActive(self.highlight_obj) 123 item = self.model.objectActive(self.highlight_obj)
124 if item is not None: 124 if item is not None:
125 self.displayObjectText(self.highlight_obj, 125 self.displayObjectText(self.highlight_obj,
126 item.name) 126 item.description.view_name)
127 else: 127 else:
128 self.model.active_map.outline_renderer.removeAllOutlines() 128 self.model.active_map.outline_renderer.removeAllOutlines()
129 self.highlight_obj = None 129 self.highlight_obj = None
130 130
131 131