Don't can all mouse button 1 presses; allow objects without actions to

become the hover object if derived classes really want it (like the
editor).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2423 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-04-18 23:19:13 +00:00
parent ffb9e3b4e4
commit f0a1bf2311
@@ -1,5 +1,5 @@
//
// $Id: MisoScenePanel.java,v 1.2 2003/04/18 18:32:24 mdb Exp $
// $Id: MisoScenePanel.java,v 1.3 2003/04/18 23:19:13 mdb Exp $
package com.threerings.miso.client;
@@ -249,12 +249,6 @@ public class MisoScenePanel extends VirtualMediaPanel
// documentation inherited from interface
public void mousePressed (MouseEvent e)
{
// if this was not the first button, treat it as a cancellation of
// whatever might be going on
if (e.getButton() != MouseEvent.BUTTON1) {
return;
}
// ignore mouse presses if we're not responsive
if (!isResponsive()) {
return;
@@ -811,10 +805,13 @@ public class MisoScenePanel extends VirtualMediaPanel
for (int ii = 0, ll = _vizobjs.size(); ii < ll; ii++) {
SceneObject scobj = (SceneObject)_vizobjs.get(ii);
Rectangle pbounds = scobj.bounds;
// skip actionless objects and those whose bounding rects
// don't contain the point
if (StringUtil.blank(scobj.info.action) ||
!pbounds.contains(x, y)) {
if (!pbounds.contains(x, y)) {
continue;
}
// skip actionless objects if we're configured to do so
if (skipActionlessObjects() &&
StringUtil.blank(scobj.info.action)) {
continue;
}
@@ -829,6 +826,15 @@ public class MisoScenePanel extends VirtualMediaPanel
}
}
/**
* Indicates whether or not actionless objects are allowed to be the
* hover object. By default, they are not.
*/
protected boolean skipActionlessObjects ()
{
return true;
}
/**
* Converts the supplied screen coordinates into tile coordinates,
* writing the values into the supplied {@link Point} instance and