diff --git a/README.md b/README.md index 9624632b29..095c70ed3a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ See [CONTRIBUTING](CONTRIBUTING.md). Bleeding-edge builds are generated automatically for every commit. You can see them [here](https://github.com/Anuken/MindustryBuilds/releases). If you'd rather compile on your own, follow these instructions. -First, make sure you have [JDK 16-17](https://adoptium.net/archive.html?variant=openjdk17&jvmVariant=hotspot) installed. **Other JDK versions will not work.** Open a terminal in the Mindustry directory and run the following commands: +First, make sure you have [JDK 17](https://adoptium.net/archive.html?variant=openjdk17&jvmVariant=hotspot) installed. **Other JDK versions will not work.** Open a terminal in the Mindustry directory and run the following commands: ### Windows diff --git a/core/assets/maps/stainedMountains.msav b/core/assets/maps/stainedMountains.msav index ee28f1dc23..af8a2b8e3b 100644 Binary files a/core/assets/maps/stainedMountains.msav and b/core/assets/maps/stainedMountains.msav differ diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index bc4c6a494a..e7bca60cd6 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -145,7 +145,7 @@ public class Vars implements Loadable{ "modeSurvival", "commandRally", "commandAttack", }; /** maximum TCP packet size */ - public static final int maxTcpSize = 900; + public static final int maxTcpSize = 1100; /** default server port */ public static final int port = 6567; /** multicast discovery port.*/ diff --git a/core/src/mindustry/editor/WaveGraph.java b/core/src/mindustry/editor/WaveGraph.java index 398443c177..2d64af5be9 100644 --- a/core/src/mindustry/editor/WaveGraph.java +++ b/core/src/mindustry/editor/WaveGraph.java @@ -1,8 +1,10 @@ package mindustry.editor; +import arc.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; +import arc.math.geom.*; import arc.scene.ui.*; import arc.scene.ui.layout.*; import arc.struct.*; @@ -26,12 +28,16 @@ public class WaveGraph extends Table{ private float maxHealth; private Table colors; private ObjectSet hidden = new ObjectSet<>(); + private StringBuilder countStr = new StringBuilder(); public WaveGraph(){ background(Tex.pane); rect((x, y, width, height) -> { Lines.stroke(Scl.scl(3f)); + countStr.setLength(0); + + Vec2 mouse = stageToLocalCoordinates(Core.input.mouse()); GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new); Font font = Fonts.outline; @@ -50,6 +56,8 @@ public class WaveGraph extends Table{ float graphX = x + offsetX, graphY = y + offsetY, graphW = width - offsetX, graphH = height - offsetY; float spacing = graphW / (values.length - 1); + int selcol = Rect.contains(x, y, width, height, mouse.x, mouse.y) ? Mathf.round((mouse.x - graphX) / spacing) : -1; + if(mode == Mode.counts){ for(UnitType type : used.orderedItems()){ Draw.color(color(type)); @@ -97,6 +105,23 @@ public class WaveGraph extends Table{ Lines.endLine(); } + + if(selcol >= 0 && selcol < values.length){ + Draw.color(1f, 0f, 0f, 0.2f); + Fill.crect(selcol * spacing + graphX - spacing/2f, graphY, spacing, graphH); + Draw.color(); + font.getData().setScale(1.5f); + for(UnitType type : used.orderedItems()){ + int amount = values[Mathf.clamp(selcol, 0, values.length - 1)][type.id]; + if(amount > 0){ + countStr.append(type.emoji()).append(" ").append(amount).append("\n"); + } + } + float pad = Scl.scl(5f); + font.draw(countStr, selcol * spacing + graphX - spacing/2f + pad, graphY + graphH - pad); + font.getData().setScale(1f); + } + //how many numbers can fit here float totalMarks = Mathf.clamp(maxY, 1, 10); @@ -123,7 +148,7 @@ public class WaveGraph extends Table{ float cy = y + fh, cx = graphX + graphW / (values.length - 1) * i; Lines.line(cx, cy, cx, cy + len); - if(i == values.length / 2){ + if(i == selcol){ font.draw("" + (i + from + 1), cx, cy - Scl.scl(2f), Align.center); } } diff --git a/core/src/mindustry/editor/WaveInfoDialog.java b/core/src/mindustry/editor/WaveInfoDialog.java index d3f2e7ca6e..ca4a24404d 100644 --- a/core/src/mindustry/editor/WaveInfoDialog.java +++ b/core/src/mindustry/editor/WaveInfoDialog.java @@ -6,6 +6,7 @@ import arc.graphics.*; import arc.input.*; import arc.math.*; import arc.math.geom.*; +import arc.scene.*; import arc.scene.event.*; import arc.scene.style.*; import arc.scene.ui.*; @@ -201,6 +202,19 @@ public class WaveInfoDialog extends BaseDialog{ cont.add(graph = new WaveGraph()).grow(); + graph.scrolled((scroll) -> { + view(Mathf.sign(scroll)); + }); + + graph.touchable = Touchable.enabled; + graph.addListener(new InputListener(){ + + @Override + public void enter(InputEvent event, float x, float y, int pointer, Element fromActor){ + graph.requestScroll(); + } + }); + buildGroups(); } diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index 3ece15b1d9..9fa83c39ee 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -62,12 +62,13 @@ public class Mods implements Loadable{ return mainLoader; } - /** @return the folder where configuration files for this mod should go. The folder may not exist yet; call mkdirs() before writing to it. - * Call this in init(). */ + /** @return the folder where configuration files for this mod should go. Call this in init(). */ public Fi getConfigFolder(Mod mod){ ModMeta load = metas.get(mod.getClass()); if(load == null) throw new IllegalArgumentException("Mod is not loaded yet (or missing)!"); - return modDirectory.child(load.name); + Fi result = modDirectory.child(load.name); + result.mkdirs(); + return result; } /** @return a file named 'config.json' in the config folder for the specified mod. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0d1842103b..e1adfb4938 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/server/build.gradle b/server/build.gradle index 7359fdac3c..f348e41dbf 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -47,6 +47,8 @@ task dist(type: Jar, dependsOn: configurations.runtimeClasspath){ exclude("icons/icon.ico") exclude("icons/icon_64.png") + duplicatesStrategy = 'exclude' + manifest{ attributes 'Main-Class': project.mainClassName } diff --git a/settings.gradle b/settings.gradle index b74305dad2..dafd6bdf99 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ -if(JavaVersion.current().ordinal() < JavaVersion.VERSION_16.ordinal()){ - throw new Exception("!!! YOU MUST USE JAVA 16 OR ABOVE TO COMPILE AND RUN MINDUSTRY !!! Read the README. Your version: ${System.properties["java.version"]}") +if(JavaVersion.current().ordinal() < JavaVersion.VERSION_17.ordinal()){ + throw new Exception("!!! YOU MUST USE JAVA 17 OR ABOVE TO COMPILE AND RUN MINDUSTRY !!! Read the README. Your version: ${System.properties["java.version"]}") } include 'desktop', 'core', 'server', 'ios', 'annotations', 'tools', 'tests'