Skip to content

Commit cc3de7f

Browse files
committed
sync 2024/7/27
1 parent 57ac8b0 commit cc3de7f

37 files changed

+1304
-672
lines changed

patches/client/0001-BUILD-build.gradle.kts-and-clear.patch

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ way-zer <[email protected]> on 2024/6/9
1414
build.gradle | 241 ++-------------
1515
core/build.gradle | 2 -
1616
core/build.gradle.kts | 64 ++++
17-
desktop/build.gradle | 162 +---------
17+
desktop/build.gradle | 164 +---------
1818
gradle.properties | 2 +
1919
gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 43462 bytes
2020
gradlew | 282 +++++++++++-------
@@ -24,7 +24,7 @@ way-zer <[email protected]> on 2024/6/9
2424
settings.gradle | 10 +-
2525
tools/build.gradle | 44 ++-
2626
tools/src/mindustry/tools/Generators.java | 2 +-
27-
18 files changed, 383 insertions(+), 610 deletions(-)
27+
18 files changed, 384 insertions(+), 611 deletions(-)
2828
create mode 100644 annotations/src/main/java/com/github/bsideup/jabel/Desugar.java
2929
create mode 100644 annotations/src/main/resources/META-INF/services/javax.annotation.processing.Processor
3030
delete mode 100644 core/build.gradle
@@ -658,10 +658,10 @@ index 0000000000000000000000000000000000000000..f1a2bfd729db5c05cb4bc9b0e5af6dd0
658658
+}
659659
\ No newline at end of file
660660
diff --git a/desktop/build.gradle b/desktop/build.gradle
661-
index 7f4ecdcf0a6407ffce7181234527dc6cbc4d484b..ecb36e1a2a501040d3adee3203eacef2743e7764 100644
661+
index 7f4ecdcf0a6407ffce7181234527dc6cbc4d484b..b63f4a3ca7964f41f02a3fa12a068f859b51f96c 100644
662662
--- a/desktop/build.gradle
663663
+++ b/desktop/build.gradle
664-
@@ -3,11 +3,6 @@ sourceSets.main.java.srcDirs = ["src/"]
664+
@@ -3,12 +3,7 @@ sourceSets.main.java.srcDirs = ["src/"]
665665
project.ext.mainClassName = "mindustry.desktop.DesktopLauncher"
666666
project.ext.assetsDir = new File("../core/assets")
667667

@@ -670,9 +670,11 @@ index 7f4ecdcf0a6407ffce7181234527dc6cbc4d484b..ecb36e1a2a501040d3adee3203eacef2
670670
-def ICON_DIR = new File("$rootDir/core/assets/icons/icon.icns")
671671
-def platforms = ["Linux64", "Windows64", "Windows32", "MacOS"]
672672
-
673-
task run(dependsOn: classes, type: JavaExec){
673+
-task run(dependsOn: classes, type: JavaExec){
674+
+task run(dependsOn: [classes, ":core:allAssets"], type: JavaExec){
674675
mainClass = project.mainClassName
675676
classpath = sourceSets.main.runtimeClasspath
677+
standardInput = System.in
676678
@@ -44,7 +39,7 @@ task dist(type: Jar, dependsOn: configurations.runtimeClasspath){
677679
from files(sourceSets.main.output.classesDirs)
678680
from files(sourceSets.main.output.resourcesDir)

patches/client/0003-CS-Version.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ index bc4c6a494aec88af73f001906598ba91a50ac6a3..d08d04a6f0e8107cec995876b2072c46
100100
public static final Seq<ServerGroup> defaultServers = Seq.with();
101101
/** maximum size of any block, do not change unless you know what you're doing */
102102
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
103-
index 8d3ac0bd19be8caca3aa95ab48adda63c3c317a1..5cbdf0a613c067f662a3c7dd4511bb33e35657ae 100644
103+
index d0e444a4a7a9ced372a2c93102860991ac922112..72db086039f01b7358023c494a3355db24433117 100644
104104
--- a/core/src/mindustry/core/NetClient.java
105105
+++ b/core/src/mindustry/core/NetClient.java
106106
@@ -135,6 +135,8 @@ public class NetClient implements ApplicationListener{

patches/client/0006-S-update-TypeIO.writeRequest.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Subject: [PATCH] S: update TypeIO.writeRequest
88
1 file changed, 3 insertions(+), 2 deletions(-)
99

1010
diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java
11-
index c02ceb4ae69d9f7e5bea93df94c546d7a06cd1e2..c8de9a61012e3362c3f4a06af1c0237f5de120ac 100644
11+
index 70d1543c366b4eeef80c67f4eaeb05643c93451e..fe9682663342ccd1f3537cf82ea4c74996655440 100644
1212
--- a/core/src/mindustry/io/TypeIO.java
1313
+++ b/core/src/mindustry/io/TypeIO.java
14-
@@ -413,8 +413,9 @@ public class TypeIO{
14+
@@ -414,8 +414,9 @@ public class TypeIO{
1515
if(!plan.breaking){
1616
write.s(plan.block.id);
1717
write.b((byte)plan.rotation);

patches/client/0020-C-RenderExt-overdriveZone.patch patches/client/0020-C-RenderExt-overdriveZone-mendZone.patch

+34-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Sat, 17 Feb 2024 14:15:29 +0800
4-
Subject: [PATCH] C(RenderExt) overdriveZone
4+
Subject: [PATCH] C(RenderExt) overdriveZone mendZone
55

66
---
77
core/src/mindustry/core/Renderer.java | 5 +++++
88
core/src/mindustry/graphics/Layer.java | 3 +++
9+
.../world/blocks/defense/MendProjector.java | 8 ++++++++
910
.../blocks/defense/OverdriveProjector.java | 19 +++++++++++++++++++
10-
core/src/mindustryX/features/RenderExt.java | 2 ++
11-
4 files changed, 29 insertions(+)
11+
core/src/mindustryX/features/RenderExt.java | 3 +++
12+
5 files changed, 38 insertions(+)
1213

1314
diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java
1415
index 01b2872b6ab744ad12f44049feb6146ce8ad84d5..e987766b74de1fbb8d3d9e0a8f1863b0821a49db 100644
@@ -40,6 +41,32 @@ index 7d8d9f343acb410ba680aab1c1f6a2be9dbbf3a4..48e80224bdcbaea0476d4be204eef767
4041
//weather effects, e.g. rain and snow
4142
weather = 130,
4243

44+
diff --git a/core/src/mindustry/world/blocks/defense/MendProjector.java b/core/src/mindustry/world/blocks/defense/MendProjector.java
45+
index 369d0eecea48320fb8559acdf6de9cf2c74447c9..edafc65164c72b570b779eaa6f65ab4029d946c9 100644
46+
--- a/core/src/mindustry/world/blocks/defense/MendProjector.java
47+
+++ b/core/src/mindustry/world/blocks/defense/MendProjector.java
48+
@@ -13,6 +13,7 @@ import mindustry.logic.*;
49+
import mindustry.world.*;
50+
import mindustry.world.consumers.*;
51+
import mindustry.world.meta.*;
52+
+import mindustryX.features.*;
53+
54+
import static mindustry.Vars.*;
55+
56+
@@ -126,6 +127,13 @@ public class MendProjector extends Block{
57+
public void draw(){
58+
super.draw();
59+
60+
+ float realRange = range + phaseHeat * phaseRangeBoost;
61+
+ if(status() == BlockStatus.active && RenderExt.mendZoneTransparency > 0.02f){
62+
+ var c = Tmp.c1.set(baseColor);
63+
+ if(phaseHeat > 0) c.lerp(phaseColor, 0.5f);
64+
+ Draw.color(c, RenderExt.mendZoneTransparency);
65+
+ Lines.dashCircle(x, y, realRange);
66+
+ }
67+
float f = 1f - (Time.time / 100f) % 1f;
68+
69+
Draw.color(baseColor, phaseColor, phaseHeat);
4370
diff --git a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java b/core/src/mindustry/world/blocks/defense/OverdriveProjector.java
4471
index 423462318a31075f047a39d07caee50e031c1390..89b28401796d1d560330328e4bea54f258f3fdeb 100644
4572
--- a/core/src/mindustry/world/blocks/defense/OverdriveProjector.java
@@ -78,22 +105,23 @@ index 423462318a31075f047a39d07caee50e031c1390..89b28401796d1d560330328e4bea54f2
78105

79106
Draw.color(baseColor, phaseColor, phaseHeat);
80107
diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java
81-
index 62100afee7c0df3fd36781244ccd02cb318316c3..936e714c690d884258097765a25369f7dc089e07 100644
108+
index 62100afee7c0df3fd36781244ccd02cb318316c3..32fa3691159506083aa110c90a182665aeb49844 100644
82109
--- a/core/src/mindustryX/features/RenderExt.java
83110
+++ b/core/src/mindustryX/features/RenderExt.java
84111
@@ -14,6 +14,7 @@ public class RenderExt{
85112
public static boolean arcChoiceUiIcon;
86113
public static boolean researchViewer;
87114
public static int hiddenItemTransparency;
88-
+ public static float overdriveZoneTransparency;
115+
+ public static float overdriveZoneTransparency, mendZoneTransparency;
89116

90117
public static void init(){
91118
Events.run(Trigger.preDraw, () -> {
92-
@@ -23,6 +24,7 @@ public class RenderExt{
119+
@@ -23,6 +24,8 @@ public class RenderExt{
93120
arcChoiceUiIcon = Core.settings.getBool("arcchoiceuiIcon");
94121
researchViewer = Core.settings.getBool("researchViewer");
95122
hiddenItemTransparency = Core.settings.getInt("HiddleItemTransparency");
96123
+ overdriveZoneTransparency = Core.settings.getInt("overdrive_zone") / 100f;
124+
+ mendZoneTransparency = Core.settings.getInt("mend_zone") / 100f;
97125
});
98126
Events.run(Trigger.draw, RenderExt::draw);
99127
}

patches/client/0023-C-StatExt.patch

+4-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ way-zer <[email protected]> on 2024/5/4 at 22:17
1818
core/src/mindustry/ui/ItemImage.java | 22 ++
1919
core/src/mindustry/world/Block.java | 4 +-
2020
.../world/blocks/defense/ForceProjector.java | 7 +-
21-
.../world/blocks/defense/MendProjector.java | 7 +-
21+
.../world/blocks/defense/MendProjector.java | 6 +-
2222
.../world/blocks/defense/RegenProjector.java | 5 +-
2323
.../world/blocks/defense/ShieldWall.java | 4 +
2424
.../defense/turrets/PointDefenseTurret.java | 1 +
@@ -38,7 +38,7 @@ way-zer <[email protected]> on 2024/5/4 at 22:17
3838
core/src/mindustry/world/meta/StatCat.java | 5 +-
3939
core/src/mindustry/world/meta/StatValues.java | 254 ++++++++++++++----
4040
core/src/mindustryX/features/StatExt.java | 96 +++++++
41-
29 files changed, 504 insertions(+), 91 deletions(-)
41+
29 files changed, 503 insertions(+), 91 deletions(-)
4242
create mode 100644 core/src/mindustryX/features/StatExt.java
4343

4444
diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties
@@ -388,18 +388,10 @@ index 74f0fd4860644903c3ce81318681596f0a60d317..4b7d6968838780299971c9a827752e51
388388
}
389389

390390
diff --git a/core/src/mindustry/world/blocks/defense/MendProjector.java b/core/src/mindustry/world/blocks/defense/MendProjector.java
391-
index 369d0eecea48320fb8559acdf6de9cf2c74447c9..5c9f7369c72dbd5b6b4345008e7dc896e48b02b4 100644
391+
index edafc65164c72b570b779eaa6f65ab4029d946c9..b6d7155bb8ed1cc1351c9e1d07b1e1a9aabf4224 100644
392392
--- a/core/src/mindustry/world/blocks/defense/MendProjector.java
393393
+++ b/core/src/mindustry/world/blocks/defense/MendProjector.java
394-
@@ -13,6 +13,7 @@ import mindustry.logic.*;
395-
import mindustry.world.*;
396-
import mindustry.world.consumers.*;
397-
import mindustry.world.meta.*;
398-
+import mindustryX.features.*;
399-
400-
import static mindustry.Vars.*;
401-
402-
@@ -51,13 +52,15 @@ public class MendProjector extends Block{
394+
@@ -52,13 +52,15 @@ public class MendProjector extends Block{
403395
stats.timePeriod = useTime;
404396
super.setStats();
405397

patches/client/0024-API-Hooks-onHandleSendMessage.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Subject: [PATCH] API(Hooks) onHandleSendMessage
99
2 files changed, 10 insertions(+)
1010

1111
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
12-
index 5cbdf0a613c067f662a3c7dd4511bb33e35657ae..3a5b36fd03f48d2c1265884c21b70bb3cdb772bb 100644
12+
index 72db086039f01b7358023c494a3355db24433117..3b4f8e8ee03f9ec4c95e085739af1d10454a0813 100644
1313
--- a/core/src/mindustry/core/NetClient.java
1414
+++ b/core/src/mindustry/core/NetClient.java
1515
@@ -198,6 +198,8 @@ public class NetClient implements ApplicationListener{

patches/client/0027-C-RenderExt-showPlacementEffect.patch

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Subject: [PATCH] C(RenderExt) showPlacementEffect
88
1 file changed, 48 insertions(+)
99

1010
diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java
11-
index 936e714c690d884258097765a25369f7dc089e07..f2dc213e01b2f8114a3d4ca7e018b4c231019dde 100644
11+
index 32fa3691159506083aa110c90a182665aeb49844..6cd82be98b657e3aa36b29c46d6d172f5f4d9dd6 100644
1212
--- a/core/src/mindustryX/features/RenderExt.java
1313
+++ b/core/src/mindustryX/features/RenderExt.java
14-
@@ -1,32 +1,57 @@
14+
@@ -1,33 +1,58 @@
1515
package mindustryX.features;
1616

1717
import arc.*;
@@ -38,7 +38,7 @@ index 936e714c690d884258097765a25369f7dc089e07..f2dc213e01b2f8114a3d4ca7e018b4c2
3838
+ public static boolean showPlacementEffect;
3939
public static int hiddenItemTransparency;
4040
+ public static int blockBarMinHealth;
41-
public static float overdriveZoneTransparency;
41+
public static float overdriveZoneTransparency, mendZoneTransparency;
4242
+ private static Effect placementEffect;
4343

4444
public static void init(){
@@ -63,13 +63,14 @@ index 936e714c690d884258097765a25369f7dc089e07..f2dc213e01b2f8114a3d4ca7e018b4c2
6363
hiddenItemTransparency = Core.settings.getInt("HiddleItemTransparency");
6464
+ blockBarMinHealth = Core.settings.getInt("blockbarminhealth");
6565
overdriveZoneTransparency = Core.settings.getInt("overdrive_zone") / 100f;
66+
mendZoneTransparency = Core.settings.getInt("mend_zone") / 100f;
6667
});
6768
Events.run(Trigger.draw, RenderExt::draw);
6869
+ Events.on(TileChangeEvent.class, RenderExt::onSetBlock);
6970
}
7071

7172
private static void draw(){
72-
@@ -43,4 +68,27 @@ public class RenderExt{
73+
@@ -44,4 +69,27 @@ public class RenderExt{
7374
if(displayAllMessage && build instanceof MessageBuild)
7475
Draw.draw(Layer.overlayUI - 0.1f, build::drawSelect);
7576
}

patches/client/0030-API-ui.Format.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ way-zer <[email protected]> on 2024/6/14
1818

1919
diff --git a/core/src/mindustryX/features/ui/Format.kt b/core/src/mindustryX/features/ui/Format.kt
2020
new file mode 100644
21-
index 0000000000000000000000000000000000000000..0a61abc0d266f8c3ba93285b6a35eb85f9190f54
21+
index 0000000000000000000000000000000000000000..293e186b306383f1a87f6916dd51cc16688a6698
2222
--- /dev/null
2323
+++ b/core/src/mindustryX/features/ui/Format.kt
2424
@@ -0,0 +1,123 @@
@@ -104,7 +104,7 @@ index 0000000000000000000000000000000000000000..0a61abc0d266f8c3ba93285b6a35eb85
104104
+ }
105105
+
106106
+ @JvmOverloads
107-
+ fun percent(cur: Float, max: Float, percent: Float = 100 * cur / max, showPercent: Boolean = percent < 0.95f): String {
107+
+ fun percent(cur: Float, max: Float, percent: Float = cur / max, showPercent: Boolean = percent < 0.95f): String {
108108
+ return buildString {
109109
+ if (Mathf.zero(percent, 0.1f)) append('\uE815') else append(format(cur))
110110
+ if (percent < 0.99f) {
@@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..0a61abc0d266f8c3ba93285b6a35eb85
113113
+ }
114114
+ if (showPercent) {
115115
+ append(" [lightgray]| ")
116-
+ append(percent.toInt())
116+
+ append((percent * 100).toInt())
117117
+ append('%')
118118
+ }
119119
+ }
@@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..0a61abc0d266f8c3ba93285b6a35eb85
127127
+object FormatDefault {
128128
+ @JvmOverloads
129129
+ @JvmStatic
130-
+ fun percent(cur: Float, max: Float, percent: Float = 100 * cur / max, showPercent: Boolean = percent <= 0.99f): String = Format.default.percent(cur, max, percent, showPercent)
130+
+ fun percent(cur: Float, max: Float, percent: Float = cur / max, showPercent: Boolean = percent <= 0.99f): String = Format.default.percent(cur, max, percent, showPercent)
131131
+
132132
+ @JvmStatic
133133
+ fun format(number: Float): String = Format.default.format(number)

patches/client/0037-C-ReplayController.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ way-zer <[email protected]> on 2024/4/22 at 20:15
2020
create mode 100644 core/src/mindustryX/features/ReplayController.java
2121

2222
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
23-
index 3a5b36fd03f48d2c1265884c21b70bb3cdb772bb..2e9a8c337ae1182dfa5527a23c50afb6da42f834 100644
23+
index 3b4f8e8ee03f9ec4c95e085739af1d10454a0813..cd9ef6e4832961bef095ed8deec2b69d88b14d28 100644
2424
--- a/core/src/mindustry/core/NetClient.java
2525
+++ b/core/src/mindustry/core/NetClient.java
2626
@@ -24,6 +24,7 @@ import mindustry.net.*;

0 commit comments

Comments
 (0)