From f0a1bf23112f47a168f6b365451c96fe4a78a39f Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 18 Apr 2003 23:19:13 +0000 Subject: [PATCH] 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 --- .../miso/client/MisoScenePanel.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/java/com/threerings/miso/client/MisoScenePanel.java b/src/java/com/threerings/miso/client/MisoScenePanel.java index 6a2149d74..520c341ff 100644 --- a/src/java/com/threerings/miso/client/MisoScenePanel.java +++ b/src/java/com/threerings/miso/client/MisoScenePanel.java @@ -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