boom when magarena image hits AboutScreen!
parent
333b547c85
commit
2451a09ebc
Binary file not shown.
|
@ -22,6 +22,7 @@ public enum MagicSound {
|
|||
ADD_CARD("cardSlide3.wav"),
|
||||
ALERT("bong.wav"),
|
||||
BEEP("noAction.wav"),
|
||||
BOOM("boom.wav"),
|
||||
REMOVE_CARD("cardTakeOutPackage1.wav"),
|
||||
|
||||
// gameSounds - keep sorted and verify enumset range if changed.
|
||||
|
|
|
@ -15,6 +15,7 @@ import javax.swing.Timer;
|
|||
import magic.data.MagicIcon;
|
||||
import magic.translate.UiString;
|
||||
import magic.ui.MagicImages;
|
||||
import magic.ui.MagicSound;
|
||||
import magic.ui.ScreenController;
|
||||
import magic.ui.screen.interfaces.IActionBar;
|
||||
import magic.ui.screen.interfaces.IStatusBar;
|
||||
|
@ -24,10 +25,11 @@ import magic.ui.screen.widget.MenuButton;
|
|||
import magic.ui.utility.GraphicsUtils;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.pushingpixels.trident.Timeline;
|
||||
import org.pushingpixels.trident.callback.TimelineCallback;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class AboutScreen extends AbstractScreen
|
||||
implements IStatusBar, IActionBar, IWikiPage {
|
||||
implements IStatusBar, IActionBar, IWikiPage, TimelineCallback {
|
||||
|
||||
// translatable strings
|
||||
private static final String _S1 = "About...";
|
||||
|
@ -55,6 +57,7 @@ public class AboutScreen extends AbstractScreen
|
|||
|
||||
private void doDropAnimation() {
|
||||
dropTimeline = new Timeline(this);
|
||||
dropTimeline.addCallback(this);
|
||||
dropTimeline.addPropertyToInterpolate("ImageScale", 6f, 1f);
|
||||
dropTimeline.setDuration(500);
|
||||
dropTimeline.play();
|
||||
|
@ -168,4 +171,16 @@ public class AboutScreen extends AbstractScreen
|
|||
return "home";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition) {
|
||||
if (newState == Timeline.TimelineState.DONE) {
|
||||
MagicSound.BOOM.play();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimelinePulse(float durationFraction, float timelinePosition) {
|
||||
// not interested.
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue