Commit Graph

30 Commits

Author SHA1 Message Date
fd
fff0080ddc Combo Color ordering
General Image scaling
Score fixed size width

Spinner centering (slick has bad centering)

Broke Ranking Panel
2015-02-15 18:51:07 -05:00
Jeffrey Han
b69ff68d7c Added methods to delete songs and song groups.
- OsuGroupList.get().deleteSongGroup() will delete a song group from the list.
- OsuGroupList.get().deleteSong() will delete an individual song from the list (must be expanded), and will delete the song group if there are no remaining songs in the group.
- If possible, deleted beatmap files are moved to system trash (using JNA); otherwise, they are deleted immediately.  This is done through Utils.deleteToTrash().

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-12 02:27:33 -05:00
Jeffrey Han
be3b94f5db Prevent downloading songs that are already loaded. (base: fluddokt/opsu/76778f8)
- All beatmap set IDs are now stored in a set in OsuGroupList.
- OsuParser now checks the directory name for beatmap set IDs if the OsuFile doesn't contain one (for older beatmap formats).

Tweaks:
- Clear completed downloads when hitting "Import All".
- Call Download.updateReadSoFar() upon starting downloads instead of waiting for user to hover over the button (causing an unnecessary delay).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-09 23:22:58 -05:00
Jeffrey Han
ec90d6fd03 Beatmap downloader improvements and fixes.
Updates:
- Added some buttons to downloads menu: clear inactive downloads, import beatmaps, reset search, and show/hide unranked maps.
- Small changes to OsuParser, OszUnpacker, and OsuGroupList (mostly adding return values) to allow parsing only newly unpacked beatmaps.
- Added alpha fade hover effect to MenuButton, as an alternative to expanding (used for 3-part menu buttons).
- Added text rendering fields to MenuButton (also for the 3-part menu buttons).
- Added sound effects to downloads menu.

Fixes:
- Check downloads for illegal filename characters, and remove them if necessary.
- The number of results and downloads shown now supports all resolutions.
- Confirmation dialog no longer appears when restarting the application (since downloads are static).
- Do not set a focus node immediately if the theme song will be played.
- Always play the theme song if no songs are loaded (even if disabled in settings).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-02 00:15:16 -05:00
Jeffrey Han
70c70fd812 Implemented an internal beatmap downloader (using Bloodcat).
The downloads menu can be accessed through the button on the right side of the main menu.  The downloader supports searching and concurrent downloads (NOTE: this is limited by the download server!).  Double-click any search result to begin downloading it to the SongPacks directory; cancel the download by hitting the red 'x' in the upper-right corner.  A confirmation will appear if trying to quit opsu! while downloads are running.

New classes:
- Download: represents an individual download from a remote address to a local path, and provides status and progress information; downloads files using Java NIO.
- DownloadNode: holds a Download object as well as additional beatmap fields, and handles drawing.
- DownloadList: manages the current list of downloads.
- DownloadsMenu: game state controller.
- DownloadServer: interface for a beatmap download server.
- BloodcatServer: implements DownloadServer using Bloodcat.
- ReadableByteChannelWrapper: wrapper for ReadableByteChannel that tracks progress.

Added images:
- "downloads" image by @kouyang.
- "search-background" image from "Minimalist Miku" skin (listed in credits).
- "delete" icon by Visual Pharm (https://www.iconfinder.com/icons/27842/) under CC BY-ND 3.0.

Other changes:
- Added up/down/left/right Expand directions to MenuButton class.
- Removed width/height parameters from OsuParser (leftovers).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-01 02:10:17 -05:00
Jeffrey Han
e93fe25834 Code style cleanup from #12.
- Moved all curve-related classes into a new package.
- Added some fields and methods to Curve abstract class.
- Removed the old (no longer used) Bezier subclass.
- Changed Error throwing to ErrorHandler.error() calls.
- Formatted code.

Also fixed a crash when reaching the ranking screen with the "Auto" mod active.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 20:36:23 -05:00
fd
33f2207881 CircumscribedCircle, LinearBezier Curves, multi repeats arrows,
CircleColorOrdering

fd
2015-01-28 00:30:51 -05:00
Jeffrey Han
c9e14bfc70 Comment format changes.
- 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>
2015-01-22 00:44:45 -05:00
Jeffrey Han
e2c1f2f937 Small memory optimization: reuse audio File objects in song groups.
Each song group references the same audio file probably 100% of the time, so don't create duplicate objects.

Also, follow-up to 3b13cc7: the up/down arrow keys now change global volume in the main menu and game states (in addition to the scroll wheel).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-20 22:19:14 -05:00
Jeffrey Han
2bc45bec0a Follow-up to f98edf8: better checks for application restart.
- 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>
2015-01-20 19:24:59 -05:00
Jeffrey Han
f98edf8fc8 Enabled application restarts.
- 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>
2015-01-20 19:01:18 -05:00
Jeffrey Han
53158fd310 Interrupt OsuParser by pressing 'ESC' in Splash state.
Allows parsing only a subset of OsuFiles, in case parsing takes too long.

Other changes:
- Press 'ESC' three times to exit from the Splash state.
- Override Container.exit().
- Reset MusicController in closeRequested() to prevent an OpenAL error.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-18 15:26:00 -05:00
Jeffrey Han
b54eb95747 Updated copyright notices for 2015.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 12:05:44 -05:00
Jeffrey Han
553f091693 Added ErrorHandler class to handle all critical errors.
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>
2015-01-15 21:55:26 -05:00
Jeffrey Han
dfeb981361 Some memory optimizations.
- Load all OsuFile String objects into a hash table while parsing, to eliminate duplicate strings.
- Trim all ArrayList objects in OsuFiles.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-14 21:48:24 -05:00
Jeffrey Han
4152af4977 Made OsuGroupList a singleton.
(This makes a lot more sense than storing the single pointer in Opsu.groups.)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-11 14:17:33 -05:00
Jeffrey Han
ce0eccd32b Implemented skinnable theme songs.
Plays a theme song when opsu! starts (can be disabled in options).  The default song is "welcome to osu!" by nekodex, uploaded by CyberKitsune.

To change the song, place a new "theme.osu" in the skins folder and edit the file name, metadata, and song length (at minimum).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-12-20 18:17:04 -05:00
Jeffrey Han
904a54df26 Added support for Unicode (non-English) metadata.
- Setting is off by default, and can be switched on in the options menu.
- Changed default font to "Arial Unicode MS" (CJK), with fallback to "Lucida Sans Console" (non-CJK).  Cross-platform support may be added later.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-08-24 23:48:52 -04:00
Jeffrey Han
83e486054f Catch (nearly) all exceptions thrown by OsuParser.
- Properly handle bad input and log a warning.  The game may run with some gameplay errors (ex. if no base TimingPoint is parsed), but it should not crash.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-24 13:38:59 -04:00
Jeffrey Han
fe293827e6 More small bug fixes.
- Always use '.' as decimal separator in options file, regardless of locale.
- Properly handle bad input when initially parsing hit objects.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-19 03:31:54 -04:00
Jeffrey Han
717605564d Hit object refactoring.
- Moved the bulk of hit object parsing into the OsuHitObject constructor, and made all fields private.  Only combo-related data is still set by OsuParser.
- Added 'isCircle()', 'isSlider()', 'isSpinner()', and 'isNewCombo()' methods for convenience.

Other changes:
- Fixed difficulty overrides are no longer affected by game mods.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-18 15:11:57 -04:00
Jeffrey Han
b0c0b44ef1 Major track length-related updates.
- Parse and store the end time for every beatmap (i.e. end time of last hit object).
- Added a 'length' sorting tab.
- Added 'length' search condition.
- Removed 'getTrackLength()' and 'getTrackLengthString()' methods, as they are no longer needed.
- Added a loader spritesheet animation to render during MP3 conversions (in place of track length rendering upon completion).

Other changes:
- Added a yellow progress circle during lead-in time.
- Fixed sorting tab positioning.
- Slightly increased button animation speed in "Main Menu Exit" state.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-17 21:16:15 -04:00
Jeffrey Han
0a5e7f66ec Improved search feature.
- Search is now more like osu!, where subsequent search terms limit the existing result list (as opposed to further expanding it).
- Replaced global tag HashMap with String instance variables, since the previous implementation is incompatible with the above change (resulting in slightly higher memory usage and search times).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-17 01:00:28 -04:00
Jeffrey Han
5a1972a2bd Some code cleanup.
- Overhauled OsuTimingPoint class: parsing is done in the constructor, and fields are no longer public.
- Improved consistency of static/non-static fields in a couple of classes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-09 13:36:42 -04:00
Jeffrey Han
dea7e942a3 Created a splash screen state for loading resources.
- Game now boots to splash screen, which displays parser progress.
- Added option "LoadVerbose" to disable rendering the progress text.
- Main Menu backgrounds now fade in regardless of DynamicBackground setting (as a transition from the splash screen).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-05 21:00:52 -04:00
Jeffrey Han
c72b9b955a Quick fix for parsing invalid *.osu files.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-03 18:50:44 -04:00
Jeffrey Han
812b83af45 Added extra checks in the parser for invalid line.
Credits to xasuma for the report.
2014-07-02 10:14:15 -04:00
Jeffrey Han
ab487c5e80 Replaced native cursors with skinnable ones.
- Added support for both the new (2013+) and old cursor styles.  These can be toggled on/off in the configuration file.
- Added cursor images by XinCrin (old style) and teinecthel (new style).

Other changes:
- Refactoring: Created a "Utils" module, containing methods and constants that didn't belong in the "Options" state and some duplicated drawing methods.
- Mouse is now grabbed during gameplay.
- Removed 'optionsChanged' switch, simplifying adding new options.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-01 19:32:03 -04:00
Jeffrey Han
6bdb026447 Added support for floating-point difficulty values (v13).
Thanks to Marcin for the info and FieryLight for the report.
2014-06-30 04:03:39 -04:00
Jeffrey Han
9da166f60f Initial commit. 2014-06-29 22:17:04 -04:00