From e5c65b95b56d0613e3a7a6f742e0a21052fa5690 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Mon, 6 Mar 2006 23:45:12 +0000 Subject: [PATCH] Allow action handlers to show a scene object's associated text without having an allowed action (though by default they still don't) git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3917 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/miso/client/MisoScenePanel.java | 2 +- .../miso/client/ObjectActionHandler.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index 85bd1086e..2b4af68b9 100644 --- a/src/java/com/threerings/miso/client/MisoScenePanel.java +++ b/src/java/com/threerings/miso/client/MisoScenePanel.java @@ -1040,7 +1040,7 @@ public class MisoScenePanel extends VirtualMediaPanel // if we have an object action handler, possibly let them veto // the display of this tooltip and action ObjectActionHandler oah = ObjectActionHandler.lookup(action); - if (oah != null && !oah.actionAllowed(action)) { + if (oah != null && !oah.isVisible(action)) { continue; } diff --git a/src/java/com/threerings/miso/client/ObjectActionHandler.java b/src/java/com/threerings/miso/client/ObjectActionHandler.java index c7db154f0..eabdc0298 100644 --- a/src/java/com/threerings/miso/client/ObjectActionHandler.java +++ b/src/java/com/threerings/miso/client/ObjectActionHandler.java @@ -40,14 +40,24 @@ public class ObjectActionHandler { /** * Returns true if we should allow this object action, false if we - * should not. This is used to completely hide actions that should not - * be visible without the proper privileges. + * should not. */ public boolean actionAllowed (String action) { return true; } + /** + * Returns true if we should display the text for the action. By default + * this returns whether the action is allowed or not, but can be + * overridden by subclasses. This is used to completely hide actions that + * should not be visible without the proper privileges. + */ + public boolean isVisible (String action) + { + return actionAllowed(action); + } + /** * Get the human readable object tip for the specified action. */