mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 14:32:06 -08:00
Cleanup
This commit is contained in:
parent
1e53ea50b0
commit
dcf75222d9
12 changed files with 22 additions and 22 deletions
|
|
@ -134,7 +134,7 @@ public class ContentLoader{
|
|||
if(color == 0 || color == 255) continue;
|
||||
|
||||
Block block = block(i);
|
||||
Color.rgba8888ToColor(block.minimapColor, color);
|
||||
Color.rgba8888ToColor(block.mapColor, color);
|
||||
block.hasColor = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||
|
||||
if(isGrounded() && floor.isLiquid){
|
||||
if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= 7f){
|
||||
floor.walkEffect.at(x, y, 0, floor.minimapColor);
|
||||
floor.walkEffect.at(x, y, 0, floor.mapColor);
|
||||
splashTimer = 0f;
|
||||
}
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||
drownTime += Time.delta() * 1f / floor.drownTime;
|
||||
drownTime = Mathf.clamp(drownTime);
|
||||
if(Mathf.chance(Time.delta() * 0.05f)){
|
||||
floor.drownUpdateEffect.at(x, y, 0f, floor.minimapColor);
|
||||
floor.drownUpdateEffect.at(x, y, 0f, floor.mapColor);
|
||||
}
|
||||
|
||||
//TODO is the netClient check necessary?
|
||||
|
|
|
|||
|
|
@ -147,13 +147,15 @@ public class MapIO{
|
|||
if(wall.synthetic()){
|
||||
return team.color.rgba();
|
||||
}
|
||||
return Color.rgba8888(wall.solid ? wall.minimapColor : ore == Blocks.air ? floor.minimapColor : ore.minimapColor);
|
||||
return Color.rgba8888(wall.solid ? wall.mapColor : ore == Blocks.air ? floor.mapColor : ore.mapColor);
|
||||
}
|
||||
|
||||
public static Pixmap writeImage(Tiles tiles){
|
||||
Pixmap pix = new Pixmap(tiles.width, tiles.height);
|
||||
for(Tile tile : tiles){
|
||||
int color = tile.block().hasColor && !tile.block().synthetic() ? tile.block().minimapColor.rgba() : tile.floor().minimapColor.rgba();
|
||||
//while synthetic blocks are possible, most of their data is lost, so in order to avoid questions like
|
||||
//"why is there air under my drill" and "why are all my conveyors facing right", they are disabled
|
||||
int color = tile.block().hasColor && !tile.block().synthetic() ? tile.block().mapColor.rgba() : tile.floor().mapColor.rgba();
|
||||
pix.draw(tile.x, tiles.height - 1 - tile.y, color);
|
||||
}
|
||||
return pix;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class TestPlanetGenerator extends PlanetGenerator{
|
|||
public Color getColor(Vec3 position){
|
||||
Block block = getBlock(position);
|
||||
//replace salt with sand color
|
||||
return block == Blocks.salt ? Blocks.sand.minimapColor : block.minimapColor;
|
||||
return block == Blocks.salt ? Blocks.sand.mapColor : block.mapColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ public class UnitType extends UnlockableContent{
|
|||
Floor floor = unit.floorOn();
|
||||
|
||||
if(floor.isLiquid){
|
||||
Draw.color(Color.white, floor.minimapColor, 0.5f);
|
||||
Draw.color(Color.white, floor.mapColor, 0.5f);
|
||||
}
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
|
|
@ -242,7 +242,7 @@ public class UnitType extends UnlockableContent{
|
|||
}
|
||||
|
||||
if(floor.isLiquid){
|
||||
Draw.color(Color.white, floor.minimapColor, unit.drownTime() * 0.4f);
|
||||
Draw.color(Color.white, floor.mapColor, unit.drownTime() * 0.4f);
|
||||
}else{
|
||||
Draw.color(Color.white);
|
||||
}
|
||||
|
|
@ -255,7 +255,7 @@ public class UnitType extends UnlockableContent{
|
|||
public void applyColor(Unitc unit){
|
||||
Draw.mixcol(Color.white, unit.hitTime());
|
||||
if(unit.drownTime() > 0 && unit.floorOn().isDeep()){
|
||||
Draw.mixcol(unit.floorOn().minimapColor, unit.drownTime() * 0.8f);
|
||||
Draw.mixcol(unit.floorOn().mapColor, unit.drownTime() * 0.8f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,9 +106,7 @@ public class PlanetDialog extends FloatingDialog{
|
|||
cont.clear();
|
||||
titleTable.remove();
|
||||
|
||||
cont.addRect((x, y, w, h) -> {
|
||||
render();
|
||||
}).grow();
|
||||
cont.addRect((x, y, w, h) -> render()).grow();
|
||||
}
|
||||
|
||||
private void render(){
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class Block extends BlockStorage{
|
|||
* The color of this block when displayed on the minimap or map preview.
|
||||
* Do not set manually! This is overriden when loading for most blocks.
|
||||
*/
|
||||
public Color minimapColor = new Color(0, 0, 0, 1);
|
||||
public Color mapColor = new Color(0, 0, 0, 1);
|
||||
/** Whether this block has a minimap color. */
|
||||
public boolean hasColor = false;
|
||||
/** Whether units target this block. */
|
||||
|
|
@ -765,7 +765,7 @@ public class Block extends BlockStorage{
|
|||
|
||||
if(!synthetic()){
|
||||
PixmapRegion image = Core.atlas.getPixmap((AtlasRegion)icon(Cicon.full));
|
||||
minimapColor.set(image.getPixel(image.width/2, image.height/2));
|
||||
mapColor.set(image.getPixel(image.width/2, image.height/2));
|
||||
}
|
||||
|
||||
getGeneratedIcons();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class ColorMapper{
|
|||
color2block.clear();
|
||||
|
||||
for(Block block : Vars.content.blocks()){
|
||||
color2block.put(block.minimapColor.rgba(), block);
|
||||
color2block.put(block.mapColor.rgba(), block);
|
||||
}
|
||||
|
||||
color2block.put(Color.rgba8888(0, 0, 0, 1), Blocks.air);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class Cliff extends Block{
|
|||
int r = tile.rotation();
|
||||
for(int i = 0; i < 8; i++){
|
||||
if((r & (1 << i)) != 0){
|
||||
Draw.color(Tmp.c1.set(tile.floor().minimapColor).mul(1.3f + (i >= 4 ? -0.4f : 0.3f)));
|
||||
Draw.color(Tmp.c1.set(tile.floor().mapColor).mul(1.3f + (i >= 4 ? -0.4f : 0.3f)));
|
||||
Draw.rect(region, tile.worldx(), tile.worldy(), 11f, 11f, i * 45f);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,6 @@ public class Cliff extends Block{
|
|||
|
||||
@Override
|
||||
public int minimapColor(Tile tile){
|
||||
return Tmp.c1.set(tile.floor().minimapColor).mul(1.2f).rgba();
|
||||
return Tmp.c1.set(tile.floor().mapColor).mul(1.2f).rgba();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class Floor extends Block{
|
|||
if(wall == null) wall = Blocks.air;
|
||||
|
||||
if(decoration == Blocks.air){
|
||||
decoration = content.blocks().min(b -> b instanceof Rock && b.breakable ? minimapColor.diff(b.minimapColor) : Float.POSITIVE_INFINITY);
|
||||
decoration = content.blocks().min(b -> b instanceof Rock && b.breakable ? mapColor.diff(b.mapColor) : Float.POSITIVE_INFINITY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ public class Floor extends Block{
|
|||
for(int i = 0; i < 4; i++){
|
||||
Tile other = tile.getNearby(i);
|
||||
if(other != null && doEdge(other.floor(), sameLayer)){
|
||||
Color color = other.floor().minimapColor;
|
||||
Color color = other.floor().mapColor;
|
||||
Draw.color(color.r, color.g, color.b, 1f);
|
||||
Draw.rect(edgeRegion, tile.worldx(), tile.worldy(), i*90);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class OreBlock extends OverlayFloor{
|
|||
this.localizedName = ore.localizedName;
|
||||
this.itemDrop = ore;
|
||||
this.variants = 3;
|
||||
this.minimapColor.set(ore.color);
|
||||
this.mapColor.set(ore.color);
|
||||
}
|
||||
|
||||
/** For mod use only!*/
|
||||
|
|
@ -31,7 +31,7 @@ public class OreBlock extends OverlayFloor{
|
|||
public void setup(Item ore){
|
||||
this.localizedName = ore.localizedName;
|
||||
this.itemDrop = ore;
|
||||
this.minimapColor.set(ore.color);
|
||||
this.mapColor.set(ore.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=307ea4c34bfa0d16098865a354103a85973398b0
|
||||
archash=f2bb11a4dbb6febed118a772ce61a253e1d863c5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue