Skip to content

Commit

Permalink
Merge pull request #82 from CloneWith/patch-rollback
Browse files Browse the repository at this point in the history
Bump to release v1.0.0
  • Loading branch information
CloneWith authored Apr 23, 2024
2 parents 58d765b + 282fb05 commit cf64ae6
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 44 deletions.
12 changes: 10 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Bug report
about: Create a report to help us improve
about: Report critical problems
title: ''
labels: ''
labels: 'bug'
assignees: ''

---
Expand All @@ -29,6 +29,14 @@ If applicable, add screenshots to help explain your problem.
- Device: [e.g. Laptop / Xiaomi / ...]
- OS: [e.g. Debian Testing / Windows 11 / MIUI 14 Development Build / ...]
- opsu! version
- Java Runtime Environment (JRE) version
- Display driver or OpenGL type and version

**Additional context**
Add any other context about the problem here.

**Help?**
Do you want to fix this problem by yourself? Put a `X` in either of the checkboxes below.

- [ ] Yes
- [ ] No
16 changes: 11 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
---
name: Feature request
about: Suggest an idea for this project
about: Suggest an idea for opsu!
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Description**
A clear and concise description of what the problem is or what feature do you want.

**Describe the solution you'd like**
**Solution**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
**Alternative**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Help?**
Do you want to implement this feature by yourself? Put a `X` in either of the checkboxes below.

- [ ] Yes
- [ ] No
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
8 changes: 2 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ name: Java CI with Maven

on:
push:
branches: [ "master" ]
branches: [ "main" ]
pull_request:
branches: [ "master" ]
branches: [ "main" ]

jobs:
build:
Expand All @@ -30,10 +30,6 @@ jobs:
- name: Build with Maven
run: mvn -B package --file pom.xml -Djar

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6

- name: Cache local Maven repository
uses: actions/cache@v4
with:
Expand Down
25 changes: 16 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing Guidelines

Thanks for your interest in opsu! This document provides basic guidelines for
contributing to the repository. If you plan on making major changes, consider
[opening an issue][issues] first to discuss your ideas.
Thanks for your interest in opsu!

This document provides basic guidelines for contributing to the repository. If you plan on making major changes, consider [opening an issue][issues] first to discuss your ideas.

[issues]: https://github.com/clonewith/opsu/issues/new

Expand All @@ -14,6 +14,10 @@ We are happy to see the problems you reported! You can do as belows:
2. Look through the issues list, and see if your issue was reported before by others.
3. Provide relevant details. The issue template can help you.

If you are unsure about this problem, you can post in our [discussion page][discussions] first.

[discussions]: https://github.com/clonewith/discussions

## Making a Change

1. [Fork the repository][fork] and set up your build environment, as described in the [README][buildenv].
Expand All @@ -27,26 +31,29 @@ We are happy to see the problems you reported! You can do as belows:

## Guidelines

- An issue or a pull request should only contain one feature or bug fix (at least, one exact part of the game). If you want to make multiple changes, create branches and open separate issues or pull requests.
- Don't change more than you need to. In particular, don't change the coding style or move existing blocks around.
- An issue or a pull request should only contain one feature or bug fix (at least, one exact part of the game). Though PRs with multiple features are also acceptable, those with one exact point are *easier* to review and check.
- Keep the original stucture of source code, like block orders and styles.
- In general, follow the same coding style as the file that you're editing. The `.editorconfig` can help set up your IDE.
- Write comments in your code as needed. At minimum, [Javadoc][Javadoc] comments are expected on all classes, methods, and global variables.
- Write comments in your code as needed. At minimum, [Javadoc][Javadoc] comments are expected on all classes, methods, and global variables as to make code easier to read and understand.

[Javadoc]: https://en.wikipedia.org/wiki/Javadoc#Technical_architecture

## Coding Style

- Use tabs for indenting, not spaces.
- Indentation and brace placement follow [Java conventions][indent]. Braces are usually not used for single-statement `if`, `while`, and `for`.
- There is no maximum line length; break long lines (or not) for readability.
- For now, avoid using features of Java 8 or higher (e.g. streams, lambdas).
- Avoid upgrading / downgrading dependencies manually.

[indent]: https://en.wikipedia.org/wiki/Indent_style#Variant:_Java

## Testing Tips

- **Gameplay changes:** Depending on the change, consider playing through a regular or [2B][2B] beatmap, watching a replay, pausing/resuming the game, enabling/disabling experimental sliders, etc.
- **UI changes:** Be sure to try different client resolutions (such as 800x600 and widescreen) and different skins (if applicable).
- **Graphics/audio changes:** Test on different operating systems if you can, especially if your change could break Linux audio in any way.
- **Graphics/audio changes:** Test on different operating systems if you can, I'm lack of usable devices at this time xD

## Consider joining us?

Maintaining this huge project by myself *alone* is a challenging task. So I'm appreciated if you are willing to help me in the long term! When you have made up your mind, please email me using the address on my profile. Thanks a lot!

[2B]: https://osu.ppy.sh/s/90935
3 changes: 1 addition & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

This software was created by Jeffrey Han ([@itdelatrisu](https://github.com/itdelatrisu)). [@CloneWith](https://github.com/clonewith) made further changes on it.

All game concepts and designs are based on work by [osu!](https://osu.ppy.sh)
developer Dean Herbert ([@ppy](https://github.com/ppy)).
All game concepts and designs are based on work by [osu!](https://osu.ppy.sh) developer Dean Herbert ([@ppy](https://github.com/ppy)).

## Images

Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Get a copy of opsu! from the [releases](https://github.com/clonewith/opsu/releas

### Java Setup

For desktop versions, the Java Runtime Environment (JRE) 7 or higher must be installed in order to run opsu!. The download page is located [here](https://www.java.com/en/download/).
The minimum requirement for JRE isn't determined yet. But I recommend OpenJDK 21.0.2, because I'm using it on my own computer.

### Beatmaps

Expand All @@ -32,21 +32,29 @@ opsu! will parse all beatmaps and update the database when launched, which can t

Game settings can be changed in the options menu, accessed by clicking the "Other Options" button in the song menu. The "Music Offset" value will likely need to be adjusted initially, or whenever hit objects are out of sync with the music.

Then are you going to change the custom song? Yes you can, by doing the following:

- Put your favorite theme song under the `Songs` directory.
- Edit the `.opsu.cfg` file:
- Key `ThemeSong`: `theme.mp3,[Title],[Artist],[Total Length in Miliseconds]`
- Key `ThemeSongTiming`: `[Time],[BeatLength],[Meter],[SampleSet],[SampleIndex],[Volume],0,0`. Refer to the [Timing wiki](https://osu.ppy.sh/wiki/Beatmapping/Timing) for further information.
- Run opsu! and enjoy!

### Directory Structure

The following files and folders will be created by opsu! as needed:

- `.opsu.cfg`: The configuration file. Most (but not all) of the settings can be changed through the options menu.
- `.opsu.db`: The beatmap cache database.
- `.opsu_scores.db`: The scores and player database.
- `.opsu.log`: The error log. All critical errors displayed in-game are also logged to this file, and other warnings not shown are logged as well.
- `.opsu.log`: The error log. All critical errors displayed in-game are also logged to this file, and other warnings not shown are logged as well.
- `Songs/`: The beatmap directory (not used if an osu! installation is detected). The parser searches all of its subdirectories for .osu files to load.
- `Skins/`: The skins directory. Each skin must be placed in a folder within this directory. Any game resource (in `res/`) can be skinned by placing a file with the same name in a skin folder. Skins can be selected in the options menu.
- `Replays/`: The replay directory. Replays of each completed game are saved as .osr files, and can be viewed at a later time or shared with others.
- `Import/`: The import directory. All beatmap packs (.osz) and skin packs (.osk) are unpacked to the proper location. All replays (.osr) are moved to the replay directory, and their scores saved to the scores database.
- `Screenshots/`: The screenshot directory. Screenshots can be taken by pressing the F12 key.
- `Natives/`: The native libraries directory.
- `Temp/`: The temporary files directory. Deleted when opsu! exits.
- `Natives/`: The native libraries directory. (If exists)
- `Temp/`: The temporary files directory. Deleted when opsu! exits. (If exists)

## Building

Expand All @@ -58,7 +66,7 @@ opsu! is distributed a [Maven](https://maven.apache.org/) project.

Maven builds are built to the `target` directory.

- To run the project, execute the Maven goal `compile`.
- To run the project, execute the Maven goal `compile`. After compiling it will automatically show up.
- To create a single executable jar, execute the Maven goal `package -Djar`. This will compile a jar to `target/opsu-${version}.jar` with the libraries, resources and natives packed inside the jar.
- Setting the "XDG" property (`-DXDG=true`) will make the application use XDG folders under Unix-like operating systems.
- Setting the "exclude" property to "ffmpeg" (`-Dexclude=ffmpeg`) will exclude FFmpeg shared libraries from the jar.
Expand Down
1 change: 1 addition & 0 deletions src/itdelatrisu/opsu/audio/SoundEffect.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public enum SoundEffect implements SoundController.SoundComponent {
COUNT3 ("count3s"),
FAIL ("failsound"),
GO ("gos"),
HEARTBEAT("heartbeat"),
MENUBACK ("menuback"),
MENUCLICK ("menuclick"),
MENUHIT ("menuhit"),
Expand Down
18 changes: 13 additions & 5 deletions src/itdelatrisu/opsu/options/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,8 @@ public void read(String s) {
themeString = s;
Beatmap beatmap = getThemeBeatmap();
if (beatmap == null) {
themeString = oldThemeString;
Log.warn(String.format("The theme song string [%s] is malformed.", s));
Log.warn(String.format("The theme song data is invaild.", s));
} else if (!beatmap.audioFilename.isFile() && !ResourceLoader.resourceExists(beatmap.audioFilename.getName())) {
themeString = oldThemeString;
Log.warn(String.format("Cannot find theme song [%s].", beatmap.audioFilename.getAbsolutePath()));
}
}
Expand All @@ -300,7 +298,7 @@ public void read(String s) {
new TimingPoint(s);
themeTimingPoint = s;
} catch (Exception e) {
Log.warn(String.format("The theme song timing point [%s] is malformed.", s));
Log.warn(String.format("The theme song timing point is invaild.", s));
}
}
},
Expand Down Expand Up @@ -1571,6 +1569,14 @@ public static File getSkinDir() {
*/
public static File getFFmpegLocation() { return FFmpegPath; }


public static File getThemeSong() {
File audio = new File(BEATMAP_DIR, "theme.mp3");
if (!audio.isFile())
return null;
return audio;
}

/**
* Returns a dummy Beatmap containing the theme song.
* @return the theme song beatmap, or {@code null} if the theme string is malformed
Expand All @@ -1581,7 +1587,9 @@ public static Beatmap getThemeBeatmap() {
return null;

Beatmap beatmap = new Beatmap(null);
beatmap.audioFilename = new File(tokens[0]);
File cusau = getThemeSong();
if (cusau != null) beatmap.audioFilename = cusau;
else beatmap.audioFilename = new File(tokens[0]);
beatmap.title = tokens[1];
beatmap.artist = tokens[2];
try {
Expand Down
8 changes: 0 additions & 8 deletions src/itdelatrisu/opsu/states/DownloadsMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,17 +571,9 @@ public void update(GameContainer container, StateBasedGame game, int delta)
else if (importThread.isFinished()) {
BeatmapSetNode importedNode = importThread.getImportedBeatmap();
if (importedNode != null) {
// stop preview
previewID = -1;
SoundController.stopTrack();

// initialize song list
BeatmapSetList.get().reset();
BeatmapSetList.get().init();

// focus new beatmap
// NOTE: This can't be called in another thread because it makes OpenGL calls.
((SongMenu) game.getState(Opsu.STATE_SONGMENU)).setFocus(importedNode, -1, true, true);
}
importThread = null;
}
Expand Down
4 changes: 4 additions & 0 deletions src/itdelatrisu/opsu/states/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ public void render(GameContainer container, StateBasedGame game, Graphics g)
float ghostScale = logo.getLastScale() / scale * 1.05f;
Image ghostLogo = GameImage.MENU_LOGO.getImage().getScaledCopy(ghostScale);
ghostLogo.drawCentered(logo.getX(), logo.getY(), Colors.GHOST_LOGO);
// TODO: Heartbeat won't play correctly
if (position == 0.0f && logo.contains(mouseX, mouseY, 0.25f)) {
SoundController.playSound(SoundEffect.HEARTBEAT);
}

// draw music info bar
if (MusicController.trackExists()) {
Expand Down

0 comments on commit cf64ae6

Please sign in to comment.