diff --git a/CrankItUp.Game/src/CrankItUpGame.cs b/CrankItUp.Game/src/CrankItUpGame.cs index c0a76a6..6b32b1d 100644 --- a/CrankItUp.Game/src/CrankItUpGame.cs +++ b/CrankItUp.Game/src/CrankItUpGame.cs @@ -24,7 +24,6 @@ private void load(Storage store) try { var sr = new StreamReader(store.GetStream("settings.json")); - // Read the stream as a string, and write the string to the console. var settings = JObject.Parse(sr.ReadToEnd()); Settings.inputmode = (Settings.InputMode)settings.GetValue("inputMode"); } diff --git a/CrankItUp.Game/src/Screens/CreditsScreen.cs b/CrankItUp.Game/src/Screens/CreditsScreen.cs index de176b1..34d8899 100644 --- a/CrankItUp.Game/src/Screens/CreditsScreen.cs +++ b/CrankItUp.Game/src/Screens/CreditsScreen.cs @@ -3,8 +3,6 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osuTK; -using osu.Framework.Audio; -using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Framework.Graphics.Containers; @@ -16,7 +14,7 @@ public partial class CreditsScreen : Screen CIUButton backButton; [BackgroundDependencyLoader] - private void load(AudioManager audio, TextureStore textures) + private void load(TextureStore textures) { backButton = new CIUButton(textures) { diff --git a/CrankItUp.Game/src/Screens/DifficultySelect.cs b/CrankItUp.Game/src/Screens/DifficultySelect.cs index 5b10078..e17457e 100644 --- a/CrankItUp.Game/src/Screens/DifficultySelect.cs +++ b/CrankItUp.Game/src/Screens/DifficultySelect.cs @@ -90,6 +90,7 @@ private void load(AudioManager audio, TextureStore textures, Storage storage) continue; } } + int dataVersion; try { @@ -132,6 +133,8 @@ private void load(AudioManager audio, TextureStore textures, Storage storage) } ); } + + // Create a grid of buttons, same as TrackSelect.cs position.Y += 50; if (position.Y == 600) { @@ -157,6 +160,7 @@ private void load(AudioManager audio, TextureStore textures, Storage storage) // make an empty spritetext, as there is nothing to say invalidDifficultyText = new SpriteText { }; } + InternalChildren = new Drawable[] { new DrawSizePreservingFillContainer diff --git a/CrankItUp.Game/src/Screens/TrackSelect.cs b/CrankItUp.Game/src/Screens/TrackSelect.cs index fca74bc..9610c82 100644 --- a/CrankItUp.Game/src/Screens/TrackSelect.cs +++ b/CrankItUp.Game/src/Screens/TrackSelect.cs @@ -36,8 +36,9 @@ private void load(TextureStore textures, Storage storage) Origin = Anchor.BottomRight, Position = new Vector2(0, 100) }; - var maps = storage.GetDirectories("maps"); + Vector2 position = new Vector2(0, 0); + var maps = storage.GetDirectories("maps"); foreach (string mapPath in maps) { var map = mapPath[5..]; @@ -50,8 +51,11 @@ private void load(TextureStore textures, Storage storage) } catch { + // if we can't get a metadata.json, or it's invalid, we can skip it + // logging the specific issue in the file is done by the TrackMetadata class continue; } + trackContainer.Add( new CIUButton(textures) { @@ -62,6 +66,8 @@ private void load(TextureStore textures, Storage storage) Action = () => pushDifficultySelect(map, mapPath, storage), } ); + + // change the position, relative to it's current position, preventing overlap position.Y += 50; if (position.Y == 600) { @@ -94,6 +100,7 @@ private void pushMenu() public void pushDifficultySelect(string map, string mapPath, Storage storage) { + // we get the metadata again here, as the metadata gathered in load() is overwriten each loop var mapStorage = storage.GetStorageForDirectory(mapPath); trackmeta = new TrackMetadata(mapStorage.GetStream("metadata.json")); this.Push(new DifficultySelect(map, trackmeta));