1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-11 08:15:35 +03:00

Shadows under blocks in minimap

This commit is contained in:
Anuken 2022-01-23 23:19:44 -05:00
parent 12766dda56
commit fc58f5b003
4 changed files with 26 additions and 4 deletions

View File

@ -2384,7 +2384,7 @@ public class Blocks{
plasmaBore = new BeamDrill("plasma-bore"){{
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 30));
consumes.power(0.15f);
drillTime = 150f;
drillTime = 160f;
tier = 4;
size = 2;
range = 4;

View File

@ -9,6 +9,7 @@ import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import arc.util.pooling.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.EventType.*;
import mindustry.gen.*;
@ -37,6 +38,24 @@ public class MinimapRenderer{
//TODO don't update when the minimap is off?
if(!ui.editor.isShown()){
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.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();
}

View File

@ -165,7 +165,7 @@ public class MapIO{
if(wall.synthetic()){
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){

View File

@ -357,7 +357,6 @@ public class Generators{
region.path.delete();
//
save(out, region.name);
}
@ -411,7 +410,7 @@ public class Generators{
average.mul(1f / asum);
if(block instanceof Floor){
if(block instanceof Floor && !((Floor)block).wallOre){
average.mul(0.77f);
}else{
average.mul(1.1f);