diff --git a/src/java/com/threerings/parlor/card/client/CardPanel.java b/src/java/com/threerings/parlor/card/client/CardPanel.java index 80d745395..8ffdc42a4 100644 --- a/src/java/com/threerings/parlor/card/client/CardPanel.java +++ b/src/java/com/threerings/parlor/card/client/CardPanel.java @@ -442,16 +442,19 @@ public abstract class CardPanel extends VirtualMediaPanel /** * Flies a set of cards from the ether into the hand. Clears any selected - * cards. + * cards. If the drop duration is nonzero, the cards will first fly to + * the selected card offset and then drop slowly into the hand. * * @param cards the cards to add to the hand * @param src the point to fly the cards from * @param flightDuration the duration of the cards' flight + * @param dropDuration the duration of the cards' drop into the + * hand * @param fadePortion the amount of time to spend fading in * as a proportion of the flight duration */ public void flyIntoHand (Card[] cards, Point src, long flightDuration, - float fadePortion) + long dropDuration, float fadePortion) { // first create the sprites and add them to the list CardSprite[] sprites = new CardSprite[cards.length]; @@ -471,9 +474,23 @@ public abstract class CardPanel extends VirtualMediaPanel sprites[i].setRenderOrder(idx); sprites[i].addSpriteObserver(_handSpriteObserver); addSprite(sprites[i]); - LinePath flight = new LinePath(new Point(getHandX(size, idx), - _handLocation.y), flightDuration); - sprites[i].moveAndFadeIn(flight, flightDuration, fadePortion); + + // if dropping, create a path sequence combining flight and drop + Path path; + long pathDuration; + Point hp = new Point(getHandX(size, idx), _handLocation.y); + if (dropDuration > 0) { + LinePath flight = new LinePath(new Point(hp.x, hp.y - + _selectedCardOffset), flightDuration), + drop = new LinePath(hp, dropDuration); + path = new PathSequence(flight, drop); + pathDuration = flightDuration + dropDuration; + + } else { + path = new LinePath(hp, flightDuration); + pathDuration = flightDuration; + } + sprites[i].moveAndFadeIn(path, pathDuration, fadePortion); } }