# HG changeset patch # User KarstenBock@gmx.net # Date 1317643937 -7200 # Node ID 3dddf09377b8ea430f2d283602868b6d2f998b02 # Parent a6b25c2cedab4254cdd6ebf17e451b26bd2f4206 "Open" will now not be shown in the context menu when the lockable is locked. "Lock" will not not be shown in the context menu when the lockable is open. diff -r a6b25c2cedab -r 3dddf09377b8 src/parpg/gamescenecontroller.py --- a/src/parpg/gamescenecontroller.py Mon Oct 03 13:05:23 2011 +0200 +++ b/src/parpg/gamescenecontroller.py Mon Oct 03 14:12:17 2011 +0200 @@ -467,10 +467,11 @@ if obj.lockable: if obj.lockable.closed: - actions.append(["Open", "Open", - player.fifeagent.behaviour.approach, - [obj_pos.x, obj_pos.y], - OpenAction(self, obj)]) + if not obj.lockable.locked: + actions.append(["Open", "Open", + player.fifeagent.behaviour.approach, + [obj_pos.x, obj_pos.y], + OpenAction(self, obj)]) else: actions.append(["Close", "Close", player.fifeagent.behaviour.approach, @@ -482,10 +483,11 @@ [obj_pos.x, obj_pos.y], UnlockAction(self, obj)]) else: - actions.append(["Lock", "Lock", - player.fifeagent.behaviour.approach, - [obj_pos.x, obj_pos.y], - LockAction(self, obj)]) + if obj.lockable.closed: + actions.append(["Lock", "Lock", + player.fifeagent.behaviour.approach, + [obj_pos.x, obj_pos.y], + LockAction(self, obj)]) if obj.container: if obj.characterstats: #TODO: This is reserved for a possible "Steal" action.