diff --git a/core/assets-raw/sprites/blocks/environment/metal-floor-3.png b/core/assets-raw/sprites/blocks/environment/metal-floor-3.png index 7fbb9243b4..8b87059487 100644 Binary files a/core/assets-raw/sprites/blocks/environment/metal-floor-3.png and b/core/assets-raw/sprites/blocks/environment/metal-floor-3.png differ diff --git a/core/assets-raw/sprites/blocks/environment/tar.png b/core/assets-raw/sprites/blocks/environment/tar.png index 8ad3f8ec68..d959f6df4b 100644 Binary files a/core/assets-raw/sprites/blocks/environment/tar.png and b/core/assets-raw/sprites/blocks/environment/tar.png differ diff --git a/core/assets/shaders/mud.frag b/core/assets/shaders/mud.frag index 6b6ba8cac6..ffcd60a44d 100644 --- a/core/assets/shaders/mud.frag +++ b/core/assets/shaders/mud.frag @@ -15,7 +15,7 @@ void main(){ vec2 c = v_texCoords.xy; vec2 coords = vec2(c.x * u_resolution.x + u_campos.x, c.y * u_resolution.y + u_campos.y); - float btime = u_time / 8000000.0; + float btime = u_time / 7000000.0; float noise = sin((texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.9, 0.8)).r + texture2D(u_noise, (coords) / NSCALE + vec2(abs(sin(btime)) * 1.1) * vec2(-0.8, -1.0)).r) / 2.0); vec4 color = texture2D(u_texture, c); diff --git a/core/assets/shaders/slag.frag b/core/assets/shaders/slag.frag index 2dae9dc45c..f904d48dbf 100755 --- a/core/assets/shaders/slag.frag +++ b/core/assets/shaders/slag.frag @@ -22,12 +22,10 @@ void main(){ float noise = (texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.9, 0.8)).r + texture2D(u_noise, (coords) / NSCALE + vec2(btime * 1.1) * vec2(0.8, -1.0)).r) / 2.0; vec4 color = texture2D(u_texture, c); - if(color.a > 0.1){ - if(noise > 0.6){ - color.rgb = S2; - }else if (noise > 0.54){ - color.rgb = S1; - } + if(noise > 0.6){ + color.rgb = S2; + }else if (noise > 0.54){ + color.rgb = S1; } gl_FragColor = color; diff --git a/core/assets/shaders/tar.frag b/core/assets/shaders/tar.frag index 39b0c27492..ea2a3b3f1d 100644 --- a/core/assets/shaders/tar.frag +++ b/core/assets/shaders/tar.frag @@ -20,7 +20,7 @@ void main(){ vec4 color = texture2D(u_texture, c); if(!(noise > 0.54 && noise < 0.58)){ - color.rgb *= 0.6; + color.rgb *= vec3(0.6, 0.6, 0.7); } gl_FragColor = color; diff --git a/core/assets/sprites/block_colors.png b/core/assets/sprites/block_colors.png index 17c56fe410..d1ac03356d 100644 Binary files a/core/assets/sprites/block_colors.png and b/core/assets/sprites/block_colors.png differ diff --git a/core/assets/sprites/fallback/sprites.atlas b/core/assets/sprites/fallback/sprites.atlas index 2cef0431f4..50fb0095a6 100644 --- a/core/assets/sprites/fallback/sprites.atlas +++ b/core/assets/sprites/fallback/sprites.atlas @@ -1039,6 +1039,13 @@ toxopid-cannon-outline orig: 206, 220 offset: 0, 0 index: -1 +toxopid-leg + rotate: false + xy: 1, 1 + size: 150, 72 + orig: 150, 72 + offset: 0, 0 + index: -1 toxopid-outline rotate: false xy: 648, 895 @@ -1235,13 +1242,6 @@ toxopid-cell orig: 152, 124 offset: 0, 0 index: -1 -toxopid-leg - rotate: false - xy: 1, 1 - size: 150, 72 - orig: 150, 72 - offset: 0, 0 - index: -1 omura-cannon rotate: false xy: 847, 1148 @@ -3768,6 +3768,13 @@ arkyid-joint-base orig: 70, 70 offset: 0, 0 index: -1 +arkyid-leg + rotate: false + xy: 621, 605 + size: 56, 56 + orig: 56, 56 + offset: 0, 0 + index: -1 arkyid-leg-base rotate: false xy: 473, 1982 @@ -3803,6 +3810,13 @@ atrax-joint orig: 26, 26 offset: 0, 0 index: -1 +atrax-leg + rotate: false + xy: 553, 10 + size: 36, 26 + orig: 36, 26 + offset: 0, 0 + index: -1 atrax-leg-base rotate: false xy: 1687, 1523 @@ -6120,6 +6134,13 @@ spiroct-joint orig: 32, 32 offset: 0, 0 index: -1 +spiroct-leg + rotate: false + xy: 507, 1848 + size: 48, 34 + orig: 48, 34 + offset: 0, 0 + index: -1 spiroct-leg-base rotate: false xy: 1941, 1650 @@ -6624,13 +6645,6 @@ alpha-cell orig: 48, 48 offset: 0, 0 index: -1 -arkyid-leg - rotate: false - xy: 621, 605 - size: 56, 56 - orig: 56, 56 - offset: 0, 0 - index: -1 atrax rotate: false xy: 1, 9 @@ -6652,13 +6666,6 @@ atrax-cell orig: 88, 64 offset: 0, 0 index: -1 -atrax-leg - rotate: false - xy: 553, 10 - size: 36, 26 - orig: 36, 26 - offset: 0, 0 - index: -1 beta rotate: false xy: 141, 6 @@ -6932,13 +6939,6 @@ spiroct-cell orig: 94, 75 offset: 0, 0 index: -1 -spiroct-leg - rotate: false - xy: 507, 1848 - size: 48, 34 - orig: 48, 34 - offset: 0, 0 - index: -1 vanguard rotate: false xy: 929, 463 diff --git a/core/assets/sprites/fallback/sprites2.png b/core/assets/sprites/fallback/sprites2.png index 8bf8a9d54e..38e9ca8235 100644 Binary files a/core/assets/sprites/fallback/sprites2.png and b/core/assets/sprites/fallback/sprites2.png differ diff --git a/core/assets/sprites/fallback/sprites3.png b/core/assets/sprites/fallback/sprites3.png index 515cd7a25d..7beadf88e1 100644 Binary files a/core/assets/sprites/fallback/sprites3.png and b/core/assets/sprites/fallback/sprites3.png differ diff --git a/core/assets/sprites/fallback/sprites4.png b/core/assets/sprites/fallback/sprites4.png index 84c3812f0b..ad959ac194 100644 Binary files a/core/assets/sprites/fallback/sprites4.png and b/core/assets/sprites/fallback/sprites4.png differ diff --git a/core/assets/sprites/fallback/sprites5.png b/core/assets/sprites/fallback/sprites5.png index 0a93548325..d91bb18dbd 100644 Binary files a/core/assets/sprites/fallback/sprites5.png and b/core/assets/sprites/fallback/sprites5.png differ diff --git a/core/assets/sprites/fallback/sprites6.png b/core/assets/sprites/fallback/sprites6.png index 982d12207a..d95d22c909 100644 Binary files a/core/assets/sprites/fallback/sprites6.png and b/core/assets/sprites/fallback/sprites6.png differ diff --git a/core/assets/sprites/fallback/sprites7.png b/core/assets/sprites/fallback/sprites7.png index 01e028eb12..b1c5af9d48 100644 Binary files a/core/assets/sprites/fallback/sprites7.png and b/core/assets/sprites/fallback/sprites7.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index e5dbe2aaa7..188321868d 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -2811,6 +2811,13 @@ arkyid-joint-base orig: 70, 70 offset: 0, 0 index: -1 +arkyid-leg + rotate: false + xy: 1123, 98 + size: 56, 56 + orig: 56, 56 + offset: 0, 0 + index: -1 arkyid-leg-base rotate: false xy: 3991, 3641 @@ -2874,6 +2881,13 @@ atrax-joint orig: 26, 26 offset: 0, 0 index: -1 +atrax-leg + rotate: false + xy: 356, 3747 + size: 36, 26 + orig: 36, 26 + offset: 0, 0 + index: -1 atrax-leg-base rotate: false xy: 3113, 2975 @@ -5821,6 +5835,13 @@ spiroct-joint orig: 32, 32 offset: 0, 0 index: -1 +spiroct-leg + rotate: false + xy: 1098, 1191 + size: 48, 34 + orig: 48, 34 + offset: 0, 0 + index: -1 spiroct-leg-base rotate: false xy: 1871, 3107 @@ -5975,6 +5996,13 @@ toxopid-joint-base orig: 70, 70 offset: 0, 0 index: -1 +toxopid-leg + rotate: false + xy: 3215, 3507 + size: 150, 72 + orig: 150, 72 + offset: 0, 0 + index: -1 toxopid-leg-base rotate: false xy: 1, 331 @@ -6458,13 +6486,6 @@ arkyid-cell orig: 128, 128 offset: 0, 0 index: -1 -arkyid-leg - rotate: false - xy: 1123, 98 - size: 56, 56 - orig: 56, 56 - offset: 0, 0 - index: -1 atrax rotate: false xy: 1, 7 @@ -6486,13 +6507,6 @@ atrax-cell orig: 88, 64 offset: 0, 0 index: -1 -atrax-leg - rotate: false - xy: 356, 3747 - size: 36, 26 - orig: 36, 26 - offset: 0, 0 - index: -1 beta rotate: false xy: 1459, 778 @@ -6878,13 +6892,6 @@ spiroct-cell orig: 94, 75 offset: 0, 0 index: -1 -spiroct-leg - rotate: false - xy: 1098, 1191 - size: 48, 34 - orig: 48, 34 - offset: 0, 0 - index: -1 toxopid rotate: false xy: 1229, 2530 @@ -6906,13 +6913,6 @@ toxopid-cell orig: 152, 124 offset: 0, 0 index: -1 -toxopid-leg - rotate: false - xy: 3215, 3507 - size: 150, 72 - orig: 150, 72 - offset: 0, 0 - index: -1 vanguard rotate: false xy: 4011, 3163 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index e6514bf997..5c51429460 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/sprites/sprites2.png b/core/assets/sprites/sprites2.png index 2315c5d8f1..f6820250cb 100644 Binary files a/core/assets/sprites/sprites2.png and b/core/assets/sprites/sprites2.png differ diff --git a/core/assets/sprites/sprites3.png b/core/assets/sprites/sprites3.png index 1f1833da5b..736a0099c1 100644 Binary files a/core/assets/sprites/sprites3.png and b/core/assets/sprites/sprites3.png differ diff --git a/core/assets/sprites/sprites4.png b/core/assets/sprites/sprites4.png index 3bdd8003e7..6664394784 100644 Binary files a/core/assets/sprites/sprites4.png and b/core/assets/sprites/sprites4.png differ diff --git a/core/assets/sprites/sprites5.png b/core/assets/sprites/sprites5.png index fdb672e2be..587ec1281e 100644 Binary files a/core/assets/sprites/sprites5.png and b/core/assets/sprites/sprites5.png differ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index fbcbfa4553..dd68cf2990 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -1010,6 +1010,7 @@ public class UnitTypes implements ContentList{ abilities.add(new HealFieldAbility(5f, 60f * 5, 50f)); weapons.add(new Weapon("heal-weapon-mount"){{ + top = false; y = -2.5f; x = 3.5f; reload = 30f; diff --git a/core/src/mindustry/editor/DrawOperation.java b/core/src/mindustry/editor/DrawOperation.java index 77162fe2a5..e63c2f3a6b 100755 --- a/core/src/mindustry/editor/DrawOperation.java +++ b/core/src/mindustry/editor/DrawOperation.java @@ -64,8 +64,12 @@ public class DrawOperation{ if(type == OpType.floor.ordinal()){ tile.setFloor((Floor)content.block(to)); }else if(type == OpType.block.ordinal()){ + tile.getLinkedTiles(t -> editor.renderer.updatePoint(t.x, t.y)); + Block block = content.block(to); tile.setBlock(block, tile.team(), tile.build == null ? 0 : tile.build.rotation); + + tile.getLinkedTiles(t -> editor.renderer.updatePoint(t.x, t.y)); }else if(type == OpType.rotation.ordinal()){ if(tile.build != null) tile.build.rotation = to; }else if(type == OpType.team.ordinal()){ @@ -74,7 +78,7 @@ public class DrawOperation{ tile.setOverlayID(to); } }); - editor.renderer().updatePoint(tile.x, tile.y); + editor.renderer.updatePoint(tile.x, tile.y); } @Struct diff --git a/core/src/mindustry/editor/EditorTile.java b/core/src/mindustry/editor/EditorTile.java index 63803d5db8..1098e463d3 100644 --- a/core/src/mindustry/editor/EditorTile.java +++ b/core/src/mindustry/editor/EditorTile.java @@ -46,14 +46,14 @@ public class EditorTile extends Tile{ return; } - //if(this.block == type && (build == null || build.rotation == rotation)){ - // ui.editor.editor.renderer().updatePoint(x, y); - // return; - //} + if(this.block == type && (build == null || build.rotation == rotation)){ + update(); + return; + } - if(rotation != 0) op(OpType.rotation, (byte)rotation); - if(team() != Team.derelict) op(OpType.team, (byte)team().id); op(OpType.block, block.id); + if(rotation != 0) op(OpType.rotation, (byte)rotation); + if(team != Team.derelict) op(OpType.team, (byte)team.id); super.setBlock(type, team, rotation); } @@ -87,7 +87,7 @@ public class EditorTile extends Tile{ if(skip()){ super.fireChanged(); }else{ - ui.editor.editor.renderer().updatePoint(x, y); + update(); } } @@ -121,6 +121,10 @@ public class EditorTile extends Tile{ } } + private void update(){ + ui.editor.editor.renderer.updatePoint(x, y); + } + private boolean skip(){ return state.isGame() || ui.editor.editor.isLoading(); } diff --git a/core/src/mindustry/editor/MapEditor.java b/core/src/mindustry/editor/MapEditor.java index 14325e94d8..49d174779b 100644 --- a/core/src/mindustry/editor/MapEditor.java +++ b/core/src/mindustry/editor/MapEditor.java @@ -18,10 +18,10 @@ import static mindustry.Vars.*; public class MapEditor{ public static final int[] brushSizes = {1, 2, 3, 4, 5, 9, 15, 20}; - private final Context context = new Context(); - private StringMap tags = new StringMap(); - private MapRenderer renderer = new MapRenderer(this); + public StringMap tags = new StringMap(); + public MapRenderer renderer = new MapRenderer(this); + private final Context context = new Context(); private OperationStack stack = new OperationStack(); private DrawOperation currentOp; private boolean loading; @@ -35,10 +35,6 @@ public class MapEditor{ return loading; } - public StringMap getTags(){ - return tags; - } - public void beginEdit(int width, int height){ reset(); @@ -214,10 +210,6 @@ public class MapEditor{ } } - public MapRenderer renderer(){ - return renderer; - } - public void resize(int width, int height){ clearOp(); diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index 0cf8477691..353e39fcf8 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -116,9 +116,9 @@ public class MapEditorDialog extends Dialog implements Disposable{ t.button("@editor.export", Icon.upload, () -> createDialog("@editor.export", "@editor.exportfile", "@editor.exportfile.description", Icon.file, - (Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), mapExtension, file -> MapIO.writeMap(file, editor.createMap(file))), + (Runnable)() -> platform.export(editor.tags.get("name", "unknown"), mapExtension, file -> MapIO.writeMap(file, editor.createMap(file))), "@editor.exportimage", "@editor.exportimage.description", Icon.fileImage, - (Runnable)() -> platform.export(editor.getTags().get("name", "unknown"), "png", file -> { + (Runnable)() -> platform.export(editor.tags.get("name", "unknown"), "png", file -> { Pixmap out = MapIO.writeImage(editor.tiles()); file.writePNG(out); out.dispose(); @@ -129,16 +129,16 @@ public class MapEditorDialog extends Dialog implements Disposable{ if(steam){ menu.cont.button("@editor.publish.workshop", Icon.link, () -> { - Map builtin = maps.all().find(m -> m.name().equals(editor.getTags().get("name", "").trim())); + Map builtin = maps.all().find(m -> m.name().equals(editor.tags.get("name", "").trim())); - if(editor.getTags().containsKey("steamid") && builtin != null && !builtin.custom){ - platform.viewListingID(editor.getTags().get("steamid")); + if(editor.tags.containsKey("steamid") && builtin != null && !builtin.custom){ + platform.viewListingID(editor.tags.get("steamid")); return; } Map map = save(); - if(editor.getTags().containsKey("steamid") && map != null){ + if(editor.tags.containsKey("steamid") && map != null){ platform.viewListing(map); return; } @@ -156,7 +156,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ } platform.publish(map); - }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.getTags().containsKey("steamid") ? editor.getTags().get("author").equals(player.name) ? "@workshop.listing" : "@view.workshop" : "@editor.publish.workshop")); + }).padTop(-3).size(swidth * 2f + 10, 60f).update(b -> b.setText(editor.tags.containsKey("steamid") ? editor.tags.get("author").equals(player.name) ? "@workshop.listing" : "@view.workshop" : "@editor.publish.workshop")); menu.cont.row(); } @@ -235,7 +235,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ state.rules = (lastSavedRules == null ? new Rules() : lastSavedRules); lastSavedRules = null; saved = false; - editor.renderer().updateAll(); + editor.renderer.updateAll(); } private void playtest(){ @@ -264,10 +264,10 @@ public class MapEditorDialog extends Dialog implements Disposable{ public @Nullable Map save(){ boolean isEditor = state.rules.editor; state.rules.editor = false; - String name = editor.getTags().get("name", "").trim(); - editor.getTags().put("rules", JsonIO.write(state.rules)); - editor.getTags().remove("width"); - editor.getTags().remove("height"); + String name = editor.tags.get("name", "").trim(); + editor.tags.put("rules", JsonIO.write(state.rules)); + editor.tags.remove("width"); + editor.tags.remove("height"); player.clearUnit(); @@ -281,7 +281,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ if(map != null && !map.custom){ handleSaveBuiltin(map); }else{ - returned = maps.saveMap(editor.getTags()); + returned = maps.saveMap(editor.tags); ui.showInfoFade("@editor.saved"); } } @@ -352,7 +352,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ @Override public void dispose(){ - editor.renderer().dispose(); + editor.renderer.dispose(); } public void beginEditMap(Fi file){ @@ -614,12 +614,12 @@ public class MapEditorDialog extends Dialog implements Disposable{ Tile tile = editor.tile(x, y); if(tile.block().breakable && tile.block() instanceof Boulder){ tile.setBlock(Blocks.air); - editor.renderer().updatePoint(x, y); + editor.renderer.updatePoint(x, y); } if(tile.overlay() != Blocks.air && tile.overlay() != Blocks.spawn){ tile.setOverlay(Blocks.air); - editor.renderer().updatePoint(x, y); + editor.renderer.updatePoint(x, y); } } } diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index a8ceb58d79..472a20dee0 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -144,7 +144,7 @@ public class MapGenerateDialog extends BaseDialog{ } //reset undo stack as generation... messes things up - editor.renderer().updateAll(); + editor.renderer.updateAll(); editor.clearOp(); } diff --git a/core/src/mindustry/editor/MapInfoDialog.java b/core/src/mindustry/editor/MapInfoDialog.java index 9e217c335f..c46e06f36d 100644 --- a/core/src/mindustry/editor/MapInfoDialog.java +++ b/core/src/mindustry/editor/MapInfoDialog.java @@ -29,7 +29,7 @@ public class MapInfoDialog extends BaseDialog{ private void setup(){ cont.clear(); - ObjectMap tags = editor.getTags(); + ObjectMap tags = editor.tags; cont.pane(t -> { t.add("@editor.mapname").padRight(8).left(); @@ -73,8 +73,8 @@ public class MapInfoDialog extends BaseDialog{ t.row(); t.add("@editor.generation").padRight(8).left(); t.button("@edit", () -> { - generate.show(Vars.maps.readFilters(editor.getTags().get("genfilters", "")), - filters -> editor.getTags().put("genfilters", JsonIO.write(filters))); + generate.show(Vars.maps.readFilters(editor.tags.get("genfilters", "")), + filters -> editor.tags.put("genfilters", JsonIO.write(filters))); hide(); }).left().width(200f); diff --git a/core/src/mindustry/editor/MapView.java b/core/src/mindustry/editor/MapView.java index f3ce2f6630..21e659ae1b 100644 --- a/core/src/mindustry/editor/MapView.java +++ b/core/src/mindustry/editor/MapView.java @@ -248,7 +248,7 @@ public class MapView extends Element implements GestureListener{ Draw.color(Pal.remove); Lines.stroke(2f); Lines.rect(centerx - sclwidth / 2 - 1, centery - sclheight / 2 - 1, sclwidth + 2, sclheight + 2); - editor.renderer().draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight); + editor.renderer.draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight); Draw.reset(); if(grid){ diff --git a/core/src/mindustry/entities/Units.java b/core/src/mindustry/entities/Units.java index 6460e9ce8d..95ca278bbd 100644 --- a/core/src/mindustry/entities/Units.java +++ b/core/src/mindustry/entities/Units.java @@ -1,5 +1,6 @@ package mindustry.entities; +import arc.*; import arc.func.*; import arc.math.geom.*; import mindustry.annotations.Annotations.*; @@ -18,6 +19,15 @@ public class Units{ private static float cdist; private static boolean boolResult; + @Remote(called = Loc.server) + public static void unitCapDeath(Unit unit){ + if(unit != null){ + unit.dead = true; + Fx.unitCapKill.at(unit); + Core.app.post(() -> Call.unitDeath(unit.id)); + } + } + @Remote(called = Loc.server) public static void unitDeath(int uid){ Unit unit = Groups.unit.getByID(uid); diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index e6e5b07acd..b13f13cac8 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -209,6 +209,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I //check if over unit cap if(count() > cap() && !spawnedByCore){ deactivated = true; + + if(!dead){ + Call.unitCapDeath(self()); + } }else{ teamIndex.updateActiveCount(team, type, 1); } @@ -245,6 +249,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I a.update(self()); } } + }else if(!dead){ + Call.unitCapDeath(self()); } drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f); diff --git a/core/src/mindustry/graphics/FloorRenderer.java b/core/src/mindustry/graphics/FloorRenderer.java index 26816b08d0..3598a0ad09 100644 --- a/core/src/mindustry/graphics/FloorRenderer.java +++ b/core/src/mindustry/graphics/FloorRenderer.java @@ -210,8 +210,8 @@ public class FloorRenderer implements Disposable{ tile.block().drawBase(tile); }else if(floor.cacheLayer == layer && (world.isAccessible(tile.x, tile.y) || tile.block().cacheLayer != CacheLayer.walls || !tile.block().fillsTile)){ floor.drawBase(tile); - }else if(floor.cacheLayer.ordinal() < layer.ordinal() && layer != CacheLayer.walls){ - floor.drawNonLayer(tile); + }else if(floor.cacheLayer != layer && layer != CacheLayer.walls){ + floor.drawNonLayer(tile, layer); } } } diff --git a/core/src/mindustry/maps/Map.java b/core/src/mindustry/maps/Map.java index c5237178b3..ebf2896e0e 100644 --- a/core/src/mindustry/maps/Map.java +++ b/core/src/mindustry/maps/Map.java @@ -146,7 +146,7 @@ public class Map implements Comparable, Publishable{ public void addSteamID(String id){ tags.put("steamid", id); - ui.editor.editor.getTags().put("steamid", id); + ui.editor.editor.tags.put("steamid", id); try{ ui.editor.save(); }catch(Exception e){ @@ -159,7 +159,7 @@ public class Map implements Comparable, Publishable{ public void removeSteamID(){ tags.remove("steamid"); - ui.editor.editor.getTags().remove("steamid"); + ui.editor.editor.tags.remove("steamid"); try{ ui.editor.save(); }catch(Exception e){ @@ -203,7 +203,7 @@ public class Map implements Comparable, Publishable{ @Override public boolean prePublish(){ tags.put("author", player.name); - ui.editor.editor.getTags().put("author", tags.get("author")); + ui.editor.editor.tags.put("author", tags.get("author")); ui.editor.save(); return true; diff --git a/core/src/mindustry/ui/dialogs/MapsDialog.java b/core/src/mindustry/ui/dialogs/MapsDialog.java index 24b1cf3609..c03c01e799 100644 --- a/core/src/mindustry/ui/dialogs/MapsDialog.java +++ b/core/src/mindustry/ui/dialogs/MapsDialog.java @@ -54,7 +54,7 @@ public class MapsDialog extends BaseDialog{ Runnable show = () -> ui.loadAnd(() -> { hide(); ui.editor.show(); - ui.editor.editor.getTags().put("name", text); + ui.editor.editor.tags.put("name", text); Events.fire(new MapMakeEvent()); }); diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index 6640613779..2ac5e933cf 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -67,7 +67,7 @@ public class Floor extends Block{ protected TextureRegion[][] edges; protected Seq blenders = new Seq<>(); - protected IntSet blended = new IntSet(); + protected Bits blended = new Bits(256); protected TextureRegion edgeRegion; public Floor(String name){ @@ -170,30 +170,43 @@ public class Floor extends Block{ return drownTime > 0; } - public void drawNonLayer(Tile tile){ + public void drawNonLayer(Tile tile, CacheLayer layer){ Mathf.rand.setSeed(tile.pos()); - drawEdges(tile, true); - } - - protected void drawEdges(Tile tile){ - drawEdges(tile, false); - } - - protected void drawEdges(Tile tile, boolean sameLayer){ blenders.clear(); blended.clear(); for(int i = 0; i < 8; i++){ Point2 point = Geometry.d8[i]; Tile other = tile.getNearby(point); - if(other != null && doEdge(other.floor(), sameLayer) && other.floor().edges() != null){ - if(blended.add(other.floor().id)){ + if(other != null && other.floor().cacheLayer == layer && other.floor().edges() != null){ + if(!blended.getAndSet(other.floor().id)){ blenders.add(other.floor()); } } } + drawBlended(tile); + } + + protected void drawEdges(Tile tile){ + blenders.clear(); + blended.clear(); + + for(int i = 0; i < 8; i++){ + Point2 point = Geometry.d8[i]; + Tile other = tile.getNearby(point); + if(other != null && doEdge(other.floor()) && other.floor().cacheLayer == cacheLayer && other.floor().edges() != null){ + if(!blended.getAndSet(other.floor().id)){ + blenders.add(other.floor()); + } + } + } + + drawBlended(tile); + } + + protected void drawBlended(Tile tile){ blenders.sort(a -> a.id); for(Block block : blenders){ @@ -201,23 +214,18 @@ public class Floor extends Block{ Point2 point = Geometry.d8[i]; Tile other = tile.getNearby(point); if(other != null && other.floor() == block){ - TextureRegion region = edge((Floor)block, 2 - (point.x + 1), 2 - (point.y + 1)); + TextureRegion region = edge((Floor)block, 1 - point.x, 1 - point.y); Draw.rect(region, tile.worldx(), tile.worldy()); - - if(!sameLayer && block.cacheLayer.ordinal() > cacheLayer.ordinal()){ - Draw.rect(block.variantRegions()[0], tile.worldx() + point.x*tilesize, tile.worldy() + point.y*tilesize); - } } } } - } //'new' style of edges with shadows instead of colors, not used currently protected void drawEdgesFlat(Tile tile, boolean sameLayer){ for(int i = 0; i < 4; i++){ Tile other = tile.getNearby(i); - if(other != null && doEdge(other.floor(), sameLayer)){ + if(other != null && doEdge(other.floor())){ Color color = other.floor().mapColor; Draw.color(color.r, color.g, color.b, 1f); Draw.rect(edgeRegion, tile.worldx(), tile.worldy(), i*90); @@ -231,8 +239,8 @@ public class Floor extends Block{ return ((Floor)blendGroup).edges; } - protected boolean doEdge(Floor other, boolean sameLayer){ - return (((other.blendGroup.id > blendGroup.id) || edges() == null) && (other.cacheLayer.ordinal() > this.cacheLayer.ordinal() || !sameLayer)); + protected boolean doEdge(Floor other){ + return other.blendGroup.id > blendGroup.id || edges() == null; } TextureRegion edge(Floor block, int x, int y){ diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 926c57663f..3f09c262ee 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -338,6 +338,7 @@ public class Generators{ outliner.get(type.footRegion); outliner.get(type.legBaseRegion); outliner.get(type.baseJointRegion); + if(type.constructor.get() instanceof Legsc) outliner.get(type.legRegion); Image image = ImagePacker.get(type.region);