@@ -4,6 +4,7 @@ Date: Sun, 18 Feb 2024 15:58:00 +0800
4
4
Subject: [PATCH] C: misc patch
5
5
6
6
---
7
+ core/src/mindustry/ClientLauncher.java | 2 +-
7
8
core/src/mindustry/core/Control.java | 3 ++-
8
9
core/src/mindustry/core/NetClient.java | 4 ++++
9
10
core/src/mindustry/core/Renderer.java | 6 +++---
@@ -13,9 +14,24 @@ Subject: [PATCH] C: misc patch
13
14
core/src/mindustry/net/ArcNetProvider.java | 2 +-
14
15
.../mindustry/ui/dialogs/KeybindDialog.java | 9 ++++++---
15
16
.../ui/fragments/BlockInventoryFragment.java | 2 +-
17
+ .../mindustry/world/blocks/defense/Radar.java | 9 +++++++++
16
18
.../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(-)
18
21
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
+
19
35
diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java
20
36
index bc730c44c41cbda85f46acc6990824f6985bc369..0af94a29e5013a51a98cdfe6a5f62bdb340566af 100644
21
37
--- a/core/src/mindustry/core/Control.java
@@ -31,7 +47,7 @@ index bc730c44c41cbda85f46acc6990824f6985bc369..0af94a29e5013a51a98cdfe6a5f62bdb
31
47
Core.settings.put("uiscale", 100);
32
48
Core.settings.put("uiscalechanged", false);
33
49
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
35
51
--- a/core/src/mindustry/core/NetClient.java
36
52
+++ b/core/src/mindustry/core/NetClient.java
37
53
@@ -62,6 +62,10 @@ public class NetClient implements ApplicationListener{
@@ -224,6 +240,39 @@ index 84f5bc221c2f1846d831acf4abf902b15bfc1c59..4a8ef62fb82970df299159e53687f4c8
224
240
int row = 0;
225
241
226
242
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;
227
276
diff --git a/core/src/mindustry/world/blocks/distribution/Router.java b/core/src/mindustry/world/blocks/distribution/Router.java
228
277
index 1e4a9399aac99d771d201d6ac01055295da686d4..fd1ef350517446c74427f85d27372bdd1a63cf22 100644
229
278
--- a/core/src/mindustry/world/blocks/distribution/Router.java
@@ -238,3 +287,26 @@ index 1e4a9399aac99d771d201d6ac01055295da686d4..fd1ef350517446c74427f85d27372bdd
238
287
}
239
288
240
289
@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