Commit Graph

68 Commits

Author SHA1 Message Date
yugecin
3a137b0ff0 allow seticon to fail (close #85) 2016-12-10 14:46:46 +01:00
yugecin
e878f0fb0d Merge branch 'master' of https://github.com/itdelatrisu/opsu into 'upstream'
# Conflicts:
#	README.md
#	src/itdelatrisu/opsu/Opsu.java
#	src/itdelatrisu/opsu/Utils.java
#	src/itdelatrisu/opsu/render/CurveRenderState.java
#	src/itdelatrisu/opsu/states/Game.java
2016-12-10 01:19:31 +01:00
Jeffrey Han
38daee002f Follow-up to af667a4.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2016-12-08 20:05:08 -05:00
Jeffrey Han
af667a48d5 Added GL version/vendor to error report. (#207)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2016-12-08 20:00:14 -05:00
yugecin
6b1b4e2339 add option to allow multiple instances (closes #33) 2016-10-14 23:54:06 +02:00
Jeffrey Han
79bfa1c255 Properly fix #177.
Previous fix (#186) threw NPE upon failing a song.  Thanks to #155.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2016-10-13 17:51:51 -04:00
Jeffrey Han
3b847d088d Follow-up to #155.
Some code cleanup and tweaks to the scoreboard display.
2016-10-13 14:41:58 -04:00
Matteo Signer
d7c980e0a4 Misc. bugfixes 2016-04-04 10:59:50 +02:00
Jeffrey Han
ba240797d8 Replaced all linear fade-out transitions with eased transitions.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-11-19 17:47:46 -05:00
Jeffrey Han
31d0c237df Create Natives dir in XDG_CACHE_HOME, not the working dir. (fixes #129)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-30 14:31:01 -05:00
Jeffrey Han
6d284cdd80 Organize imports.
Some of these got re-ordered when I updated Eclipse -- resetting to the original sort order.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-28 21:29:21 -05:00
Jeffrey Han
f773a8ecf8 Remove jinput dependency since controllers aren't used.
jinput natives are no longer loaded or packaged in the jar.

Excluded the lwjgl dependency within the slick2d package since it depends on an older version (2.9.1) of lwjgl.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-28 11:07:03 -05:00
Jeffrey Han
b54886a379 Follow-up to #126.
- Fix the XDG directory flag that got removed with JarSplice. To enable XDG directories, set the 'Use-XDG' property in either build file to 'true'.
- Always re-build jars in the Gradle script (disable "up to date" for the task).
- Delete JarSplicePlus.jar since it's no longer being used.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-27 14:14:04 -05:00
Lemmmy
dea0104c4d Added the Gradle build system and added a new native loader 2015-08-27 15:50:36 +01:00
Jeffrey Han
b83d6be5fd Clarified GameImage "skinnable" field as "beatmap-skinnable".
Renamed some methods and modified comments to avoid this confusion, as game skins were implemented much later than beatmap skins.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-23 20:41:09 -05:00
Jeffrey Han
ae5016f3ab Validate audio files before trying to load them. (part of #120)
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>
2015-08-20 22:58:45 -05:00
Jeffrey Han
93615736af Minor port-related fixes.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-12 22:00:58 -05:00
Jeffrey Han
7dc5f973de Show a more informative error message for BindException. (fixes #119)
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-08-12 21:46:10 -05:00
Jeffrey Han
26ab61910e Added option to disable automatic checking for updates.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-07-07 19:03:54 -05:00
Jeffrey Han
0c42f1ed01 Cursor refactoring.
Moved cursor-related code out of UI and into a new non-static "Cursor" class.

Also, the cursor is no longer reset after gameplay if it wasn't skinned.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-05-29 04:48:03 -04:00
Jeffrey Han
2c47e9a1b9 Moved "UI" and "MenuButton" classes to new package "opsu.ui".
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-05-29 01:55:57 -04:00
Jeffrey Han
40e4495030 Initial skin loader implementation.
- Skins are now loaded from subdirectories of the root "Skins" directory, and can be changed in-game (but requires a restart).
- Changed the default skin directory to the osu! directory, if available.

This implements a full parser for skin.ini (excluding CTB/Mania elements) based on the current wiki information.  None of the settings have been implemented yet.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-05-23 23:48:28 -04:00
Jeffrey Han
50d55d8d99 Better error handling when running JARs in a directory with '!'.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-05-07 13:28:40 -04:00
Jeffrey Han
3bd9bbdafd New updater notification and minor OsuDB fix.
- A bar notification is now shown after opsu! updates.
- Insert the current database version into the beatmap cache upon creation (fixes the initial version check) and only update the version if necessary.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-12 02:38:43 -04:00
Jeffrey Han
8c24ef97c7 Follow-up to #38: loop tracks on states by default.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 19:04:45 -05:00
Jeffrey Han
447fd93e60 Merge pull request #38 from fluddokt/omaster
Next track on trackEnded
2015-03-07 18:43:58 -05:00
Jeffrey Han
4718cb9aa5 Follow-up to #37.
- Removed 'currentObject' parameter from HitObject.draw() since it's no longer used.
- Changed "spun out" rpm.
- Formatting changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 15:38:59 -05:00
fd
11b5c41b46 Next track on trackEnded
(but checks trackended every update...)
Continue playing while minimized(does not fix moving)
start from preview time in songMenu on repeat
2015-03-07 15:31:21 -05:00
Jeffrey Han
078b765143 Added an automatic updater for new releases.
opsu! will now check for updates upon launching, and will prompt the user to download and run a newer version, if available.
- The remote version file is just the filled "version" file, currently located in the gh-pages branch.
- The new version is downloaded to the working directory, and launched with ProcessBuilder.

Related changes:
- Added "file" property (containing the download URL) to "version" file.
- Added maven-artifact dependency for version comparisons.
- Added methods in Downloads class to retrieve the constructor parameters.
- Moved method for showing exit confirmation dialogs into UI.
- Moved method for reading from URLs into Utils.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-07 04:17:19 -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
bf04083ebd Added a beatmap cache database.
- New database ".opsu.db" stores a cached copy of all parsed beatmaps.  All data will be read from this database unless the last modified time of a beatmap file does not match the one in the table.
- OsuParser inserts all new entries to the database in batch after parsing.
- Added *toString()/*fromString() methods for 'breaks', 'timingPoints', and 'combo' fields in OsuFile for use with the database.
- For any database format changes, update the DATABASE_VERSION field in OsuDB.
- Reloading beatmaps (F5) will now clear the beatmap cache.

Related changes:
- Added small DBController class for convenience.
- Changed 'bg' field of OsuFile to only contain the image file name, instead of the full path.
- Deleted printDatabase() method from ScoreDB.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-03-04 21:03:06 -05:00
Jeffrey Han
ed2d3058ba Merge pull request #16 from SuperNascher/master
Implemented XDG base directory support for Unix-like operating systems.  This is disabled by default.  To use these directories, uncomment the line in pom.xml that sets the "XDG" system property when packaging opsu!.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-13 15:03:17 -05:00
Jeffrey Han
c6791c4714 Added new menus, implemented using a generic ButtonMenu state.
New menus: beatmap options (erase scores/delete), delete beatmaps (single/all), reload songs.
- Pressing F3 or right-clicking in the song menu state will open the beatmap options menu.
- Pressing F5 in the song menu now opens a confirmation menu before reloading beatmaps.
- Deleted MainMenuExit state, which is replaced by MenuState.EXIT in ButtonMenu.
- Decreased Utils.FONT_XLARGE size (to fit in buttons).

Note: as of 800014e, song directory deletion is broken.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-02-13 02:43:34 -05:00
Jeffrey Han
f6eec5cd6c Follow-up to #15.
- 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>
2015-02-12 03:52:19 -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
1ddeb3461d Moved ScoreData to separate file and renamed Scores to ScoreDB.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-29 00:56:30 -05:00
Jeffrey Han
2007058eb1 Quick fixes.
- 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>
2015-01-28 20:57:43 -05:00
Jeffrey Han
0bd72e731a Save game scores to an SQLite database. [Incomplete!]
Implemented basic features (mostly stable).  The remaining features are mostly graphical.
- Added package org.xerial.sqlite-jdbc.  All scores are saved to .opsu_scores.db on table `scores` after a game completes.
- Added "Scores" class to handle all game score data (including database connections).  The "Score" subclass encapsulates all database fields.
- Added "score viewing" constructor to GameData, for use only in the ranking screen.
- Draw the grade of the highest score next to expanded song buttons in the song menu.
- Added "bit" and "abbrev" fields to GameMod, used in storing/displaying scores.
- Hide the retry/exit buttons in the ranking screen when viewing a score.

Other changes:
- Removed "objectCount" field in GameData (no longer necessary).
- Removed "getID()" method in GameMod (no longer used).
- Moved most drawing in GameRanking state to GameData.
- Removed File parameter of "GameData.loadImages()" (leftover, no longer used).

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-28 03:47:24 -05:00
Jeffrey Han
71edef2fa9 Fixed server socket being closed after a restart.
Prevents a bug where multiple program instances can be run.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-27 05:49:58 -05:00
Jeffrey Han
0c1b86de62 Cursor updates.
- Supported loading beatmap-skinned cursors.
- Moved cursor loading into GameImage.
- Removed unnecessary scalings/rotations when drawing.
2015-01-24 22:23:49 -05:00
Jeffrey Han
d2b3249e2c Follow-up to 924f528: small fix.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-23 16:11:10 -05:00
Jeffrey Han
924f528881 Don't reset track to preview position unless game is complete.
(conforming to osu! behavior)

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
2015-01-23 16:06:57 -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
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
ee17b20b25 Added wrapper around AppGameContainer to catch critical errors.
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>
2015-01-18 14:29:48 -05:00
Jeffrey Han
31a97fbc5d Minor graphical updates and code cleaning.
- 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>
2015-01-16 15:44:13 -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