Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.16.2 #23

Merged
merged 12 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
- APK: https://github.com/fluddokt/opsu/issues
- Play Store: https://github.com/AnirudhRahul/opsu-Android/issues
-->

**Operations:** What did you do

**Expected behavior:** What do you expect the program to do

**Actual behaviour:** What did the program actually do

**Extra information:** Platform, version, screenshots, logs, etc.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/SongPacks/
/Songs/
/Temp/
*.log
/.opsu.log
/.opsu.cfg
/.opsu.db*
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ The following files and folders will be created by opsu! as needed:

## Building

opsu! is distributed as both a [Maven](https://maven.apache.org/) and
[Gradle](https://gradle.org/) project.
opsu! is distributed as both a [Maven](https://maven.apache.org/) and [Gradle](https://gradle.org/) project.

### Maven

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'application'
import org.apache.tools.ant.filters.*

group = 'itdelatrisu'
version = '0.16.1'
version = '0.16.2'

mainClassName = 'itdelatrisu.opsu.Opsu'
buildDir = new File(rootProject.projectDir, "build/")
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>itdelatrisu</groupId>
<artifactId>opsu</artifactId>
<version>0.16.1</version>
<version>0.16.2</version>
<properties>
<version>${project.version}</version>
<timestamp>${maven.build.timestamp}</timestamp>
Expand Down
Binary file removed res/search-background.jpg
Binary file not shown.
Binary file added res/selection-mod-cinema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/selection-mod-nightcore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/selection-mod-perfect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/selection-mod-target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion res/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=${version}
file=https://github.com/itdelatrisu/opsu/releases/download/${version}/opsu-${version}.jar
file=https://github.com/clonewith/opsu/releases/download/${version}/opsu-${version}.jar
build.date=${timestamp}
9 changes: 8 additions & 1 deletion src/itdelatrisu/opsu/GameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,12 @@ private void resetComboStreak() {
SoundController.playSound(SoundEffect.COMBOBREAK);
}
combo = 0;
if (GameMod.SUDDEN_DEATH.isActive())
if (GameMod.SUDDEN_DEATH.isActive() || GameMod.PERFECT.isActive())
health.setHealth(0f);
}

private void detectPerfectStreak() {
if (GameMod.PERFECT.isActive())
health.setHealth(0f);
}

Expand Down Expand Up @@ -1577,10 +1582,12 @@ private int handleHitResult(int time, int result, float x, float y, Color color,
case HIT_100:
hitValue = 100;
comboEnd |= 1;
detectPerfectStreak();
break;
case HIT_50:
hitValue = 50;
comboEnd |= 2;
detectPerfectStreak();
break;
case HIT_MISS:
hitValue = 0;
Expand Down
25 changes: 16 additions & 9 deletions src/itdelatrisu/opsu/GameImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
* Game images.
*/
public enum GameImage {
// Launch
// WELCOME_TEXT ("welcome-text", "png"),

// Cursor
CURSOR ("cursor", "png"),
CURSOR_MIDDLE ("cursormiddle", "png"),
Expand Down Expand Up @@ -81,6 +84,7 @@ protected Image process_sub(Image img, int w, int h) {
FOLLOWPOINT ("followpoint", "png"),

// Game Pause/Fail
// PAUSE_ARROW ("arrow-pause", "png"),
PAUSE_CONTINUE ("pause-continue", "png"),
PAUSE_RETRY ("pause-retry", "png"),
PAUSE_BACK ("pause-back", "png"),
Expand Down Expand Up @@ -113,7 +117,7 @@ protected Image process_sub(Image img, int w, int h) {
REVERSEARROW ("reversearrow", "png"),
SLIDER_TICK ("sliderscorepoint", "png"),

// Spinner
// Old Spinner
SPINNER_CIRCLE ("spinner-circle", "png"),
SPINNER_APPROACHCIRCLE ("spinner-approachcircle", "png") {
@Override
Expand All @@ -137,6 +141,12 @@ protected Image process_sub(Image img, int w, int h) {
}
},

// New Spinner
// SPINNER_TOP ("spinner-top", "png"),
// SPINNER_MIDDLE ("spinner-middle", "png"),
// SPINNER_BOTTOM ("spinner-bottom", "png"),
// SPINNER_GROW ("spinner-grow", "png"),

// Game Data
COMBO_BURST ("comboburst", "comboburst-%d", "png"),
SCOREBAR_BG ("scorebar-bg", "png"),
Expand Down Expand Up @@ -207,14 +217,18 @@ protected Image process_sub(Image img, int w, int h) {
MOD_NO_FAIL ("selection-mod-nofail", "png", false, false),
MOD_HARD_ROCK ("selection-mod-hardrock", "png", false, false),
MOD_SUDDEN_DEATH ("selection-mod-suddendeath", "png", false, false),
MOD_PERFECT ("selection-mod-perfect", "png", false, false),
MOD_SPUN_OUT ("selection-mod-spunout", "png", false, false),
MOD_AUTO ("selection-mod-autoplay", "png", false, false),
MOD_HALF_TIME ("selection-mod-halftime", "png", false, false),
MOD_DOUBLE_TIME ("selection-mod-doubletime", "png", false, false),
MOD_NIGHTCORE ("selection-mod-nightcore", "png", false, false),
MOD_HIDDEN ("selection-mod-hidden", "png", false, false),
MOD_FLASHLIGHT ("selection-mod-flashlight", "png", false, false),
MOD_RELAX ("selection-mod-relax", "png", false, false),
MOD_AUTOPILOT ("selection-mod-relax2", "png", false, false),
MOD_CINEMA ("selection-mod-cinema", "png", false, false),
MOD_TARGET ("selection-mod-target", "png", false, false),

// Selection Buttons
SELECTION_MODS ("selection-mods", "png", false, false),
Expand Down Expand Up @@ -316,13 +330,6 @@ 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) {
Expand Down Expand Up @@ -864,4 +871,4 @@ private void process() {
} else
setImage(process_sub(getImage(), unscaledWidth, UNSCALED_HEIGHT).getScaledCopy(getUIscale()));
}
}
}
45 changes: 30 additions & 15 deletions src/itdelatrisu/opsu/GameMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* Game mods.
*/
public enum GameMod {
// TODO: Process PF, NC and TP approxmiately
EASY (Category.EASY, 0, GameImage.MOD_EASY, "EZ", 2, Input.KEY_Q, 0.5f,
"Easy", "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required."),
NO_FAIL (Category.EASY, 1, GameImage.MOD_NO_FAIL, "NF", 1, Input.KEY_W, 0.5f,
Expand All @@ -43,24 +44,26 @@ public enum GameMod {
"HardRock", "Everything just got a bit harder..."),
SUDDEN_DEATH (Category.HARD, 1, GameImage.MOD_SUDDEN_DEATH, "SD", 32, Input.KEY_S, 1f,
"SuddenDeath", "Miss a note and fail."),
// PERFECT (Category.HARD, 1, GameImage.MOD_PERFECT, "PF", 64, Input.KEY_S, 1f,
// "Perfect", "SS or quit."),
DOUBLE_TIME (Category.HARD, 2, GameImage.MOD_DOUBLE_TIME, "DT", 64, Input.KEY_D, 1.12f,
PERFECT (Category.HARD, 2, GameImage.MOD_PERFECT, "PF", 64, Input.KEY_P, 1f, "Perfect", "SS or quit."),
DOUBLE_TIME (Category.HARD, 3, GameImage.MOD_DOUBLE_TIME, "DT", 64, Input.KEY_D, 1.12f,
"DoubleTime", "Zoooooooooom."),
// NIGHTCORE (Category.HARD, 2, GameImage.MOD_NIGHTCORE, "NT", 64, Input.KEY_D, 1.12f,
// "Nightcore", "uguuuuuuuu"),
HIDDEN (Category.HARD, 3, GameImage.MOD_HIDDEN, "HD", 8, Input.KEY_F, 1.06f,
NIGHTCORE (Category.HARD, 4, GameImage.MOD_NIGHTCORE, "NT", 64, Input.KEY_N, 1.12f, "Nightcore", "uguuuuuuuu"),
HIDDEN (Category.HARD, 5, GameImage.MOD_HIDDEN, "HD", 8, Input.KEY_F, 1.06f,
"Hidden", "Play with no approach circles and fading notes for a slight score advantage."),
FLASHLIGHT (Category.HARD, 4, GameImage.MOD_FLASHLIGHT, "FL", 1024, Input.KEY_G, 1.12f,
FLASHLIGHT (Category.HARD, 6, GameImage.MOD_FLASHLIGHT, "FL", 1024, Input.KEY_G, 1.12f,
"Flashlight", "Restricted view area."),
RELAX (Category.SPECIAL, 0, GameImage.MOD_RELAX, "RL", 128, Input.KEY_Z, 0f,
"Relax", "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things.\n**UNRANKED**"),
AUTOPILOT (Category.SPECIAL, 1, GameImage.MOD_AUTOPILOT, "AP", 8192, Input.KEY_X, 0f,
"Relax2", "Automatic cursor movement - just follow the rhythm.\n**UNRANKED**"),
SPUN_OUT (Category.SPECIAL, 2, GameImage.MOD_SPUN_OUT, "SO", 4096, Input.KEY_C, 0.9f,
Target (Category.SPECIAL, 2, GameImage.MOD_TARGET, "AP", 8388608, Input.KEY_T, 1f,
"Target", "Timing practice!"),
SPUN_OUT (Category.SPECIAL, 3, GameImage.MOD_SPUN_OUT, "SO", 4096, Input.KEY_C, 0.9f,
"SpunOut", "Spinners will be automatically completed."),
AUTO (Category.SPECIAL, 3, GameImage.MOD_AUTO, "", 2048, Input.KEY_V, 1f,
"Autoplay", "Watch a perfect automated play through the song.");
AUTO (Category.SPECIAL, 4, GameImage.MOD_AUTO, "", 2048, Input.KEY_V, 1f,
"Autoplay", "Watch a perfect automated play through the song."),
CINEMA (Category.SPECIAL, 5, GameImage.MOD_CINEMA, "", 4194304, Input.KEY_M, 1f, "Autoplay", "Watch the video without being distubed by objects.");


/** Mod categories. */
public enum Category {
Expand Down Expand Up @@ -192,7 +195,7 @@ public static void init(int width, int height) {

// create buttons
float baseX = Category.EASY.getX() + Fonts.LARGE.getWidth(Category.EASY.getName()) * 1.25f;
float offsetX = GameImage.MOD_EASY.getImage().getWidth() * 2.1f;
float offsetX = GameImage.MOD_EASY.getImage().getWidth() * 1.1f;
for (GameMod mod : GameMod.values()) {
Image img = mod.image.getImage();
mod.button = new MenuButton(img,
Expand Down Expand Up @@ -371,16 +374,20 @@ public void toggle(boolean checkInverse) {
if (this == AUTO) {
SPUN_OUT.active = false;
SUDDEN_DEATH.active = false;
PERFECT.active = false;
RELAX.active = false;
AUTOPILOT.active = false;
} else if (this == SPUN_OUT || this == SUDDEN_DEATH || this == RELAX || this == AUTOPILOT)
CINEMA.active = false;
} else if (this == SPUN_OUT || this == SUDDEN_DEATH || this == PERFECT || this == RELAX || this == AUTOPILOT || this == CINEMA)
this.active = false;
}
if (active && (this == SUDDEN_DEATH || this == NO_FAIL || this == RELAX || this == AUTOPILOT)) {
if (active && (this == SUDDEN_DEATH || this == PERFECT || this == NO_FAIL || this == RELAX || this == AUTOPILOT)) {
SUDDEN_DEATH.active = false;
PERFECT.active = false;
NO_FAIL.active = false;
RELAX.active = false;
AUTOPILOT.active = false;
CINEMA.active = false;
active = true;
}
if (AUTOPILOT.isActive() && SPUN_OUT.isActive()) {
Expand All @@ -395,12 +402,20 @@ public void toggle(boolean checkInverse) {
else
EASY.active = false;
}
if (HALF_TIME.isActive() && DOUBLE_TIME.isActive()) {
if (this == HALF_TIME)
if (HALF_TIME.isActive() && (DOUBLE_TIME.isActive() || NIGHTCORE.isActive())) {
if (this == HALF_TIME){
DOUBLE_TIME.active = false;
NIGHTCORE.active = false;
}
else
HALF_TIME.active = false;
}
if (DOUBLE_TIME.isActive() && NIGHTCORE.isActive()){
if (this == DOUBLE_TIME)
NIGHTCORE.active = false;
else
DOUBLE_TIME.active = false;
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/itdelatrisu/opsu/OpsuConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ public class OpsuConstants {
public static final String PROJECT_NAME = "opsu!";

/** Project author. */
public static final String PROJECT_AUTHOR = "@itdelatrisu";
public static final String PROJECT_AUTHOR = "@itdelatrisu + @CloneWith";

/** Website address. */
public static final URI WEBSITE_URI = URI.create("https://itdelatrisu.github.io/opsu/");
public static final URI WEBSITE_URI = URI.create("https://clonewith.github.io/opsu/");

/** Repository address. */
public static final URI REPOSITORY_URI = URI.create("https://github.com/itdelatrisu/opsu");
public static final URI REPOSITORY_URI = URI.create("https://github.com/clonewith/opsu");

/** Credits address. */
public static final URI CREDITS_URI = URI.create("https://github.com/itdelatrisu/opsu/blob/master/CREDITS.md");
public static final URI CREDITS_URI = URI.create("https://github.com/clonewith/opsu/blob/master/CREDITS.md");

/** Issue reporting address. */
public static final String ISSUES_URL = "https://github.com/itdelatrisu/opsu/issues/new?title=%s&body=%s";
public static final String ISSUES_URL = "https://github.com/clonewith/opsu/issues/new?title=%s&body=%s";

/** Address containing the latest version file. */
public static final String VERSION_REMOTE = "https://raw.githubusercontent.com/itdelatrisu/opsu/gh-pages/version";

/** Changelog address. */
private static final String CHANGELOG_URL = "https://github.com/itdelatrisu/opsu/releases/tag/%s";
private static final String CHANGELOG_URL = "https://github.com/clonewith/opsu/releases/tag/%s";

/** Returns the changelog URI for the given version. */
public static URI getChangelogURI(String version) {
Expand Down
11 changes: 11 additions & 0 deletions src/itdelatrisu/opsu/audio/MusicController.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,17 @@ public static void resume() {
}
}

/**
* Always play the current track from the start.
*/
public static void replay() {
if (trackExists()) {
pauseTime = 0f;
player.resume();
player.setVolume(1.0f);
}
}

/**
* Stops the current track.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/itdelatrisu/opsu/downloads/servers/DownloadServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
* Abstract class for beatmap download servers.
*/
public abstract class DownloadServer {
/**
* <TODO> For mirror download servers, there may be a better solution.
* For example, use visible .conf (maybe) files instead coding servers insider, just for convenience and need for maintenance.
*/
/** Track preview URL. */
private static final String PREVIEW_URL = "http://b.ppy.sh/preview/%d.mp3";

Expand Down
22 changes: 20 additions & 2 deletions src/itdelatrisu/opsu/options/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,26 @@ public void toggle(GameContainer container) {
},
SKIN ("Skin", "Skin", "") {
private String[] itemList = null;
private String[] DirList = null;

@Override
public boolean isRestartRequired() { return true; }
// <TODO> Can we directly load skins without restart here?

/** Creates the list of available skins. */
private void createSkinList() {
File[] dirs = SkinLoader.getSkinDirectories(getSkinRootDir());
// <TODO> Here we use skin directory names as display names, need to change it.
itemList = new String[dirs.length + 1];
DirList = new String[dirs.length + 1];
itemList[0] = Skin.DEFAULT_SKIN_NAME;
for (int i = 0; i < dirs.length; i++)
itemList[i + 1] = dirs[i].getName();
DirList[0] = null;
for (int i = 0; i < dirs.length; i++){
Skin r = SkinLoader.loadSkin(dirs[i]);
// itemList[i + 1] = r.getName() + "(" + r.getAuthor() + ")";
itemList[i + 1] = r.getName();
DirList[i + 1] = dirs[i].getName();
}
}

@Override
Expand Down Expand Up @@ -968,6 +977,9 @@ public boolean hasFullscreenDisplayMode() {
/** The current skin. */
private static Skin skin;

/** The directory of the skin. */
// private static File skinDir = skin.getDirectory();

/** Frame limiters. */
private static final int[] targetFPS = { 60, 120, 240, -1 /* Unlimited */ };

Expand Down Expand Up @@ -1519,6 +1531,9 @@ public static void loadSkin() {
else {
// load the skin
skin = SkinLoader.loadSkin(skinDir);
// String info = skin.getName() + " (" + skin.getAuthor() + ")";
// ErrorHandler.error(String.format("You are using the skin '%s'.", info), null, false);
// Show the real name and author in skin.ini
ResourceLoader.addResourceLocation(new FileSystemLocation(skinDir));
}
ResourceLoader.addResourceLocation(new ClasspathLocation());
Expand All @@ -1544,6 +1559,9 @@ public static void loadSkin() {
public static File getSkinDir() {
File root = getSkinRootDir();
File dir = new File(root, skinName);
// File dir = skinDir;
// File dir = new File(root, skinDir);
// TODO: Need to adjust
return (dir.isDirectory()) ? dir : null;
}

Expand Down
Loading
Loading