Skip to content

Commit 24b3891

Browse files
authored
Merge branch 'main' into soms
2 parents 590149f + b4ac42d commit 24b3891

118 files changed

Lines changed: 4328 additions & 1307 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gemini/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
code_review:
2+
pull_request_opened:
3+
code_review: false

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,10 @@ language-subtag-registry
6464
# test
6565
/hmcl.json
6666
/.hmcl.json
67-
/.hmcl/
67+
/.hmcl/
68+
69+
# AI
70+
/.gemini/
71+
!/.gemini/config.yaml
72+
.codex
73+
/.gradle-*/

.idea/copyright/HMCL.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Java Code Style Requirements
2+
3+
These rules apply to all Java code written or modified in this repository.
4+
5+
## Nullability
6+
7+
- Annotate every class with JetBrains Annotations `@NotNullByDefault`.
8+
- Any type, field, parameter, return value, local variable, or generic type argument that may be `null` must be explicitly annotated with `@Nullable`.
9+
- Nullability must never be implicit.
10+
11+
## Immutability
12+
13+
- Immutable arrays and collections must be explicitly annotated with JetBrains Annotations `@Unmodifiable` or `@UnmodifiableView` as appropriate.
14+
- For arrays, use type-use syntax such as `String @Unmodifiable []`.
15+
16+
## Documentation
17+
18+
- Every class, field, and method must have documentation.
19+
- Documentation must use `///` Markdown-style Javadoc comments.
20+
- Keep documentation accurate and specific to the actual behavior, constraints, and side effects.
21+
- Add concise implementation comments inside complex logic whenever they materially improve readability or explain non-obvious behavior.
22+
23+
## Gradle
24+
25+
- When invoking Gradle in this repository, always set `GRADLE_USER_HOME` to the workspace-local `.gradle-user-home` directory.
26+
- Prefer commands such as `./gradlew -g .gradle-user-home ...` or the equivalent environment-variable-based configuration.
27+
- When running Gradle `test` tasks, use a higher timeout of ten minutes.

HMCL/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ dependencies {
5656
implementation(project(":HMCLCore"))
5757
implementation(project(":HMCLBoot"))
5858
implementation("libs:JFoenix")
59-
implementation(libs.twelvemonkeys.imageio.webp)
59+
implementation(libs.jwebp)
60+
implementation(libs.fxsvgimage)
6061
implementation(libs.java.info)
6162
implementation(libs.monet.fx)
6263
implementation(libs.nayuki.qrcodegen)
@@ -66,6 +67,7 @@ dependencies {
6667
}
6768

6869
embedResources(libs.authlib.injector)
70+
embedResources(libs.lwjgl.unsafe.agent)
6971
}
7072

7173
fun digest(algorithm: String, bytes: ByteArray): ByteArray = MessageDigest.getInstance(algorithm).digest(bytes)
@@ -155,6 +157,7 @@ val hmclProperties = buildList {
155157
add("hmcl.microsoft.auth.id" to microsoftAuthId)
156158
add("hmcl.curseforge.apikey" to curseForgeApiKey)
157159
add("hmcl.authlib-injector.version" to libs.authlib.injector.get().version!!)
160+
add("hmcl.lwjgl-unsafe-agent.version" to libs.lwjgl.unsafe.agent.get().version!!)
158161
}
159162

160163
val hmclPropertiesFile = layout.buildDirectory.file("hmcl.properties")
@@ -192,7 +195,7 @@ tasks.shadowJar {
192195
exclude("META-INF/services/javax.imageio.spi.ImageInputStreamSpi")
193196

194197
listOf(
195-
"aix-*", "sunos-*", "openbsd-*", "dragonflybsd-*", "freebsd-*", "linux-*", "darwin-*",
198+
"aix-*", "sunos-*", "openbsd-*", "dragonflybsd-*", "freebsd-*", "linux-*",
196199
"*-ppc", "*-ppc64le", "*-s390x", "*-armel",
197200
).forEach { exclude("com/sun/jna/$it/**") }
198201

HMCL/src/main/java/com/jfoenix/controls/JFXDialog.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,13 @@
2323
import com.jfoenix.converters.DialogTransitionConverter;
2424
import com.jfoenix.effects.JFXDepthManager;
2525
import com.jfoenix.transitions.CachedTransition;
26-
import javafx.animation.Interpolator;
27-
import javafx.animation.KeyFrame;
28-
import javafx.animation.KeyValue;
29-
import javafx.animation.Timeline;
30-
import javafx.animation.Transition;
26+
import javafx.animation.*;
3127
import javafx.beans.DefaultProperty;
3228
import javafx.beans.property.BooleanProperty;
3329
import javafx.beans.property.ObjectProperty;
3430
import javafx.beans.property.ObjectPropertyBase;
3531
import javafx.beans.property.SimpleBooleanProperty;
36-
import javafx.css.CssMetaData;
37-
import javafx.css.SimpleStyleableObjectProperty;
38-
import javafx.css.Styleable;
39-
import javafx.css.StyleableObjectProperty;
40-
import javafx.css.StyleableProperty;
32+
import javafx.css.*;
4133
import javafx.event.Event;
4234
import javafx.event.EventHandler;
4335
import javafx.geometry.Pos;
@@ -379,6 +371,14 @@ private final class CenterTransition extends CachedTransition {
379371
setCycleDuration(Duration.seconds(0.4));
380372
setDelay(Duration.ZERO);
381373
}
374+
375+
@Override
376+
protected void starting() {
377+
}
378+
379+
@Override
380+
protected void stopping() {
381+
}
382382
}
383383

384384
/***************************************************************************

HMCL/src/main/java/com/jfoenix/controls/JFXRippler.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,11 @@ protected Node getMask() {
231231
*
232232
* @return the ripple radius size
233233
*/
234-
protected double computeRippleRadius() {
235-
double width2 = control.getLayoutBounds().getWidth() * control.getLayoutBounds().getWidth();
236-
double height2 = control.getLayoutBounds().getHeight() * control.getLayoutBounds().getHeight();
237-
return Math.min(Math.sqrt(width2 + height2), RIPPLE_MAX_RADIUS) * 1.1 + 5;
234+
protected double computeRippleRadius(double centerX, double centerY) {
235+
double dx = Math.max(centerX, control.getLayoutBounds().getWidth() - centerX);
236+
double dy = Math.max(centerY, control.getLayoutBounds().getHeight() - centerY);
237+
238+
return (Math.sqrt(dx * dx + dy * dy) / 0.9) + 2;
238239
}
239240

240241
protected void setOverLayBounds(Rectangle overlay) {
@@ -473,7 +474,7 @@ private Ripple(double centerX, double centerY) {
473474
super(centerX,
474475
centerY,
475476
getRipplerRadius() == Region.USE_COMPUTED_SIZE ?
476-
computeRippleRadius() : getRipplerRadius(), null);
477+
computeRippleRadius(centerX, centerY) : getRipplerRadius(), null);
477478
setCache(true);
478479
setCacheHint(CacheHint.SPEED);
479480
setCacheShape(true);
@@ -518,7 +519,7 @@ private Ripple(double centerX, double centerY) {
518519
new KeyValue(opacityProperty(),
519520
1,
520521
RIPPLE_INTERPOLATOR)
521-
), new KeyFrame(Duration.millis(900), inKeyValues));
522+
), new KeyFrame(Duration.millis(600), inKeyValues));
522523

523524
setScaleX(0);
524525
setScaleY(0);

0 commit comments

Comments
 (0)