Shadows under blocks in minimap
This commit is contained in:
@@ -2384,7 +2384,7 @@ public class Blocks{
|
|||||||
plasmaBore = new BeamDrill("plasma-bore"){{
|
plasmaBore = new BeamDrill("plasma-bore"){{
|
||||||
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 30));
|
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 30));
|
||||||
consumes.power(0.15f);
|
consumes.power(0.15f);
|
||||||
drillTime = 150f;
|
drillTime = 160f;
|
||||||
tier = 4;
|
tier = 4;
|
||||||
size = 2;
|
size = 2;
|
||||||
range = 4;
|
range = 4;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import arc.scene.ui.layout.*;
|
|||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.pooling.*;
|
import arc.util.pooling.*;
|
||||||
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
@@ -37,6 +38,24 @@ public class MinimapRenderer{
|
|||||||
//TODO don't update when the minimap is off?
|
//TODO don't update when the minimap is off?
|
||||||
if(!ui.editor.isShown()){
|
if(!ui.editor.isShown()){
|
||||||
update(event.tile);
|
update(event.tile);
|
||||||
|
|
||||||
|
//update floor below block.
|
||||||
|
if(event.tile.block().solid && event.tile.y > 0){
|
||||||
|
Tile tile = world.tile(event.tile.x, event.tile.y - 1);
|
||||||
|
if(tile.block() == Blocks.air){
|
||||||
|
update(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Events.on(TilePreChangeEvent.class, e -> {
|
||||||
|
//update floor below a *recently removed* block.
|
||||||
|
if(e.tile.block().solid && e.tile.y > 0){
|
||||||
|
Tile tile = world.tile(e.tile.x, e.tile.y - 1);
|
||||||
|
if(tile.block() == Blocks.air){
|
||||||
|
Core.app.post(() -> update(tile));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -205,6 +224,10 @@ public class MinimapRenderer{
|
|||||||
Color color = Tmp.c1.set(bc == 0 ? MapIO.colorFor(tile.block(), tile.floor(), tile.overlay(), tile.team()) : bc);
|
Color color = Tmp.c1.set(bc == 0 ? MapIO.colorFor(tile.block(), tile.floor(), tile.overlay(), tile.team()) : bc);
|
||||||
color.mul(1f - Mathf.clamp(world.getDarkness(tile.x, tile.y) / 4f));
|
color.mul(1f - Mathf.clamp(world.getDarkness(tile.x, tile.y) / 4f));
|
||||||
|
|
||||||
|
if(tile.block() == Blocks.air && tile.y < world.height() - 1 && world.tile(tile.x, tile.y + 1).block().solid){
|
||||||
|
color.mul(0.7f);
|
||||||
|
}
|
||||||
|
|
||||||
return color.rgba();
|
return color.rgba();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public class MapIO{
|
|||||||
if(wall.synthetic()){
|
if(wall.synthetic()){
|
||||||
return team.color.rgba();
|
return team.color.rgba();
|
||||||
}
|
}
|
||||||
return (wall.solid ? wall.mapColor : !overlay.useColor ? floor.mapColor : overlay.mapColor).rgba();
|
return (((Floor)overlay).wallOre ? overlay.mapColor : wall.solid ? wall.mapColor : !overlay.useColor ? floor.mapColor : overlay.mapColor).rgba();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pixmap writeImage(Tiles tiles){
|
public static Pixmap writeImage(Tiles tiles){
|
||||||
|
|||||||
@@ -357,7 +357,6 @@ public class Generators{
|
|||||||
|
|
||||||
region.path.delete();
|
region.path.delete();
|
||||||
|
|
||||||
//
|
|
||||||
save(out, region.name);
|
save(out, region.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +410,7 @@ public class Generators{
|
|||||||
|
|
||||||
average.mul(1f / asum);
|
average.mul(1f / asum);
|
||||||
|
|
||||||
if(block instanceof Floor){
|
if(block instanceof Floor && !((Floor)block).wallOre){
|
||||||
average.mul(0.77f);
|
average.mul(0.77f);
|
||||||
}else{
|
}else{
|
||||||
average.mul(1.1f);
|
average.mul(1.1f);
|
||||||
|
|||||||
Reference in New Issue
Block a user