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
This commit is contained in:
@@ -1040,7 +1040,7 @@ public class MisoScenePanel extends VirtualMediaPanel
|
|||||||
// if we have an object action handler, possibly let them veto
|
// if we have an object action handler, possibly let them veto
|
||||||
// the display of this tooltip and action
|
// the display of this tooltip and action
|
||||||
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
|
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
|
||||||
if (oah != null && !oah.actionAllowed(action)) {
|
if (oah != null && !oah.isVisible(action)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,14 +40,24 @@ public class ObjectActionHandler
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns true if we should allow this object action, false if we
|
* Returns true if we should allow this object action, false if we
|
||||||
* should not. This is used to completely hide actions that should not
|
* should not.
|
||||||
* be visible without the proper privileges.
|
|
||||||
*/
|
*/
|
||||||
public boolean actionAllowed (String action)
|
public boolean actionAllowed (String action)
|
||||||
{
|
{
|
||||||
return true;
|
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.
|
* Get the human readable object tip for the specified action.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user