Skip to content

Commit 2f602c0

Browse files
authored
Merge pull request #1351 from ZalithLauncher/main
merge main
2 parents d5a3245 + d3daf2d commit 2f602c0

300 files changed

Lines changed: 10997 additions & 2461 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.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,22 @@ body:
3232
description: |
3333
The crash page of the launcher will have a "Share Logs" button. Please upload the log provided by the launcher here.
3434
If your issue is related to a "Launcher Crash", you can find the "Share Launcher Logs" option in the launcher settings. Please upload the log archive provided by the launcher here.
35-
If your issue is related to a "Game Crash", you can use a file manager to navigate to ZL2's public directory and locate the "latest_game.log" file.
35+
If your issue is related to a "Game Crash":
36+
< 2.4.3
37+
You can use a file manager to navigate to ZL2's public directory and locate the "latest_game.log" file.
38+
\>= 2.4.3
39+
You can find the "Running Log" button in the version overview page, click it to open the log menu, and then share it.
3640
**Please do not upload the game's own logs here, as the information they record is not comprehensive!**
41+
42+
---
43+
3744
启动器的崩溃页面会有“分享日志”按钮,请将启动器给出的日志上传在这里;
3845
如果您的问题属于“启动器崩溃”,您可以在启动器设置内找到“分享启动器日志”选项,请将启动器给出的日志压缩包上传在这里;
39-
如果您的问题属于“游戏运行崩溃”,您可以在文件管理器软件内进入 ZL2 的公有目录,找到 “latest_game.log” 文件。
46+
如果您的问题属于“游戏运行崩溃”:
47+
< 2.4.3
48+
您可以在文件管理器软件内进入 ZL2 的公有目录,找到 “latest_game.log” 文件。
49+
\>= 2.4.3
50+
您可以在版本概览中,找到“运行日志”按钮,点击打开日志菜单,即可分享。
4051
**请不要在此处上传游戏自己的日志,它记录的信息并不全面!**
4152
validations:
4253
required: true

.github/workflows/build.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ jobs:
3434

3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@v6
3838
with:
3939
submodules: recursive
4040

4141
- name: Set up JDK 17
42-
uses: actions/setup-java@v4
42+
uses: actions/setup-java@v5
4343
with:
4444
distribution: "temurin"
4545
java-version: "17"
4646

4747
- name: Setup Gradle
48-
uses: gradle/actions/setup-gradle@v4
48+
uses: gradle/actions/setup-gradle@v5
4949
with:
5050
add-job-summary: "on-failure"
5151

@@ -57,15 +57,23 @@ jobs:
5757
- name: Upload Release APK for ${{ matrix.arch }}
5858
if: inputs.variant == 'Release'
5959
continue-on-error: true
60-
uses: actions/upload-artifact@v4
60+
uses: actions/upload-artifact@v7
6161
with:
6262
name: release apk (${{ matrix.arch }})
6363
path: ZalithLauncher/build/outputs/apk/release/*.apk
6464

65+
- name: Upload Release Mapping for ${{ matrix.arch }}
66+
if: inputs.variant == 'Release'
67+
continue-on-error: true
68+
uses: actions/upload-artifact@v7
69+
with:
70+
name: mapping (${{ matrix.arch }})
71+
path: ZalithLauncher/build/outputs/mapping/release/mapping.txt
72+
6573
- name: Upload Debug APK for ${{ matrix.arch }}
6674
if: inputs.variant == 'Debug'
6775
continue-on-error: true
68-
uses: actions/upload-artifact@v4
76+
uses: actions/upload-artifact@v7
6977
with:
7078
name: debug apk (${{ matrix.arch }})
7179
path: ZalithLauncher/build/outputs/apk/debug/*.apk

.github/workflows/release_ci.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ jobs:
2626

2727
steps:
2828
- name: Download Files
29-
uses: actions/download-artifact@v4
29+
uses: actions/download-artifact@v8
3030
with:
3131
path: ./artifacts
3232

3333
- name: Organize Artifacts
3434
run: |
3535
mkdir -p ./apks
36+
mkdir -p ./mappings
3637
3738
find ./artifacts -name "*.apk" -type f -exec cp {} ./apks/ \;
3839
@@ -42,11 +43,23 @@ jobs:
4243
exit 1
4344
fi
4445
46+
# 处理映射文件 区分架构
47+
for mapping_dir in ./artifacts/mapping\ \(*\)/; do
48+
if [ -d "$mapping_dir" ] && [ -f "${mapping_dir}mapping.txt" ]; then
49+
dirname=$(basename "$mapping_dir")
50+
cp "${mapping_dir}mapping.txt" "./mappings/${dirname}.txt"
51+
echo "Copied: ${dirname}.txt"
52+
fi
53+
done
54+
4555
echo "Found $(ls ./apks/ | wc -l) APK file(s)"
56+
echo "Found $(ls ./mappings/ | wc -l) Mapping file(s)"
4657
4758
- name: Upload To Release
48-
uses: softprops/action-gh-release@v2
59+
uses: softprops/action-gh-release@v3
4960
with:
5061
tag_name: ${{ github.event.release.tag_name }}
51-
files: ./apks/*.apk
52-
fail_on_unmatched_files: true
62+
files: |
63+
./apks/*.apk
64+
./mappings/*.txt
65+
fail_on_unmatched_files: true

ColorPicker/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22

33
plugins {
44
alias(libs.plugins.android.library)
5-
alias(libs.plugins.kotlin.android)
65
alias(libs.plugins.kotlin.compose)
76
}
87

98
android {
109
namespace = "com.movtery.colorpicker"
11-
compileSdk = 36
10+
compileSdk = 37
1211

1312
defaultConfig {
1413
minSdk = 26

LWJGL/build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ plugins {
44

55
group = "org.lwjgl.glfw"
66

7-
configurations.getByName("default").isCanBeResolved = true
7+
val fatJarDeps by configurations.creating {
8+
isCanBeResolved = true
9+
extendsFrom(configurations.runtimeClasspath.get())
10+
}
811

912
tasks.jar {
1013
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@@ -16,7 +19,7 @@ tasks.jar {
1619
versionFile.writeText(System.currentTimeMillis().toString())
1720
}
1821
from({
19-
configurations.getByName("default").map {
22+
fatJarDeps.map {
2023
println(it.name)
2124
if (it.isDirectory) it else zipTree(it)
2225
}

LWJGL/libs/lwjgl-lwjglx.jar

53 Bytes
Binary file not shown.

LWJGL/src/main/java/org/lwjgl/glfw/GLFW.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,16 @@ public static void glfwSetCursor(@NativeType("GLFWwindow *") long window, @Nativ
12781278
CallbackBridge.nativeSetCursorShape(CursorRegistry.getShape(cursor));
12791279
}
12801280

1281+
/** {@code void glfwGetPreeditCursorRectangle(GLFWwindow * window, int * x, int * y, int * w, int * h)} */
1282+
public static void glfwGetPreeditCursorRectangle(@NativeType("GLFWwindow *") long window, @NativeType("int *") @Nullable IntBuffer x, @NativeType("int *") @Nullable IntBuffer y, @NativeType("int *") @Nullable IntBuffer w, @NativeType("int *") @Nullable IntBuffer h) {
1283+
1284+
}
1285+
1286+
/** {@code void glfwSetPreeditCursorRectangle(GLFWwindow * window, int x, int y, int w, int h)} */
1287+
public static void glfwSetPreeditCursorRectangle(@NativeType("GLFWwindow *") long window, int x, int y, int w, int h) {
1288+
1289+
}
1290+
12811291
public static boolean glfwRawMouseMotionSupported() {
12821292
// Should be not supported?
12831293
return false;
@@ -1421,6 +1431,12 @@ public static void glfwGetMonitorContentScale(@NativeType("GLFWmonitor *") long
14211431
yscale.put(0, 1);
14221432
}
14231433

1434+
/** {@code char const * glfwGetMonitorName(GLFWmonitor * monitor)} */
1435+
@NativeType("char const *")
1436+
public static String glfwGetMonitorName(@NativeType("GLFWwindow *") long window) {
1437+
return "Monitor";
1438+
}
1439+
14241440
/** Array version of: {@link #glfwGetWindowPos GetWindowPos} */
14251441
public static void glfwGetWindowPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos) {
14261442
if (CHECKS) {

LayerController/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22

33
plugins {
44
alias(libs.plugins.android.library)
5-
alias(libs.plugins.kotlin.android)
65
alias(libs.plugins.kotlin.compose)
76
id("kotlinx-serialization")
87
}
98

109
android {
1110
namespace = "com.movtery.layer_controller"
12-
compileSdk = 36
11+
compileSdk = 37
1312

1413
defaultConfig {
1514
minSdk = 26

LayerController/src/main/java/com/movtery/layer_controller/Layout.kt

Lines changed: 64 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ private fun BoxWithConstraintsScope.BaseControlBoxLayout(
170170
val pointerId = change.id
171171
val isPressed = change.pressed
172172

173+
//抬起时,总是尝试释放该指针下活跃的按钮
174+
//避免子级占用了指针后,导致按钮状态无法被释放
175+
if (!isPressed) {
176+
allActiveWidgets.remove(pointerId)?.forEach { widget ->
177+
widget.onReleaseEvent(eventHandler, reversedLayers)
178+
}
179+
return@forEach
180+
}
181+
173182
if (
174183
change.isConsumed ||
175184
//不处理被子级占用的指针
@@ -227,68 +236,69 @@ private fun BoxWithConstraintsScope.BaseControlBoxLayout(
227236
}
228237
}
229238

230-
val activeWidgets = allActiveWidgets[pointerId] ?: emptyList()
231-
232-
if (isPressed) {
233-
//检查是否移出边界
234-
if (activeWidgets.isNotEmpty()) {
235-
val backInBounds = mutableListOf<ObservableWidget>()
236-
for (widget in activeWidgets) {
237-
//检查组件是否可以响应移除边界即松开
238-
if (!widget.isReleaseOnOutOfBounds()) continue
239-
240-
val size = widget.internalRenderSize
241-
val offset = getWidgetPosition(widget, size, screenSize)
242-
val isOutOfBounds = position.x !in offset.x..(offset.x + size.width) ||
243-
position.y !in offset.y..(offset.y + size.height)
244-
245-
if (isOutOfBounds) {
246-
widget.onReleaseEvent(eventHandler, reversedLayers)
247-
} else {
248-
backInBounds.add(widget)
249-
}
239+
var activeWidgets = allActiveWidgets[pointerId] ?: emptyList()
240+
241+
//检查是否移出边界
242+
if (activeWidgets.isNotEmpty()) {
243+
val backInBounds = mutableListOf<ObservableWidget>()
244+
val releasedWidgets = mutableListOf<ObservableWidget>()
245+
for (widget in activeWidgets) {
246+
//检查组件是否可以响应移除边界即松开
247+
if (!widget.isReleaseOnOutOfBounds()) continue
248+
249+
val size = widget.internalRenderSize
250+
val offset = getWidgetPosition(widget, size, screenSize)
251+
val isOutOfBounds = position.x !in offset.x..(offset.x + size.width) ||
252+
position.y !in offset.y..(offset.y + size.height)
253+
254+
if (isOutOfBounds) {
255+
widget.onReleaseEvent(eventHandler, reversedLayers)
256+
releasedWidgets.add(widget)
257+
} else {
258+
backInBounds.add(widget)
250259
}
251-
//fix: 应该在抬起事件全部处理完成后再处理 #941
252-
if (backInBounds.isNotEmpty()) {
253-
for (widget in backInBounds) {
254-
widget.onPointerBackInBounds(eventHandler, reversedLayers)
255-
}
260+
}
261+
//fix: 移出边界时应移出组,否则滑动回已释放的按钮无法再次触发
262+
if (releasedWidgets.isNotEmpty()) {
263+
activeWidgets = activeWidgets - releasedWidgets
264+
allActiveWidgets[pointerId] = activeWidgets
265+
}
266+
//fix: 应该在抬起事件全部处理完成后再处理 #941
267+
if (backInBounds.isNotEmpty()) {
268+
for (widget in backInBounds) {
269+
widget.onPointerBackInBounds(eventHandler, reversedLayers)
256270
}
257271
}
272+
}
258273

259-
when {
260-
targetWidgets.isEmpty() -> {}
261-
else -> {
262-
for (targetWidget in targetWidgets) {
263-
if (targetWidget.canProcess()) {
264-
return@forEach //拒绝处理该事件
265-
}
274+
when {
275+
targetWidgets.isEmpty() -> {}
276+
else -> {
277+
for (targetWidget in targetWidgets) {
278+
if (targetWidget.canProcess()) {
279+
return@forEach //拒绝处理该事件
280+
}
266281

267-
targetWidget.onTouchEvent(
268-
eventHandler = eventHandler,
269-
allLayers = reversedLayers,
270-
change = change,
271-
activeWidgets = activeWidgets,
272-
addThis = {
273-
allActiveWidgets[pointerId] = activeWidgets + listOf(targetWidget)
274-
},
275-
consumeEvent = { value ->
276-
if (value) {
277-
change.consume()
278-
} else {
279-
//将指针标记为仅接受滑动处理
280-
//期望子级不对点击事件等进行处理
281-
markPointerAsMoveOnly(pointerId)
282-
}
282+
targetWidget.onTouchEvent(
283+
eventHandler = eventHandler,
284+
allLayers = reversedLayers,
285+
change = change,
286+
activeWidgets = activeWidgets,
287+
addThis = {
288+
allActiveWidgets[pointerId] = activeWidgets + listOf(targetWidget)
289+
},
290+
consumeEvent = { value ->
291+
if (value) {
292+
change.consume()
293+
} else {
294+
//将指针标记为仅接受滑动处理
295+
//期望子级不对点击事件等进行处理
296+
markPointerAsMoveOnly(pointerId)
283297
}
284-
)
285-
}
298+
}
299+
)
286300
}
287301
}
288-
} else {
289-
allActiveWidgets.remove(pointerId)?.forEach { widget ->
290-
widget.onReleaseEvent(eventHandler, reversedLayers)
291-
}
292302
}
293303
}
294304
}

0 commit comments

Comments
 (0)