SoundController refactoring.
- Added enum classes SoundEffect and HitSound. - Added a SoundComponent interface for sound effects and hit sounds, and extended playSound() and playHitSound() methods to play any SoundComponent. - Moved features related to sample sets to the HitSound class, and rewrote sample sets as an internal enum class. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -18,17 +18,19 @@
|
||||
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.GameImage;
|
||||
import itdelatrisu.opsu.GameMod;
|
||||
import itdelatrisu.opsu.GameScore;
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.OsuHitObject;
|
||||
import itdelatrisu.opsu.OsuTimingPoint;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.HitSound;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
import itdelatrisu.opsu.objects.Circle;
|
||||
import itdelatrisu.opsu.objects.Slider;
|
||||
import itdelatrisu.opsu.objects.Spinner;
|
||||
@@ -292,13 +294,13 @@ public class Game extends BasicGameState {
|
||||
if (score.getHealth() >= 50) {
|
||||
GameImage.SECTION_PASS.getImage().drawCentered(width / 2f, height / 2f);
|
||||
if (!breakSound) {
|
||||
SoundController.playSound(SoundController.SOUND_SECTIONPASS);
|
||||
SoundController.playSound(SoundEffect.SECTIONPASS);
|
||||
breakSound = true;
|
||||
}
|
||||
} else {
|
||||
GameImage.SECTION_FAIL.getImage().drawCentered(width / 2f, height / 2f);
|
||||
if (!breakSound) {
|
||||
SoundController.playSound(SoundController.SOUND_SECTIONFAIL);
|
||||
SoundController.playSound(SoundEffect.SECTIONFAIL);
|
||||
breakSound = true;
|
||||
}
|
||||
}
|
||||
@@ -359,28 +361,28 @@ public class Game extends BasicGameState {
|
||||
if (timeDiff >= 1500) {
|
||||
GameImage.COUNTDOWN_READY.getImage().drawCentered(width / 2, height / 2);
|
||||
if (!countdownReadySound) {
|
||||
SoundController.playSound(SoundController.SOUND_READY);
|
||||
SoundController.playSound(SoundEffect.READY);
|
||||
countdownReadySound = true;
|
||||
}
|
||||
}
|
||||
if (timeDiff < 2000) {
|
||||
GameImage.COUNTDOWN_3.getImage().draw(0, 0);
|
||||
if (!countdown3Sound) {
|
||||
SoundController.playSound(SoundController.SOUND_COUNT3);
|
||||
SoundController.playSound(SoundEffect.COUNT3);
|
||||
countdown3Sound = true;
|
||||
}
|
||||
}
|
||||
if (timeDiff < 1500) {
|
||||
GameImage.COUNTDOWN_2.getImage().draw(width - GameImage.COUNTDOWN_2.getImage().getWidth(), 0);
|
||||
if (!countdown2Sound) {
|
||||
SoundController.playSound(SoundController.SOUND_COUNT2);
|
||||
SoundController.playSound(SoundEffect.COUNT2);
|
||||
countdown2Sound = true;
|
||||
}
|
||||
}
|
||||
if (timeDiff < 1000) {
|
||||
GameImage.COUNTDOWN_1.getImage().drawCentered(width / 2, height / 2);
|
||||
if (!countdown1Sound) {
|
||||
SoundController.playSound(SoundController.SOUND_COUNT1);
|
||||
SoundController.playSound(SoundEffect.COUNT1);
|
||||
countdown1Sound = true;
|
||||
}
|
||||
}
|
||||
@@ -389,7 +391,7 @@ public class Game extends BasicGameState {
|
||||
go.setAlpha((timeDiff < 0) ? 1 - (timeDiff / -1000f) : 1);
|
||||
go.drawCentered(width / 2, height / 2);
|
||||
if (!countdownGoSound) {
|
||||
SoundController.playSound(SoundController.SOUND_GO);
|
||||
SoundController.playSound(SoundEffect.GO);
|
||||
countdownGoSound = true;
|
||||
}
|
||||
}
|
||||
@@ -510,7 +512,7 @@ public class Game extends BasicGameState {
|
||||
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
||||
else
|
||||
beatLength = beatLengthBase * timingPoint.getSliderMultiplier();
|
||||
SoundController.setSampleSet(timingPoint.getSampleType());
|
||||
HitSound.setSampleSet(timingPoint.getSampleType());
|
||||
SoundController.setSampleVolume(timingPoint.getSampleVolume());
|
||||
timingPointIndex++;
|
||||
}
|
||||
@@ -650,7 +652,7 @@ public class Game extends BasicGameState {
|
||||
|
||||
int position = (pauseTime > -1) ? pauseTime : trackPosition;
|
||||
if (Options.setCheckpoint(position / 1000))
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
}
|
||||
break;
|
||||
case Input.KEY_L:
|
||||
@@ -667,7 +669,7 @@ public class Game extends BasicGameState {
|
||||
leadInTime = 0;
|
||||
MusicController.resume();
|
||||
}
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
|
||||
// skip to checkpoint
|
||||
MusicController.setPosition(checkpoint);
|
||||
@@ -805,7 +807,7 @@ public class Game extends BasicGameState {
|
||||
OsuTimingPoint timingPoint = osu.timingPoints.get(0);
|
||||
if (!timingPoint.isInherited()) {
|
||||
beatLengthBase = beatLength = timingPoint.getBeatLength();
|
||||
SoundController.setSampleSet(timingPoint.getSampleType());
|
||||
HitSound.setSampleSet(timingPoint.getSampleType());
|
||||
SoundController.setSampleVolume(timingPoint.getSampleVolume());
|
||||
timingPointIndex++;
|
||||
}
|
||||
@@ -839,7 +841,7 @@ public class Game extends BasicGameState {
|
||||
MusicController.resume();
|
||||
}
|
||||
MusicController.setPosition(firstObjectTime - SKIP_OFFSET);
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -18,12 +18,13 @@
|
||||
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.GameImage;
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.newdawn.slick.Color;
|
||||
@@ -126,10 +127,10 @@ public class GamePauseMenu extends BasicGameState {
|
||||
if (Game.getRestart() == Game.RESTART_LOSE) {
|
||||
MusicController.stop();
|
||||
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
} else {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
Game.setRestart(Game.RESTART_FALSE);
|
||||
game.enterState(Opsu.STATE_GAME);
|
||||
}
|
||||
@@ -159,17 +160,17 @@ public class GamePauseMenu extends BasicGameState {
|
||||
return;
|
||||
|
||||
if (continueButton.contains(x, y) && !loseState) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
Game.setRestart(Game.RESTART_FALSE);
|
||||
game.enterState(Opsu.STATE_GAME);
|
||||
} else if (retryButton.contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
Game.setRestart(Game.RESTART_MANUAL);
|
||||
game.enterState(Opsu.STATE_GAME);
|
||||
} else if (backButton.contains(x, y)) {
|
||||
MusicController.pause(); // lose state
|
||||
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
}
|
||||
}
|
||||
@@ -180,7 +181,7 @@ public class GamePauseMenu extends BasicGameState {
|
||||
pauseStartTime = System.currentTimeMillis();
|
||||
if (Game.getRestart() == Game.RESTART_LOSE) {
|
||||
MusicController.fadeOut(FADEOUT_TIME);
|
||||
SoundController.playSound(SoundController.SOUND_FAIL);
|
||||
SoundController.playSound(SoundEffect.FAIL);
|
||||
} else
|
||||
MusicController.pause();
|
||||
continueButton.setScale(1f);
|
||||
|
||||
@@ -18,14 +18,15 @@
|
||||
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.GameMod;
|
||||
import itdelatrisu.opsu.GameScore;
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.newdawn.slick.Color;
|
||||
@@ -153,7 +154,7 @@ public class GameRanking extends BasicGameState {
|
||||
case Input.KEY_ESCAPE:
|
||||
MusicController.pause();
|
||||
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
break;
|
||||
case Input.KEY_F12:
|
||||
@@ -172,16 +173,16 @@ public class GameRanking extends BasicGameState {
|
||||
OsuFile osu = MusicController.getOsuFile();
|
||||
Display.setTitle(String.format("%s - %s", game.getTitle(), osu.toString()));
|
||||
Game.setRestart(Game.RESTART_MANUAL);
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
game.enterState(Opsu.STATE_GAME, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
} else if (exitButton.contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
|
||||
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
} else if (Utils.getBackButton().contains(x, y)) {
|
||||
MusicController.pause();
|
||||
MusicController.playAt(MusicController.getOsuFile().previewTime, true);
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
}
|
||||
}
|
||||
@@ -191,6 +192,6 @@ public class GameRanking extends BasicGameState {
|
||||
throws SlickException {
|
||||
Display.setTitle(game.getTitle());
|
||||
Utils.getBackButton().setScale(1f);
|
||||
SoundController.playSound(SoundController.SOUND_APPLAUSE);
|
||||
SoundController.playSound(SoundEffect.APPLAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,13 @@
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.OsuGroupNode;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -355,14 +356,14 @@ public class MainMenu extends BasicGameState {
|
||||
logoTimer = 0;
|
||||
playButton.getImage().setAlpha(0f);
|
||||
exitButton.getImage().setAlpha(0f);
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
}
|
||||
}
|
||||
|
||||
// other button actions (if visible)
|
||||
else if (logoClicked) {
|
||||
if (logo.contains(x, y) || playButton.contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
} else if (exitButton.contains(x, y)) {
|
||||
Options.saveOptions();
|
||||
@@ -385,9 +386,9 @@ public class MainMenu extends BasicGameState {
|
||||
logoTimer = 0;
|
||||
playButton.getImage().setAlpha(0f);
|
||||
exitButton.getImage().setAlpha(0f);
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
} else {
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -18,12 +18,13 @@
|
||||
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.GameMod;
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
@@ -548,7 +549,7 @@ public class Options extends BasicGameState {
|
||||
|
||||
// back
|
||||
if (Utils.getBackButton().contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new EmptyTransition(), new FadeInTransition(Color.black));
|
||||
return;
|
||||
}
|
||||
@@ -558,7 +559,7 @@ public class Options extends BasicGameState {
|
||||
if (optionTabs[i].contains(x, y)) {
|
||||
if (i != currentTab) {
|
||||
currentTab = i;
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -570,7 +571,7 @@ public class Options extends BasicGameState {
|
||||
boolean prevState = mod.isActive();
|
||||
mod.toggle(true);
|
||||
if (mod.isActive() != prevState)
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -766,7 +767,7 @@ public class Options extends BasicGameState {
|
||||
|
||||
switch (key) {
|
||||
case Input.KEY_ESCAPE:
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
game.enterState(Opsu.STATE_SONGMENU, new EmptyTransition(), new FadeInTransition(Color.black));
|
||||
break;
|
||||
case Input.KEY_F12:
|
||||
@@ -777,7 +778,7 @@ public class Options extends BasicGameState {
|
||||
if (input.isKeyDown(Input.KEY_LSHIFT) || input.isKeyDown(Input.KEY_RSHIFT))
|
||||
i = TAB_MAX - 1;
|
||||
currentTab = (currentTab + i) % TAB_MAX;
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MenuButton;
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuFile;
|
||||
import itdelatrisu.opsu.OsuGroupNode;
|
||||
import itdelatrisu.opsu.OsuParser;
|
||||
import itdelatrisu.opsu.SongSort;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.HitSound;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
import itdelatrisu.opsu.audio.SoundEffect;
|
||||
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.newdawn.slick.Animation;
|
||||
@@ -351,7 +353,7 @@ public class SongMenu extends BasicGameState {
|
||||
|
||||
// back
|
||||
if (Utils.getBackButton().contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
|
||||
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
return;
|
||||
@@ -359,7 +361,7 @@ public class SongMenu extends BasicGameState {
|
||||
|
||||
// options
|
||||
if (optionsButton.contains(x, y)) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
game.enterState(Opsu.STATE_OPTIONS, new EmptyTransition(), new FadeInTransition(Color.black));
|
||||
return;
|
||||
}
|
||||
@@ -372,7 +374,7 @@ public class SongMenu extends BasicGameState {
|
||||
if (sort.contains(x, y)) {
|
||||
if (sort != SongSort.getSort()) {
|
||||
SongSort.setSort(sort);
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
OsuGroupNode oldFocusBase = Opsu.groups.getBaseNode(focusNode.index);
|
||||
int oldFocusFileIndex = focusNode.osuFileIndex;
|
||||
focusNode = null;
|
||||
@@ -400,7 +402,7 @@ public class SongMenu extends BasicGameState {
|
||||
|
||||
} else {
|
||||
// focus the node
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
setFocus(node, 0, false);
|
||||
}
|
||||
break;
|
||||
@@ -408,7 +410,7 @@ public class SongMenu extends BasicGameState {
|
||||
|
||||
// clicked node is a new group
|
||||
else {
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
setFocus(node, -1, false);
|
||||
break;
|
||||
}
|
||||
@@ -424,7 +426,7 @@ public class SongMenu extends BasicGameState {
|
||||
search.setText("");
|
||||
searchTimer = SEARCH_DELAY;
|
||||
} else {
|
||||
SoundController.playSound(SoundController.SOUND_MENUBACK);
|
||||
SoundController.playSound(SoundEffect.MENUBACK);
|
||||
((MainMenu) game.getState(Opsu.STATE_MAINMENU)).reset();
|
||||
game.enterState(Opsu.STATE_MAINMENU, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
}
|
||||
@@ -453,7 +455,7 @@ public class SongMenu extends BasicGameState {
|
||||
break;
|
||||
OsuGroupNode next = focusNode.next;
|
||||
if (next != null) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
setFocus(next, 0, false);
|
||||
}
|
||||
break;
|
||||
@@ -462,7 +464,7 @@ public class SongMenu extends BasicGameState {
|
||||
break;
|
||||
OsuGroupNode prev = focusNode.prev;
|
||||
if (prev != null) {
|
||||
SoundController.playSound(SoundController.SOUND_MENUCLICK);
|
||||
SoundController.playSound(SoundEffect.MENUCLICK);
|
||||
setFocus(prev, (prev.index == focusNode.index) ? 0 : prev.osuFiles.size() - 1, false);
|
||||
}
|
||||
break;
|
||||
@@ -621,11 +623,11 @@ public class SongMenu extends BasicGameState {
|
||||
if (MusicController.isTrackLoading())
|
||||
return;
|
||||
|
||||
SoundController.playSound(SoundController.SOUND_MENUHIT);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
OsuFile osu = MusicController.getOsuFile();
|
||||
Display.setTitle(String.format("%s - %s", game.getTitle(), osu.toString()));
|
||||
OsuParser.parseHitObjects(osu);
|
||||
SoundController.setSampleSet(osu.sampleSet);
|
||||
HitSound.setSampleSet(osu.sampleSet);
|
||||
Game.setRestart(Game.RESTART_NEW);
|
||||
game.enterState(Opsu.STATE_GAME, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package itdelatrisu.opsu.states;
|
||||
|
||||
import itdelatrisu.opsu.MusicController;
|
||||
import itdelatrisu.opsu.Opsu;
|
||||
import itdelatrisu.opsu.OsuParser;
|
||||
import itdelatrisu.opsu.OszUnpacker;
|
||||
import itdelatrisu.opsu.SoundController;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import itdelatrisu.opsu.audio.MusicController;
|
||||
import itdelatrisu.opsu.audio.SoundController;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user