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>
This commit is contained in:
@@ -465,6 +465,26 @@ public enum GameImage {
|
||||
return img.getScaledCopy((h * 0.15f) / img.getHeight());
|
||||
}
|
||||
},
|
||||
DOWNLOADS ("downloads", "png", false, false) {
|
||||
@Override
|
||||
protected Image process_sub(Image img, int w, int h) {
|
||||
return img.getScaledCopy((h * 0.45f) / img.getHeight());
|
||||
}
|
||||
},
|
||||
SEARCH_BG ("search-background", "png|jpg", false, true) {
|
||||
@Override
|
||||
protected Image process_sub(Image img, int w, int h) {
|
||||
img.setAlpha(0.8f);
|
||||
return img.getScaledCopy(w, h);
|
||||
}
|
||||
},
|
||||
DELETE ("delete", "png", false, false) {
|
||||
@Override
|
||||
protected Image process_sub(Image img, int w, int h) {
|
||||
int lineHeight = Utils.FONT_DEFAULT.getLineHeight();
|
||||
return img.getScaledCopy(lineHeight, lineHeight);
|
||||
}
|
||||
},
|
||||
HISTORY ("history", "png", false, false) {
|
||||
@Override
|
||||
protected Image process_sub(Image img, int w, int h) {
|
||||
@@ -573,10 +593,7 @@ public enum GameImage {
|
||||
* @param type the file types (separated by '|')
|
||||
*/
|
||||
GameImage(String filename, String type) {
|
||||
this.filename = filename;
|
||||
this.type = getType(type);
|
||||
this.skinnable = true;
|
||||
this.preload = true;
|
||||
this(filename, type, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -586,11 +603,8 @@ public enum GameImage {
|
||||
* @param type the file types (separated by '|')
|
||||
*/
|
||||
GameImage(String filename, String filenameFormat, String type) {
|
||||
this.filename = filename;
|
||||
this(filename, type, true, true);
|
||||
this.filenameFormat = filenameFormat;
|
||||
this.type = getType(type);
|
||||
this.skinnable = true;
|
||||
this.preload = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user