From 2161dd519a8821b1df67cd10599a71d12588b8fd Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 21 May 2025 23:07:59 -0400 Subject: [PATCH] Sector layout changes --- core/assets/planets/serpulo.json | 2 +- .../mindustry/content/SerpuloTechTree.java | 124 +++++++++--------- .../src/mindustry/entities/comp/MechComp.java | 2 +- core/src/mindustry/input/InputHandler.java | 51 +++---- .../mindustry/ui/dialogs/PlanetDialog.java | 6 +- 5 files changed, 95 insertions(+), 90 deletions(-) diff --git a/core/assets/planets/serpulo.json b/core/assets/planets/serpulo.json index 4bd8409ec0..e8e128d9e6 100644 --- a/core/assets/planets/serpulo.json +++ b/core/assets/planets/serpulo.json @@ -1 +1 @@ -{presets:{windsweptIslands:97,stainedMountains:223,weatheredChannels:166,craters:175,coastline:164,navalFortress:165,frontier:215,groundZero:15,mycelialBastion:142,facility32m:268,atolls:217,overgrowth:86,testingGrounds:99,frozenForest:219,saltFlats:98,taintedWoods:145,infestedCanyons:85,desolateRift:123,nuclearComplex:228,ruinousShores:41,planetaryTerminal:93,impact0078:270,seaPort:216,geothermalStronghold:264,cruxscape:54,fungalPass:221,tarFields:72,biomassFacility:23},attackSectors:[0,2,5,6,10,11,12,13,16,19,24,25,27,28,30,31,33,34,36,47,48,49,51,56,57,59,60,66,67,68,70,71,75,76,78,82,84,90,104,106,110,114,115,121,124,125,127,128,129,133,138,148,149,154,158,180,182,200,202,204,210,224,225,229,233,234,235,241,243,248,254,255,257,259,265]} \ No newline at end of file +{presets:{windsweptIslands:97,stainedMountains:223,weatheredChannels:166,craters:175,extractionOutpost:213,coastline:164,navalFortress:165,frontier:86,groundZero:15,mycelialBastion:143,facility32m:65,atolls:75,overgrowth:142,testingGrounds:169,frozenForest:219,saltFlats:98,taintedWoods:145,infestedCanyons:85,desolateRift:271,nuclearComplex:228,ruinousShores:41,planetaryTerminal:217,impact0078:266,seaPort:214,geothermalStronghold:264,cruxscape:54,fungalPass:221,tarFields:99,biomassFacility:23},attackSectors:[0,2,5,6,10,11,12,13,16,19,24,25,27,28,30,33,36,47,48,49,51,57,59,60,66,67,68,70,71,76,78,82,90,104,106,110,114,115,121,124,125,127,128,129,133,138,148,149,154,158,180,182,200,202,204,210,224,225,233,234,235,241,243,248,254,255,257,259,265]} \ No newline at end of file diff --git a/core/src/mindustry/content/SerpuloTechTree.java b/core/src/mindustry/content/SerpuloTechTree.java index 8bd6b556ac..c04adc9bc3 100644 --- a/core/src/mindustry/content/SerpuloTechTree.java +++ b/core/src/mindustry/content/SerpuloTechTree.java @@ -485,12 +485,40 @@ public class SerpuloTechTree{ new Research(cultivator), new Research(coalCentrifuge) ), () -> { - node(atolls, Seq.with( - new SectorComplete(seaPort), - new Research(multiplicativeReconstructor), - new Research(mega) - ), () -> { + node(extractionOutpost, Seq.with( + new SectorComplete(windsweptIslands), + new SectorComplete(seaPort), + new SectorComplete(facility32m), + new Research(groundFactory), + new Research(nova), + new Research(airFactory), + new Research(mono) + ), () -> { + node(atolls, Seq.with( + new SectorComplete(extractionOutpost), + new Research(multiplicativeReconstructor), + new Research(mega) + ), () -> { + + }); + + //TODO: removed for now + /*node(polarAerodrome, Seq.with( + new SectorComplete(fungalPass), + new SectorComplete(desolateRift), + new SectorComplete(overgrowth), + new Research(multiplicativeReconstructor), + new Research(zenith), + new Research(swarmer), + new Research(cyclone), + new Research(blastDrill), + new Research(blastDrill), + new Research(massDriver) + ), () -> { + + }); + */ }); }); @@ -531,16 +559,17 @@ public class SerpuloTechTree{ new Research(steamGenerator) ), () -> { - - - node(facility32m, Seq.with( - new Research(plastaniumCompressor), - new Research(lancer), - new Research(salvo), - new SectorComplete(windsweptIslands) + node(saltFlats, Seq.with( + new SectorComplete(windsweptIslands), + new SectorComplete(fungalPass), + new SectorComplete(frontier), + new Research(groundFactory), + new Research(additiveReconstructor), + new Research(airFactory), + new Research(door) ), () -> { node(tarFields, Seq.with( - new SectorComplete(facility32m), + new SectorComplete(saltFlats), new Research(coalCentrifuge), new Research(conduit), new Research(wave) @@ -605,52 +634,6 @@ public class SerpuloTechTree{ }); }); - node(extractionOutpost, Seq.with( - new SectorComplete(windsweptIslands), - new SectorComplete(fungalPass), - new SectorComplete(facility32m), - new Research(groundFactory), - new Research(nova), - new Research(airFactory), - new Research(mono) - ), () -> { - //TODO: removed for now - /*node(polarAerodrome, Seq.with( - new SectorComplete(fungalPass), - new SectorComplete(desolateRift), - new SectorComplete(overgrowth), - new Research(multiplicativeReconstructor), - new Research(zenith), - new Research(swarmer), - new Research(cyclone), - new Research(blastDrill), - new Research(blastDrill), - new Research(massDriver) - ), () -> { - - }); - */ - }); - }); - - node(saltFlats, Seq.with( - new SectorComplete(windsweptIslands), - new SectorComplete(fungalPass), - new SectorComplete(frontier), - new Research(groundFactory), - new Research(additiveReconstructor), - new Research(airFactory), - new Research(door) - ), () -> { - node(testingGrounds, Seq.with( - new Research(cryofluidMixer), - new Research(Liquids.cryofluid), - new Research(waterExtractor), - new Research(ripple) - ), () -> { - - }); - node(coastline, Seq.with( new SectorComplete(windsweptIslands), new SectorComplete(saltFlats), @@ -658,6 +641,17 @@ public class SerpuloTechTree{ new Research(payloadConveyor) ), () -> { + + node(testingGrounds, Seq.with( + new SectorComplete(coastline), + new Research(cryofluidMixer), + new Research(Liquids.cryofluid), + new Research(waterExtractor), + new Research(ripple) + ), () -> { + + }); + node(navalFortress, Seq.with( new SectorComplete(coastline), new SectorComplete(extractionOutpost), @@ -699,7 +693,16 @@ public class SerpuloTechTree{ new Research(siliconSmelter) ), () -> { - //TODO bad order + node(facility32m, Seq.with( + new Research(plastaniumCompressor), + new Research(lancer), + new Research(salvo), + new SectorComplete(stainedMountains), + new SectorComplete(windsweptIslands) + ), () -> { + + }); + node(infestedCanyons, Seq.with( new SectorComplete(fungalPass), new SectorComplete(frontier), @@ -708,7 +711,6 @@ public class SerpuloTechTree{ new Research(minke), new Research(additiveReconstructor) ), () -> { - //TODO difficulty jump! node(nuclearComplex, Seq.with( new SectorComplete(fungalPass), new Research(thermalGenerator), diff --git a/core/src/mindustry/entities/comp/MechComp.java b/core/src/mindustry/entities/comp/MechComp.java index 5e4f518653..eb78dd030d 100644 --- a/core/src/mindustry/entities/comp/MechComp.java +++ b/core/src/mindustry/entities/comp/MechComp.java @@ -23,7 +23,7 @@ abstract class MechComp implements Posc, Hitboxc, Unitc, Mechc, ElevationMovec{ @Override public void update(){ //trigger animation only when walking manually - if(walked || net.client()){ + if(walked || net.client() || isRemote()){ float len = deltaLen(); baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed / Time.delta) * Time.delta); walkTime += len; diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 4fc380d240..6edf52a2cc 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1492,7 +1492,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } protected void drawRebuildSelection(int x1, int y1, int x2, int y2){ - drawSelection(x1, y1, x2, y2, 0, Pal.sapBulletBack, Pal.sapBullet); + drawSelection(x1, y1, x2, y2, 0, Pal.sapBulletBack, Pal.sapBullet, false); NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, 0, 1f); @@ -1525,10 +1525,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength){ - drawSelection(x1, y1, x2, y2, maxLength, Pal.accentBack, Pal.accent); + drawSelection(x1, y1, x2, y2, maxLength, Pal.accentBack, Pal.accent, true); } - protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength, Color col1, Color col2){ + protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength, Color col1, Color col2, boolean withText){ NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, maxLength, 1f); Lines.stroke(2f); @@ -1538,27 +1538,30 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ Draw.color(col2); Lines.rect(result.x, result.y, result.x2 - result.x, result.y2 - result.y); - Font font = Fonts.outline; - font.setColor(col2); - var ints = font.usesIntegerPositions(); - font.setUseIntegerPositions(false); - var z = Draw.z(); - Draw.z(Layer.endPixeled); - font.getData().setScale(1 / renderer.camerascale); - var snapToCursor = Core.settings.getBool("selectionsizeoncursor"); - var textOffset = Core.settings.getInt("selectionsizeoncursoroffset", 5); - int width = (int)((result.x2 - result.x) / 8); - int height = (int)((result.y2 - result.y) / 8); - int area = width * height; - // FINISHME: When not snapping to cursor, perhaps it would be best to choose the corner closest to the cursor that's at least a block away? - font.draw(width + "x" + height + " (" + area + ")", - snapToCursor ? input.mouseWorldX() + textOffset * (4 / renderer.camerascale) : result.x2, - snapToCursor ? input.mouseWorldY() - textOffset * (4 / renderer.camerascale) : result.y - ); - font.setColor(Color.white); - font.getData().setScale(1); - font.setUseIntegerPositions(ints); - Draw.z(z); + if(withText){ + Font font = Fonts.outline; + font.setColor(col2); + var ints = font.usesIntegerPositions(); + font.setUseIntegerPositions(false); + var z = Draw.z(); + Draw.z(Layer.endPixeled); + font.getData().setScale(1 / renderer.camerascale); + var snapToCursor = Core.settings.getBool("selectionsizeoncursor"); + var textOffset = Core.settings.getInt("selectionsizeoncursoroffset", 5); + int width = (int)((result.x2 - result.x) / 8); + int height = (int)((result.y2 - result.y) / 8); + int area = width * height; + + // FINISHME: When not snapping to cursor, perhaps it would be best to choose the corner closest to the cursor that's at least a block away? + font.draw(width + "x" + height + " (" + area + ")", + snapToCursor ? input.mouseWorldX() + textOffset * (4 / renderer.camerascale) : result.x2, + snapToCursor ? input.mouseWorldY() - textOffset * (4 / renderer.camerascale) : result.y + ); + font.setColor(Color.white); + font.getData().setScale(1); + font.setUseIntegerPositions(ints); + Draw.z(z); + } } protected void flushSelectPlans(Seq plans){ diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 8a85973c23..92be92b76d 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -801,6 +801,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ head.image(Icon.warningSmall).update(i -> { i.color.set(Pal.accent).lerp(Pal.remove, Mathf.absin(Time.globalTime, 9f, 1f)); }).padRight(4f); + }else if(sec.preset != null && sec.preset.requireUnlock){ + head.image(sec.preset.uiIcon).size(iconSmall).padRight(4f); } String ic = sec.iconChar() == null ? "" : sec.iconChar() + " "; @@ -830,9 +832,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ } public Planet getHoverPlanet(float mouseX, float mouseY){ - // do not hover over things indefinitely Planet hoverPlanet = null; - // get nearest planet (DO NOT SELECT THROUGH selected planet) float nearest = Float.POSITIVE_INFINITY; for(Planet planet : content.planets()){ @@ -1163,7 +1163,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{ title.add().growX(); title.button(Icon.pencilSmall, Styles.clearNonei, () -> { - ui.showTextInput("@sectors.rename", "@name", 20, sector.name(), v -> { + ui.showTextInput("@sectors.rename", "@name", 32, sector.name(), v -> { sector.setName(v); updateSelected(); rebuildList();