changeset 145:3dddf09377b8

"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.
author KarstenBock@gmx.net
date Mon, 03 Oct 2011 14:12:17 +0200
parents a6b25c2cedab
children 6e1eb964a6e5
files src/parpg/gamescenecontroller.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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.