Commit Graph

27 Commits

Author SHA1 Message Date
Jeffrey Han
53c79c5d85 Major refactoring - now using far more logical class names.
- 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>
2015-05-16 21:25:19 -04:00
Jeffrey Han
81601d41aa Implemented various keyboard shortcuts.
- 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>
2015-03-06 01:29:50 -05:00
Jeffrey Han
235adc539e Extracted UI components from Utils into a separate UI class.
Added draw(), update(), and enter() methods in UI to do all the necessary calls (instead of letting the states handle them).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-05 13:27:45 -05:00
Jeffrey Han
4826798fba Reformatting of #20, and disable the hit error bar by default.
Added an option (in the "Custom" tab) to enable the bar.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-15 01:40:01 -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
Jeffrey Han
f71b2c25f2 Quick fix: 'Esc' key not properly checked in splash screen.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-27 15:20:03 -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
a48f8bd54d Implemented in-game beatmap reloading.
- Press F5 to reload beatmaps in the song menu (resets OsuGroupList, then invokes OSZ unpacker and OsuFile parser).
- Many components reused from Splash screen (progress display, 'Esc' interrupt).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-21 01:38:02 -05:00
Jeffrey Han
19476993f9 Options state refactoring.
- 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>
2015-01-20 23:56:10 -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
be1ec64f28 Eliminated unneeded calls to Graphics.setColor().
The method creates a new Color object each call, so set color in UnicodeFont.drawString() instead.

Also slightly padded the song information text.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-16 14:46:45 -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
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
f6eac71643 Moved most Image creation into GameImage enum.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-07 23:45:21 -05:00
Jeffrey Han
1e806bc9c6 SoundController refactoring.
- 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>
2015-01-07 19:29:51 -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
64788b2832 Song sort refactoring.
- Created "SongSort" enum to handle everything related to sorting OsuGroupNode objects.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-18 20:33:41 -04:00
Jeffrey Han
d5b7ff3516 Small visual tweaks.
- Modified "LoadVerbose" option so that 'false' will display a progress bar (instead of nothing at all), and made this the default.
- Slowed down a few shifting animations.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-15 13:21:37 -04:00
Jeffrey Han
e7f74d8dd6 Added loading progress for sound files in splash screen.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-08 14:08:06 -04:00
Jeffrey Han
6d3c333a3f Minor follow-up to d9c251e.
- Added 'zip4j' library to ant build script.

Other changes:
- Added 'esc' hotkey to exit from splash screen.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-06 02:27:53 -04:00
Jeffrey Han
d9c251ef82 Added a module for unpacking OSZ archives.
- Included 'zip4j' library to extract the ZIP archives. (Homepage: http://www.lingala.net/zip4j/)
- OSZ files are unpacked from the root directory by default, and the path can be changed in the configuration file.

Other changes:
- Fixed a critical issue in splash screen where thread would running before other states loaded. (blame: dea7e94)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2014-07-06 01:58:44 -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