clean up; music selection no longer wraps back to top;
This commit is contained in:
		@@ -38,7 +38,6 @@ public class RhythmBullet extends Game {
 | 
			
		||||
	
 | 
			
		||||
	private AssetManager assetManager = new AssetManager();
 | 
			
		||||
	private Skin skin;
 | 
			
		||||
	TextureAtlas skinAtlas;
 | 
			
		||||
	private Preferences preferences;
 | 
			
		||||
	private RoundingResolutionHandler rRHandler;
 | 
			
		||||
	private InitialScreen initialScreen;
 | 
			
		||||
@@ -217,7 +216,6 @@ public class RhythmBullet extends Game {
 | 
			
		||||
		Gdx.app.debug("Core", "disposing...");
 | 
			
		||||
		try {
 | 
			
		||||
			getScreen().dispose();
 | 
			
		||||
			skinAtlas.dispose();
 | 
			
		||||
			getSkin().dispose();
 | 
			
		||||
			assetManager.dispose();
 | 
			
		||||
			assetPack.dispose();
 | 
			
		||||
 
 | 
			
		||||
@@ -207,13 +207,15 @@ public class MusicSelectionPage extends Page implements Observer {
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private void scrollDown() {
 | 
			
		||||
		selectables.selectNext();
 | 
			
		||||
		scrollPane.scrollTo(selectables.getChecked().getX(), selectables.getChecked().getY(), selectables.getChecked().getWidth(), selectables.getChecked().getHeight());
 | 
			
		||||
		if (selectables.selectNext()) {
 | 
			
		||||
			scrollPane.scrollTo(selectables.getChecked().getX(), selectables.getChecked().getY(), selectables.getChecked().getWidth(), selectables.getChecked().getHeight());
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	private void scrollUp() {
 | 
			
		||||
		selectables.selectPrevious();
 | 
			
		||||
		scrollPane.scrollTo(selectables.getChecked().getX(), selectables.getChecked().getY(), selectables.getChecked().getWidth(), selectables.getChecked().getHeight());
 | 
			
		||||
		if (selectables.selectPrevious()) {
 | 
			
		||||
			scrollPane.scrollTo(selectables.getChecked().getX(), selectables.getChecked().getY(), selectables.getChecked().getWidth(), selectables.getChecked().getHeight());
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public FileHandle getSelectedMusic() {
 | 
			
		||||
@@ -465,20 +467,22 @@ public class MusicSelectionPage extends Page implements Observer {
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		public void selectNext() {
 | 
			
		||||
		public boolean selectNext() {
 | 
			
		||||
			int index = getCheckedIndex() + 1;
 | 
			
		||||
			if (index == buttons.size) {
 | 
			
		||||
				index = 0;
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			buttons.get(index).setChecked(true);
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		public void selectPrevious() {
 | 
			
		||||
		public boolean selectPrevious() {
 | 
			
		||||
			int index = getCheckedIndex() - 1;
 | 
			
		||||
			if (index == -1) {
 | 
			
		||||
				index = buttons.size -1;
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			buttons.get(index).setChecked(true);
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		@Override
 | 
			
		||||
@@ -510,7 +514,6 @@ public class MusicSelectionPage extends Page implements Observer {
 | 
			
		||||
			setPosition(scrollPane.getWidth() + scrollPane.getX(), 0);
 | 
			
		||||
			setSize(width, height);
 | 
			
		||||
			subInformation = new Table(skin);
 | 
			
		||||
			subInformation.setBackground("corner-panel");
 | 
			
		||||
			albumCover = new Image(assets.get("defaultCover.png", Texture.class));
 | 
			
		||||
			songTitle = new ScrollText("", null, skin, true, true);
 | 
			
		||||
			author = new Label(null, skin, "sub-font", skin.getColor("default"));
 | 
			
		||||
@@ -540,7 +543,6 @@ public class MusicSelectionPage extends Page implements Observer {
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		public void setToDefault() {
 | 
			
		||||
			
 | 
			
		||||
			clear();
 | 
			
		||||
			subInformation.clear();
 | 
			
		||||
			
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user