This commit is contained in:
Anuken
2020-02-27 10:04:56 -05:00
parent 1e53ea50b0
commit dcf75222d9
12 changed files with 22 additions and 22 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -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);
}

View File

@@ -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