mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-24 09:56:32 +07:00
Improved map previews
This commit is contained in:
parent
93c2ca8df1
commit
3759d32c89
@ -512,14 +512,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
achievedFlight = true;
|
||||
}
|
||||
|
||||
if(boostHeat <= liftoffBoost + 0.05f && achievedFlight){
|
||||
if(boostHeat <= liftoffBoost + 0.05f && achievedFlight && !mech.flying){
|
||||
if(tile != null){
|
||||
if(mech.shake > 1f){
|
||||
Effects.shake(mech.shake, mech.shake, this);
|
||||
}
|
||||
Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
|
||||
}
|
||||
if(!mech.flying) mech.onLand(this);
|
||||
mech.onLand(this);
|
||||
achievedFlight = false;
|
||||
}
|
||||
|
||||
|
@ -47,23 +47,15 @@ public class MapIO{
|
||||
data.position(0, 0);
|
||||
|
||||
TileDataMarker marker = data.newDataMarker();
|
||||
Color color = new Color();
|
||||
|
||||
for(int y = 0; y < data.height(); y++){
|
||||
for(int x = 0; x < data.width(); x++){
|
||||
data.read(marker);
|
||||
byte elev = y >= data.height() - 1 ? 0 : data.read(x, y + 1, DataPosition.elevation);
|
||||
Block floor = content.block(marker.floor);
|
||||
Block wall = content.block(marker.wall);
|
||||
int wallc = ColorMapper.getBlockColor(wall);
|
||||
if(wallc == 0 && (wall.update || wall.solid || wall.breakable)) wallc = Team.all[marker.team].intColor;
|
||||
wallc = wallc == 0 ? ColorMapper.getBlockColor(floor) : wallc;
|
||||
if(marker.elevation > 0){
|
||||
float scaling = 1f + marker.elevation / 8f;
|
||||
color.set(wallc);
|
||||
color.mul(scaling, scaling, scaling, 1f);
|
||||
wallc = Color.rgba8888(color);
|
||||
}
|
||||
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, wallc);
|
||||
int color = ColorMapper.colorFor(floor, wall, Team.all[marker.team], marker.elevation, elev > marker.elevation ? (byte)(1 << 6) : (byte)0);
|
||||
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user