diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index e098f93605..460b756db0 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1086,6 +1086,8 @@ content.status.name = Status Effects content.sector.name = Sectors content.team.name = Factions +wallore = (Wall) + item.copper.name = Copper item.lead.name = Lead item.coal.name = Coal diff --git a/core/src/mindustry/editor/MapRenderer.java b/core/src/mindustry/editor/MapRenderer.java index 535ef0eed5..bc982112d1 100644 --- a/core/src/mindustry/editor/MapRenderer.java +++ b/core/src/mindustry/editor/MapRenderer.java @@ -91,6 +91,13 @@ public class MapRenderer implements Disposable{ } } + private TextureRegion getIcon(Block wall, int index){ + return !wall.editorIcon().found() ? + clearEditor : wall.variants > 0 ? + wall.editorVariantRegions()[Mathf.randomSeed(index, 0, wall.editorVariantRegions().length - 1)] : + wall.editorIcon(); + } + private void render(int wx, int wy){ int x = wx / chunkSize, y = wy / chunkSize; IndexedRenderer mesh = chunks[x][y]; @@ -98,6 +105,7 @@ public class MapRenderer implements Disposable{ Team team = tile.team(); Block floor = tile.floor(); + Block overlay = tile.overlay(); Block wall = tile.block(); TextureRegion region; @@ -105,9 +113,11 @@ public class MapRenderer implements Disposable{ int idxWall = (wx % chunkSize) + (wy % chunkSize) * chunkSize; int idxDecal = (wx % chunkSize) + (wy % chunkSize) * chunkSize + chunkSize * chunkSize; boolean center = tile.isCenter(); + boolean useSyntheticWall = wall.synthetic() || overlay instanceof WallOreBlock; - if(wall != Blocks.air && wall.synthetic()){ - region = !wall.editorIcon().found() || !center ? clearEditor : wall.editorIcon(); + //draw synthetic wall or floor + if(wall != Blocks.air && useSyntheticWall){ + region = !center ? clearEditor : getIcon(wall, idxWall); float width = region.width * Draw.scl, height = region.height * Draw.scl; @@ -124,14 +134,12 @@ public class MapRenderer implements Disposable{ float offsetX = -(wall.size / 3) * tilesize, offsetY = -(wall.size / 3) * tilesize; + //draw non-synthetic wall or ore if((wall.update || wall.destructible) && center){ mesh.setColor(team.color); region = Core.atlas.find("block-border-editor"); - }else if(!wall.synthetic() && wall != Blocks.air && center){ - region = !wall.editorIcon().found() ? - clearEditor : wall.variants > 0 ? - wall.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, wall.editorVariantRegions().length - 1)] : - wall.editorIcon(); + }else if(!useSyntheticWall && wall != Blocks.air && center){ + region = getIcon(wall, idxWall); if(wall == Blocks.cliff){ mesh.setColor(Tmp.c1.set(floor.mapColor).mul(1.6f)); @@ -140,8 +148,8 @@ public class MapRenderer implements Disposable{ offsetX = tilesize / 2f - region.width / 2f * Draw.scl; offsetY = tilesize / 2f - region.height / 2f * Draw.scl; - }else if(wall == Blocks.air && !tile.overlay().isAir()){ - region = tile.overlay().editorVariantRegions()[Mathf.randomSeed(idxWall, 0, tile.overlay().editorVariantRegions().length - 1)]; + }else if((wall == Blocks.air || overlay instanceof WallOreBlock) && !overlay.isAir()){ + region = overlay.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, tile.overlay().editorVariantRegions().length - 1)]; }else{ region = clearEditor; } diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index de9e7dc7e7..db6da5071a 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -223,7 +223,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{ } //TODO test, different placement - if(block == Blocks.regolithWall && rand.chance(0.16) && nearAir(x, y) && !near(x, y, 3, Blocks.crystalBlocks)){ + //TODO this biome should have more blocks in gneeral + if(block == Blocks.regolithWall && rand.chance(0.2) && nearAir(x, y) && !near(x, y, 3, Blocks.crystalBlocks)){ block = Blocks.crystalBlocks; } diff --git a/core/src/mindustry/world/blocks/environment/SteamVent.java b/core/src/mindustry/world/blocks/environment/SteamVent.java index 067fcc7dae..9daf441842 100644 --- a/core/src/mindustry/world/blocks/environment/SteamVent.java +++ b/core/src/mindustry/world/blocks/environment/SteamVent.java @@ -38,7 +38,6 @@ public class SteamVent extends Floor{ public SteamVent(String name){ super(name); variants = 2; - inEditor = false; } @Override diff --git a/core/src/mindustry/world/blocks/environment/WallOreBlock.java b/core/src/mindustry/world/blocks/environment/WallOreBlock.java index 9bcb4b6d6a..d839fc1b95 100644 --- a/core/src/mindustry/world/blocks/environment/WallOreBlock.java +++ b/core/src/mindustry/world/blocks/environment/WallOreBlock.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.environment; +import arc.*; import mindustry.type.*; /**An overlay ore that draws on top of walls. */ @@ -13,4 +14,11 @@ public class WallOreBlock extends OreBlock{ public WallOreBlock(String name){ super(name); } + + @Override + public void init(){ + super.init(); + + this.localizedName = this.localizedName + " " + Core.bundle.get("wallore"); + } }