Skip to content

Commit 1a4853f

Browse files
committed
sync 2024/9/8
1 parent b48e2b7 commit 1a4853f

File tree

52 files changed

+1549
-1149
lines changed

Some content is hidden

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

52 files changed

+1549
-1149
lines changed

patches/client/0003-CS-Version.patch

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Tue, 9 Apr 2024 18:21:14 +0800
44
Subject: [PATCH] CS: Version
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
58

9+
不再发送ARC标识
10+
way-zer <[email protected]> on 2024/9/8
611
---
712
.gitignore | 1 +
813
android/build.gradle | 4 ++--
914
android/res/values/strings.xml | 2 +-
1015
build.gradle | 2 +-
1116
core/build.gradle.kts | 2 +-
1217
core/src/mindustry/Vars.java | 2 +-
13-
core/src/mindustry/core/NetClient.java | 2 ++
18+
core/src/mindustry/core/NetClient.java | 1 +
1419
core/src/mindustry/core/Version.java | 16 +++++++++++++++-
1520
core/src/mindustry/net/NetworkIO.java | 2 +-
1621
gradle.properties | 2 ++
17-
10 files changed, 27 insertions(+), 8 deletions(-)
22+
10 files changed, 26 insertions(+), 8 deletions(-)
1823

1924
diff --git a/.gitignore b/.gitignore
2025
index 7d91d3191096c431b739d2d5ecd951a764feead3..ba271e6bd0dd06971fff6fa2314254149cc90087 100644
@@ -100,14 +105,13 @@ index bc4c6a494aec88af73f001906598ba91a50ac6a3..d08d04a6f0e8107cec995876b2072c46
100105
public static final Seq<ServerGroup> defaultServers = Seq.with();
101106
/** maximum size of any block, do not change unless you know what you're doing */
102107
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
103-
index d0e444a4a7a9ced372a2c93102860991ac922112..72db086039f01b7358023c494a3355db24433117 100644
108+
index d0e444a4a7a9ced372a2c93102860991ac922112..0948c4a880fe17643171857951722cd798248892 100644
104109
--- a/core/src/mindustry/core/NetClient.java
105110
+++ b/core/src/mindustry/core/NetClient.java
106-
@@ -135,6 +135,8 @@ public class NetClient implements ApplicationListener{
111+
@@ -135,6 +135,7 @@ public class NetClient implements ApplicationListener{
107112
Log.info("Received world data: @ bytes.", data.stream.available());
108113
NetworkIO.loadWorld(new InflaterInputStream(data.stream));
109114

110-
+ Call.serverPacketReliable("ARC", Version.mdtXBuild);
111115
+ Call.serverPacketReliable("MDTX", Version.mdtXBuild);
112116
finishConnecting();
113117
});

patches/client/0013-C.patch patches/client/0013-C-dynamic-Window-title.patch

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Wed, 24 Jan 2024 21:40:17 +0800
4-
Subject: [PATCH] =?UTF-8?q?C:=20=E5=8A=A8=E6=80=81=E6=B8=B8=E6=88=8F?=
5-
=?UTF-8?q?=E6=A0=87=E9=A2=98?=
4+
Subject: [PATCH] =?UTF-8?q?C:=20dynamic=20Window=20title=20/=20=E5=8A=A8?=
5+
=?UTF-8?q?=E6=80=81=E6=B8=B8=E6=88=8F=E6=A0=87=E9=A2=98?=
66
MIME-Version: 1.0
77
Content-Type: text/plain; charset=UTF-8
88
Content-Transfer-Encoding: 8bit
99

1010
---
11-
core/src/mindustry/ClientLauncher.java | 14 ++++++++++++++
12-
1 file changed, 14 insertions(+)
11+
core/src/mindustry/ClientLauncher.java | 15 +++++++++++++++
12+
1 file changed, 15 insertions(+)
1313

1414
diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java
15-
index e3bf01fb63b179f4669e99c43891b842bcae66a6..b4c83b0e03a421e9f4d738944dca1873f6a27c82 100644
15+
index e3bf01fb63b179f4669e99c43891b842bcae66a6..dffbb9df1312c2c7842c533bb2801b4810328747 100644
1616
--- a/core/src/mindustry/ClientLauncher.java
1717
+++ b/core/src/mindustry/ClientLauncher.java
1818
@@ -238,6 +238,8 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
@@ -24,16 +24,17 @@ index e3bf01fb63b179f4669e99c43891b842bcae66a6..b4c83b0e03a421e9f4d738944dca1873
2424
asyncCore.begin();
2525

2626
super.update();
27-
@@ -254,6 +256,18 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
27+
@@ -254,6 +256,19 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
2828
}
2929
}
3030

3131
+ private String lastTitle = "";
3232
+ private void updateTitle(){
33+
+ if(graphics == null) return;
3334
+ var mod = mods.orderedMods();
3435
+ var title = "MindustryX | 版本号 " + Version.mdtXBuild +
3536
+ " | mod启用" + mod.count(Mods.LoadedMod::enabled) + "/" + mod.size +
36-
+ " | " + (Core.graphics != null ? Core.graphics.getWidth() + "x" + Core.graphics.getHeight() : "");
37+
+ " | " + graphics.getWidth() + "x" + graphics.getHeight();
3738
+ if(!title.equals(lastTitle)){
3839
+ lastTitle = title;
3940
+ graphics.setTitle(title);

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ 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 72db086039f01b7358023c494a3355db24433117..3b4f8e8ee03f9ec4c95e085739af1d10454a0813 100644
12+
index 0948c4a880fe17643171857951722cd798248892..c6f8015a4616cb845c091c88425fd1cb33e0c8f4 100644
1313
--- a/core/src/mindustry/core/NetClient.java
1414
+++ b/core/src/mindustry/core/NetClient.java
15-
@@ -198,6 +198,8 @@ public class NetClient implements ApplicationListener{
15+
@@ -197,6 +197,8 @@ public class NetClient implements ApplicationListener{
1616

1717
@Remote(targets = Loc.server, variants = Variant.both)
1818
public static void sendMessage(String message, @Nullable String unformatted, @Nullable Player playersender){
@@ -21,7 +21,7 @@ index 72db086039f01b7358023c494a3355db24433117..3b4f8e8ee03f9ec4c95e085739af1d10
2121
if(Vars.ui != null){
2222
Vars.ui.chatfrag.addMessage(message);
2323
Sounds.chatMessage.play();
24-
@@ -215,6 +217,8 @@ public class NetClient implements ApplicationListener{
24+
@@ -214,6 +216,8 @@ public class NetClient implements ApplicationListener{
2525
//equivalent to above method but there's no sender and no console log
2626
@Remote(called = Loc.server, targets = Loc.server)
2727
public static void sendMessage(String message){

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

+3-3
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..293e186b306383f1a87f6916dd51cc16688a6698
21+
index 0000000000000000000000000000000000000000..63dc96567e610f20f1244b90fc2fb731549cc989
2222
--- /dev/null
2323
+++ b/core/src/mindustryX/features/ui/Format.kt
2424
@@ -0,0 +1,123 @@
@@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..293e186b306383f1a87f6916dd51cc16
3434
+data class Format @JvmOverloads constructor(var decimal: Int = 2, var fixDecimals: Boolean = false) {
3535
+ /**以固定的有效位数输出*/
3636
+ fun fixedPrecision(v: Float): String {
37-
+ val exponent = Mathf.floor(Mathf.log(10f, abs(v)))
37+
+ val exponent = Mathf.floor(Mathf.log(10f, abs(v))).coerceAtLeast(0)
3838
+ if (exponent >= decimal) return v.toInt().toString()
3939
+ return Strings.fixed(v, decimal - exponent)
4040
+ }
@@ -106,7 +106,7 @@ index 0000000000000000000000000000000000000000..293e186b306383f1a87f6916dd51cc16
106106
+ @JvmOverloads
107107
+ fun percent(cur: Float, max: Float, percent: Float = cur / max, showPercent: Boolean = percent < 0.95f): String {
108108
+ return buildString {
109-
+ if (Mathf.zero(percent, 0.1f)) append('\uE815') else append(format(cur))
109+
+ append(format(cur))
110110
+ if (percent < 0.99f) {
111111
+ append('/')
112112
+ append(format(max))

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 3b4f8e8ee03f9ec4c95e085739af1d10454a0813..cd9ef6e4832961bef095ed8deec2b69d88b14d28 100644
23+
index c6f8015a4616cb845c091c88425fd1cb33e0c8f4..096f637032d6ad33967d62732ba2732a054b5e22 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.*;

patches/client/0040-ARC-bundle-and-settings.patch

+9-11
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ way-zer <[email protected]> on 2024/4/20 at 21:59
1111
---
1212
core/assets/bundles/bundle-mdtx.properties | 237 ++++++++++++++++++
1313
.../ui/dialogs/SettingsMenuDialog.java | 28 +--
14-
core/src/mindustryX/features/ArcOld.java | 221 ++++++++++++++++
14+
core/src/mindustryX/features/ArcOld.java | 219 ++++++++++++++++
1515
core/src/mindustryX/features/Settings.java | 1 +
16-
4 files changed, 472 insertions(+), 15 deletions(-)
16+
4 files changed, 470 insertions(+), 15 deletions(-)
1717
create mode 100644 core/src/mindustryX/features/ArcOld.java
1818

1919
diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties
20-
index 623d778207282303a60e9efc99981131a99eb253..70ed79fdf385216999a98244f5128f6c47e29d78 100644
20+
index 623d778207282303a60e9efc99981131a99eb253..9d9cbc07ea828ebbcc4557994b36328cf9764e45 100644
2121
--- a/core/assets/bundles/bundle-mdtx.properties
2222
+++ b/core/assets/bundles/bundle-mdtx.properties
2323
@@ -77,3 +77,240 @@ category.developerMode.name = 特殊设置
@@ -156,7 +156,7 @@ index 623d778207282303a60e9efc99981131a99eb253..70ed79fdf385216999a98244f5128f6c
156156
+schematic.preview = 预览
157157
+setting.AuxiliaryTable.name = [acid]辅助器 [orange][重启生效]
158158
+setting.ShowInfoPopup.name = [acid]服务器信息版
159-
+setting.allBlocksReveal.name = [cyan]显示并允许建造所有物品
159+
+setting.allUnlocked.name = [cyan]显示所有内容(含隐藏)
160160
+setting.alwaysShowPlayerUnit.name = [cyan]强制显示[white]:玩家本体及带领的单位
161161
+setting.alwaysShowUnitRTSAi.name = [acid]单位[white]:执行的RTS命令
162162
+setting.alwaysshowdropzone.name = [cyan]刷怪点
@@ -243,7 +243,7 @@ index 623d778207282303a60e9efc99981131a99eb253..70ed79fdf385216999a98244f5128f6c
243243
+setting.unitWeaponTargetLine.name = [acid]单位武器目标
244244
+setting.unitbuildplan.name = [acid]单位[white]:建造序列显示
245245
+setting.unithitbox.name = [acid]单位碰撞箱
246-
+setting.worldCreator.name = [cyan]创世神 [gray]可放置与删除地形
246+
+setting.worldCreator.name = [cyan]创世神 [gray]无视限制,可编辑地形
247247
+settings.arc = [cyan]学术端!
248248
+settings.cheating = [red]作弊功能
249249
+settings.forcehide = [orange]帧率重调装置
@@ -330,10 +330,10 @@ index b93dced65be5c1eea38adc80f8dc2d84c2b3864d..b71452eca5b3527f0c2ee15edd8d6ef0
330330

331331
diff --git a/core/src/mindustryX/features/ArcOld.java b/core/src/mindustryX/features/ArcOld.java
332332
new file mode 100644
333-
index 0000000000000000000000000000000000000000..ad69511c62759552d9611ed901d0ef8bc4accbc8
333+
index 0000000000000000000000000000000000000000..47ea958a84d4e7f33241ad98da20db3d061eab78
334334
--- /dev/null
335335
+++ b/core/src/mindustryX/features/ArcOld.java
336-
@@ -0,0 +1,221 @@
336+
@@ -0,0 +1,219 @@
337337
+package mindustryX.features;
338338
+
339339
+import arc.func.*;
@@ -498,10 +498,8 @@ index 0000000000000000000000000000000000000000..ad69511c62759552d9611ed901d0ef8b
498498
+ c.addCategory("arcWeakCheat");
499499
+ c.checkPref("save_more_map", false);
500500
+ c.checkPref("forceIgnoreAttack", false);
501-
+ c.checkPref("allBlocksReveal", false, b -> AdvanceToolTable.allBlocksReveal = b);
502-
+ AdvanceToolTable.allBlocksReveal = settings.getBool("allBlocksReveal");
503-
+ c.checkPref("worldCreator", false, b -> AdvanceToolTable.worldCreator = b);
504-
+ AdvanceToolTable.worldCreator = settings.getBool("worldCreator");
501+
+ c.checkPref("allUnlocked", false);
502+
+ c.checkPref("worldCreator", false);
505503
+ c.checkPref("overrideSkipWave", false);
506504
+ c.checkPref("forceConfigInventory", false);
507505
+ c.addCategory("arcStrongCheat");

patches/client/0042-C-misc-patch.patch

+74-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Date: Sun, 18 Feb 2024 15:58:00 +0800
44
Subject: [PATCH] C: misc patch
55

66
---
7+
core/src/mindustry/ClientLauncher.java | 2 +-
78
core/src/mindustry/core/Control.java | 3 ++-
89
core/src/mindustry/core/NetClient.java | 4 ++++
910
core/src/mindustry/core/Renderer.java | 6 +++---
@@ -13,9 +14,24 @@ Subject: [PATCH] C: misc patch
1314
core/src/mindustry/net/ArcNetProvider.java | 2 +-
1415
.../mindustry/ui/dialogs/KeybindDialog.java | 9 ++++++---
1516
.../ui/fragments/BlockInventoryFragment.java | 2 +-
17+
.../mindustry/world/blocks/defense/Radar.java | 9 +++++++++
1618
.../world/blocks/distribution/Router.java | 3 ++-
17-
10 files changed, 29 insertions(+), 33 deletions(-)
19+
.../world/blocks/production/BeamDrill.java | 12 ++++-------
20+
13 files changed, 43 insertions(+), 42 deletions(-)
1821

22+
diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java
23+
index dffbb9df1312c2c7842c533bb2801b4810328747..1eaf2eb3ccbc433068d421d48963441c359c566b 100644
24+
--- a/core/src/mindustry/ClientLauncher.java
25+
+++ b/core/src/mindustry/ClientLauncher.java
26+
@@ -252,7 +252,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
27+
if(nextFrame > current){
28+
long toSleep = nextFrame - current;
29+
Threads.sleep(toSleep / 1000000, (int)(toSleep % 1000000));
30+
- }
31+
+ }else nextFrame = current;
32+
}
33+
}
34+
1935
diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java
2036
index bc730c44c41cbda85f46acc6990824f6985bc369..0af94a29e5013a51a98cdfe6a5f62bdb340566af 100644
2137
--- a/core/src/mindustry/core/Control.java
@@ -31,7 +47,7 @@ index bc730c44c41cbda85f46acc6990824f6985bc369..0af94a29e5013a51a98cdfe6a5f62bdb
3147
Core.settings.put("uiscale", 100);
3248
Core.settings.put("uiscalechanged", false);
3349
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
34-
index cd9ef6e4832961bef095ed8deec2b69d88b14d28..5bef0c490bf785c3ca1cb41d5206a0df4cb53053 100644
50+
index 096f637032d6ad33967d62732ba2732a054b5e22..6fd5f42c966fcb10c68fd54c0e2a6498556e87fb 100644
3551
--- a/core/src/mindustry/core/NetClient.java
3652
+++ b/core/src/mindustry/core/NetClient.java
3753
@@ -62,6 +62,10 @@ public class NetClient implements ApplicationListener{
@@ -224,6 +240,39 @@ index 84f5bc221c2f1846d831acf4abf902b15bfc1c59..4a8ef62fb82970df299159e53687f4c8
224240
int row = 0;
225241

226242
table.margin(4f);
243+
diff --git a/core/src/mindustry/world/blocks/defense/Radar.java b/core/src/mindustry/world/blocks/defense/Radar.java
244+
index e24a3368d190f64fdaf002130a76f4799834c9a5..0811c4520865cff648084cbc743a141367a103c5 100644
245+
--- a/core/src/mindustry/world/blocks/defense/Radar.java
246+
+++ b/core/src/mindustry/world/blocks/defense/Radar.java
247+
@@ -3,12 +3,14 @@ package mindustry.world.blocks.defense;
248+
import arc.graphics.*;
249+
import arc.graphics.g2d.*;
250+
import arc.math.*;
251+
+import arc.math.geom.*;
252+
import arc.struct.*;
253+
import arc.util.io.*;
254+
import mindustry.*;
255+
import mindustry.annotations.Annotations.*;
256+
import mindustry.gen.*;
257+
import mindustry.graphics.*;
258+
+import mindustry.input.*;
259+
import mindustry.world.*;
260+
import mindustry.world.meta.*;
261+
262+
@@ -45,6 +47,13 @@ public class Radar extends Block{
263+
Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, fogRadius * tilesize, Pal.accent);
264+
}
265+
266+
+ //MDTX: 自动控制放置距离
267+
+ @Override
268+
+ public void changePlacementPath(Seq<Point2> points, int rotation){
269+
+ var placeRadius2 = Mathf.pow(fogRadius, 2f) * 3;//*2/sqrt(3)/2
270+
+ Placement.calculateNodes(points, this, rotation, (point, other) -> point.dst2(other) <= placeRadius2);
271+
+ }
272+
+
273+
public class RadarBuild extends Building{
274+
public float progress;
275+
public float lastRadius = 0f;
227276
diff --git a/core/src/mindustry/world/blocks/distribution/Router.java b/core/src/mindustry/world/blocks/distribution/Router.java
228277
index 1e4a9399aac99d771d201d6ac01055295da686d4..fd1ef350517446c74427f85d27372bdd1a63cf22 100644
229278
--- a/core/src/mindustry/world/blocks/distribution/Router.java
@@ -238,3 +287,26 @@ index 1e4a9399aac99d771d201d6ac01055295da686d4..fd1ef350517446c74427f85d27372bdd
238287
}
239288

240289
@Override
290+
diff --git a/core/src/mindustry/world/blocks/production/BeamDrill.java b/core/src/mindustry/world/blocks/production/BeamDrill.java
291+
index 163019c9c2562301984912c212e5d5558a028e36..85ec19d8a4d07d7c02245226b5ce39589edf01b4 100644
292+
--- a/core/src/mindustry/world/blocks/production/BeamDrill.java
293+
+++ b/core/src/mindustry/world/blocks/production/BeamDrill.java
294+
@@ -171,14 +171,10 @@ public class BeamDrill extends Block{
295+
}
296+
297+
if(item != null){
298+
- float width = drawPlaceText(Core.bundle.formatFloat("bar.drillspeed", 60f / getDrillTime(item) * count, 2), x, y, valid);
299+
- if(!multiple){
300+
- float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f;
301+
- Draw.mixcol(Color.darkGray, 1f);
302+
- Draw.rect(item.fullIcon, dx, dy - 1, s, s);
303+
- Draw.reset();
304+
- Draw.rect(item.fullIcon, dx, dy, s, s);
305+
- }
306+
+ //MDTX 增加加液速度显示
307+
+ float speed = 60f / getDrillTime(item) * count;
308+
+ String msg = Strings.format("@ [white]@@[] @[white]([cyan]@[])", Iconc.production, item.emoji(), item.localizedName, Strings.autoFixed(speed, 2), Strings.autoFixed(speed * optionalBoostIntensity, 2));
309+
+ drawPlaceText(msg, x, y, valid);
310+
}else if(invalidItem != null){
311+
drawPlaceText(Core.bundle.get("bar.drilltierreq"), x, y, false);
312+
}

0 commit comments

Comments
 (0)