v2.3.1: shifted music tracks are now considered equivalent
This commit is contained in:
@@ -94,12 +94,19 @@ public enum Music {
|
||||
|
||||
if (isPlaying() && this.trackList != null && tracks.length == trackList.length){
|
||||
|
||||
boolean sameList = true;
|
||||
for (int i = 0; i < tracks.length; i ++){
|
||||
if (!tracks[i].equals(trackList[i]) || chances[i] != trackChances[i]){
|
||||
sameList = false;
|
||||
break;
|
||||
//lists are considered the same if they are identical or merely shifted
|
||||
// e.g. the regular title theme and the victory theme are considered equivalent
|
||||
boolean sameList = false;
|
||||
for (int ofs = 0; ofs < tracks.length; ofs++){
|
||||
sameList = true;
|
||||
for (int j = 0; j < tracks.length; j++){
|
||||
int i = (j+ofs)%tracks.length;
|
||||
if (!tracks[i].equals(trackList[j]) || chances[i] != trackChances[j]){
|
||||
sameList = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sameList) break;
|
||||
}
|
||||
|
||||
if (sameList) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
@@ -41,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndRanking;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
import com.watabou.utils.GameMath;
|
||||
|
||||
public class RankingsScene extends PixelScene {
|
||||
@@ -59,6 +61,11 @@ public class RankingsScene extends PixelScene {
|
||||
|
||||
super.create();
|
||||
|
||||
Music.INSTANCE.playTracks(
|
||||
new String[]{Assets.Music.THEME_1, Assets.Music.THEME_2},
|
||||
new float[]{1, 1},
|
||||
false);
|
||||
|
||||
uiCamera.visible = false;
|
||||
|
||||
int w = Camera.main.width;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
@@ -36,7 +35,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -93,10 +91,6 @@ public class WndGame extends Window {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
||||
Music.INSTANCE.playTracks(
|
||||
new String[]{Assets.Music.THEME_1, Assets.Music.THEME_2},
|
||||
new float[]{1, 1},
|
||||
false);
|
||||
Game.switchScene( RankingsScene.class );
|
||||
}
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user