# HG changeset patch # User KarstenBock@gmx.net # Date 1315499800 -7200 # Node ID 7b9f6e3513d479e414f91b443a6555f4e3ec83c2 # Parent 3dfd26b1c7efc4efaa0c6ac0228721f6399291e4 Added code that checks if the object is the player so certain actions (talk, attack) will not appear in the menu. diff -r 3dfd26b1c7ef -r 7b9f6e3513d4 gamescenecontroller.py --- a/gamescenecontroller.py Thu Sep 08 18:23:06 2011 +0200 +++ b/gamescenecontroller.py Thu Sep 08 18:36:40 2011 +0200 @@ -429,13 +429,13 @@ getObjectById(obj_id, self.model.game_state.current_map_name) player = self.model.game_state.getObjectById("PlayerCharacter") - + is_player = obj.fifeagent.identifier == player.fifeagent.identifier #TODO: Check all actions to be compatible with the grease components if obj is not None: - if obj.dialogue: + if obj.dialogue and not is_player: actions.append(["Talk", "Talk", self.initTalk, obj]) - if obj.characterstats: + if obj.characterstats and not is_player: actions.append(["Attack", "Attack", self.nullFunc, obj]) if obj.description: actions.append(["Examine", "Examine", @@ -452,7 +452,6 @@ ChangeMapAction(self, obj.target_map_name, obj.target_pos)]) - # is it a container? if obj.lockable: actions.append(["Open", "Open", player.fifeagent.behaviour.approach, @@ -466,7 +465,6 @@ player.fifeagent.behaviour.approach, [obj.fifeagent.pos.x, obj.fifeagent.pos.y], LockBoxAction(self, obj)]) - # can you pick it up? if obj.containable: actions.append(["Pick Up", "Pick Up", player.fifeagent.behaviour.approach,