Editor fixes
This commit is contained in:
@@ -1086,6 +1086,8 @@ content.status.name = Status Effects
|
|||||||
content.sector.name = Sectors
|
content.sector.name = Sectors
|
||||||
content.team.name = Factions
|
content.team.name = Factions
|
||||||
|
|
||||||
|
wallore = (Wall)
|
||||||
|
|
||||||
item.copper.name = Copper
|
item.copper.name = Copper
|
||||||
item.lead.name = Lead
|
item.lead.name = Lead
|
||||||
item.coal.name = Coal
|
item.coal.name = Coal
|
||||||
|
|||||||
@@ -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){
|
private void render(int wx, int wy){
|
||||||
int x = wx / chunkSize, y = wy / chunkSize;
|
int x = wx / chunkSize, y = wy / chunkSize;
|
||||||
IndexedRenderer mesh = chunks[x][y];
|
IndexedRenderer mesh = chunks[x][y];
|
||||||
@@ -98,6 +105,7 @@ public class MapRenderer implements Disposable{
|
|||||||
|
|
||||||
Team team = tile.team();
|
Team team = tile.team();
|
||||||
Block floor = tile.floor();
|
Block floor = tile.floor();
|
||||||
|
Block overlay = tile.overlay();
|
||||||
Block wall = tile.block();
|
Block wall = tile.block();
|
||||||
|
|
||||||
TextureRegion region;
|
TextureRegion region;
|
||||||
@@ -105,9 +113,11 @@ public class MapRenderer implements Disposable{
|
|||||||
int idxWall = (wx % chunkSize) + (wy % chunkSize) * chunkSize;
|
int idxWall = (wx % chunkSize) + (wy % chunkSize) * chunkSize;
|
||||||
int idxDecal = (wx % chunkSize) + (wy % chunkSize) * chunkSize + chunkSize * chunkSize;
|
int idxDecal = (wx % chunkSize) + (wy % chunkSize) * chunkSize + chunkSize * chunkSize;
|
||||||
boolean center = tile.isCenter();
|
boolean center = tile.isCenter();
|
||||||
|
boolean useSyntheticWall = wall.synthetic() || overlay instanceof WallOreBlock;
|
||||||
|
|
||||||
if(wall != Blocks.air && wall.synthetic()){
|
//draw synthetic wall or floor
|
||||||
region = !wall.editorIcon().found() || !center ? clearEditor : wall.editorIcon();
|
if(wall != Blocks.air && useSyntheticWall){
|
||||||
|
region = !center ? clearEditor : getIcon(wall, idxWall);
|
||||||
|
|
||||||
float width = region.width * Draw.scl, height = region.height * Draw.scl;
|
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;
|
float offsetX = -(wall.size / 3) * tilesize, offsetY = -(wall.size / 3) * tilesize;
|
||||||
|
|
||||||
|
//draw non-synthetic wall or ore
|
||||||
if((wall.update || wall.destructible) && center){
|
if((wall.update || wall.destructible) && center){
|
||||||
mesh.setColor(team.color);
|
mesh.setColor(team.color);
|
||||||
region = Core.atlas.find("block-border-editor");
|
region = Core.atlas.find("block-border-editor");
|
||||||
}else if(!wall.synthetic() && wall != Blocks.air && center){
|
}else if(!useSyntheticWall && wall != Blocks.air && center){
|
||||||
region = !wall.editorIcon().found() ?
|
region = getIcon(wall, idxWall);
|
||||||
clearEditor : wall.variants > 0 ?
|
|
||||||
wall.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, wall.editorVariantRegions().length - 1)] :
|
|
||||||
wall.editorIcon();
|
|
||||||
|
|
||||||
if(wall == Blocks.cliff){
|
if(wall == Blocks.cliff){
|
||||||
mesh.setColor(Tmp.c1.set(floor.mapColor).mul(1.6f));
|
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;
|
offsetX = tilesize / 2f - region.width / 2f * Draw.scl;
|
||||||
offsetY = tilesize / 2f - region.height / 2f * Draw.scl;
|
offsetY = tilesize / 2f - region.height / 2f * Draw.scl;
|
||||||
}else if(wall == Blocks.air && !tile.overlay().isAir()){
|
}else if((wall == Blocks.air || overlay instanceof WallOreBlock) && !overlay.isAir()){
|
||||||
region = tile.overlay().editorVariantRegions()[Mathf.randomSeed(idxWall, 0, tile.overlay().editorVariantRegions().length - 1)];
|
region = overlay.editorVariantRegions()[Mathf.randomSeed(idxWall, 0, tile.overlay().editorVariantRegions().length - 1)];
|
||||||
}else{
|
}else{
|
||||||
region = clearEditor;
|
region = clearEditor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,7 +223,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO test, different placement
|
//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;
|
block = Blocks.crystalBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ public class SteamVent extends Floor{
|
|||||||
public SteamVent(String name){
|
public SteamVent(String name){
|
||||||
super(name);
|
super(name);
|
||||||
variants = 2;
|
variants = 2;
|
||||||
inEditor = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.environment;
|
package mindustry.world.blocks.environment;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
/**An overlay ore that draws on top of walls. */
|
/**An overlay ore that draws on top of walls. */
|
||||||
@@ -13,4 +14,11 @@ public class WallOreBlock extends OreBlock{
|
|||||||
public WallOreBlock(String name){
|
public WallOreBlock(String name){
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(){
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
this.localizedName = this.localizedName + " " + Core.bundle.get("wallore");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user