Also fixed an issue where songMenu.resetGameDataOnLoad() sometimes wasn't being called when it should be (e.g. after playing a beatmap, if you move to a different screen, your score won't appear in the song menu right away). It's now being called more often than necessary, but that should be fine.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Renamed "OsuFile" to "Beatmap". All related variables and methods with "osu" have also been renamed to "beatmap" (or variants of each).
- Renamed "OsuGroupNode" to "BeatmapSetNode". Avoids confusion since groups are identified by a "set ID", not a "group ID".
- Renamed "OsuGroupList" to "BeatmapSetList", for the same reason as above.
- Renamed "OsuDB" to "BeatmapDB", for the same reason as above.
- Moved classes directly related to parsed beatmaps (Beatmap, BeatmapSetList, BeatmapSetNode, OsuHitObject, and TimingPoint) into a new "beatmap" package.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
Fixes:
- Set the modified speed again after unpausing and loading from checkpoints.
- Changed countdown delays based on current speed.
- Changed color of highlighted song info text to that in osu!.
- Made playback images unskinnable.
Code changes:
- Changed playback field in Game class to the PlaybackSpeed object instead of just the button.
- Changed PlaybackSpeed.next() to a non-static method.
- Added/edited Javadocs.
- Changed image names.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
The master volume can now be changed (using the mouse wheel) with the ALT key pressed in any menu, as in osu!.
Also improved the handling of dimmed tracks.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Glyphs are now loaded for specific fonts as needed, not for all of them at once. This reduces lag and saves memory.
- Fixed glyphs not being loaded in the downloads menu.
- Moved Utils.loadGlyphs() calls directly above text drawing code (easier to maintain, and fixes a bug with text flickering once).
Also removed MusicController methods 'getTrackName()' and 'getArtistName()' (not needed).
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Added modified copy of slick.gui.TextField: added CTRL+BACKSPACE for word deletion, and disabled left/right arrows to move cursor and CTRL+Z to undo.
- Fixed musicEnded() incorrectly setting the "trackEnded" upon swapping tracks. This has caused some nasty loops since #38.
- Fixed a null pointer exception in OsuDB from 0b03912.
- Fixed the song menu search bar transition being incorrectly reset when hitting backspace on a 0-length query.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Main menu:
-- 'd': opens downloads menu
-- 'r': plays random track
- Song menu:
-- SHIFT+DEL: opens beatmap deletion menu
Other changes:
- In the main menu, tracks now play from the beginning instead of the preview time.
- Fixed "next page" icon sometimes showing in the downloads menu when a next page didn't exist.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Replaced duplicate GameImage.process_sub() calls from related images with calling a single method, for easier editing.
- Suppress warnings from overwritten Slick2D classes.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Removed the temporary directory (Options.TMP_DIR), which is no longer needed.
- Excluded original Slick2D classes that were overridden in pom.xml.
- Formatting changes and documentation.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
Seems to work with ogg now too.
Hopefully this fixes it, but I don't
actually know much about concurrency.
However it stills throws "Could not clear SoundStore sources, err"
and so it remains removed.
May rarly crash/not play on next music.
May have introduced other unknown bugs.
This may be due to loading it async.
Also loading of ogg is not loaded async anymore as it seems it doesn't
work very well.
Fixes a bug during gameplay where if the music track ends before the last hit object is processed (esp. spinners), the game would hang.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
Prevents a bug due to threading where the theme song can still be playing in the song menu (when songs are loaded) if the user clicks fast enough.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Fixed a crash when closing the application in the ranking screen when viewing a score.
- Fixed a minor bug where OsuGroupList fields were not being erased upon restart.
- Dim the track volume by 50% when viewing a score.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Collapsed Javadoc comments for all fields.
- OsuFile now has proper Javadoc comments.
- Fixed various mistakes with comments.
Some changes with enums:
- Changed Class.values() calls to values().
- Changed size() calls to a SIZE field.
- Changed valuesReversed() calls to a VALUES_REVERSED field.
- Removed 'static' from enum declarations.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Renamed Options state into OptionsMenu, and created Options class for solely handling user options. Moved everything unrelated to the actual options menu into the static Options class.
- OptionsMenu no longer has static fields.
- Refactored option tabs into an enum, which makes the code much cleaner.
Also fixed a bug where global volume wasn't being used on container initialization.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Fixes resource reloading when OsuGroupList is empty (i.e. if user has no beatmaps installed).
- OsuGroupList is no longer initialized with a class instance; OsuGroupList.create() is called by OsuParser.
- Also clear 'lastOsu' field in MusicController.reset(). Fixes theme song not playing on restart if it was the last track played (i.e. if no beatmaps installed).
- Call MusicController.reset() last so that more garbage is collected.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Pressing Ctrl+Shift+F5 in the options menu restarts the game. Beatmaps and sounds are not reloaded.
- Use GameContainer.setForceExit(false) to trigger a restart after exiting.
Other changes:
- Fixed general issues with track pausing/pause states.
- Store all background images loaded in OsuFiles in a static hash table, instead of in individual objects. This allows easier access to the allocated memory.
- Only delete OSZ files if they were unzipped. (They were previously deleted in all cases.)
- Moved more images (mods, playfield, lighting) into GameImage.
- Moved OsuHitObject initialization inside Utils.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- All sounds are now multiplied by a master volume setting.
- Changed all default volume levels.
- Scrolling in the main menu and game states changes the master volume and displays a volume bar on the right side of the screen.
- "volume-bg.png" image by @kouyang.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
Critical game errors (detected in Game.updateAndRender()) are now passed through ErrorHandler. Note that the actual exception is not displayed in the ErrorHandler window, only the log.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Fixes an issue where the first few milliseconds of the theme song would always play at full volume, even if container is not focused.
- Allows easier application to any song.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- Padded game score display, and always display 2 digits in front of the decimal (e.g. 00.00% instead of 0.00%).
- Keep map progress circle at a fixed location instead of basing it off the score length.
- Moved some track resets (pause + restart at preview) to trigger upon loading the song menu. Fixes weird behaviors when leaving the game state.
- Cleaned up trailing whitespace and added missing overrides.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This mostly replaces the Slick2D Log class for error reporting. Most game errors will now trigger the error popup.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This causes a noticeable drop in memory usage in most cases.
Also renamed the "crash" popup since the game doesn't necessarily crash.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- MusicController.getPosition() now returns time even when track is paused. (e.g. song progress bar in main menu won't reset when paused)
- Force unpause track when entering the song menu.
- Rewrote Game.RESTART_* constants as enums.
- Cleaned up logo play/exit button scaling.
- MainMenu.previous is now non-static.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
- 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>