Misc block rendering cleanup
BIN
core/assets-raw/sprites/blocks/distribution/cross-full.png
Normal file
|
After Width: | Height: | Size: 209 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 382 B |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 270 B |
|
After Width: | Height: | Size: 306 B |
|
Before Width: | Height: | Size: 430 B |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 307 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
core/assets-raw/sprites/blocks/production/melter-bottom.png
Normal file
|
After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 563 B |
BIN
core/assets-raw/sprites/blocks/production/separator-bottom.png
Normal file
|
After Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 296 B |
@@ -8,8 +8,8 @@ import mindustry.entities.*;
|
|||||||
import mindustry.entities.abilities.*;
|
import mindustry.entities.abilities.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.entities.effect.*;
|
import mindustry.entities.effect.*;
|
||||||
import mindustry.entities.part.*;
|
|
||||||
import mindustry.entities.part.DrawPart.*;
|
import mindustry.entities.part.DrawPart.*;
|
||||||
|
import mindustry.entities.part.*;
|
||||||
import mindustry.entities.pattern.*;
|
import mindustry.entities.pattern.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@@ -1042,7 +1042,7 @@ public class Blocks{
|
|||||||
|
|
||||||
craftTime = 10f;
|
craftTime = 10f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
drawer = new DrawMulti(new DrawDefault(), new DrawLiquidRegion());
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(), new DrawDefault());
|
||||||
|
|
||||||
consumePower(1f);
|
consumePower(1f);
|
||||||
consumeItem(Items.scrap, 1);
|
consumeItem(Items.scrap, 1);
|
||||||
@@ -1062,6 +1062,8 @@ public class Blocks{
|
|||||||
|
|
||||||
consumePower(1.1f);
|
consumePower(1.1f);
|
||||||
consumeLiquid(Liquids.slag, 4f / 60f);
|
consumeLiquid(Liquids.slag, 4f / 60f);
|
||||||
|
|
||||||
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(), new DrawRegion("-spinner", 3), new DrawDefault());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
disassembler = new Separator("disassembler"){{
|
disassembler = new Separator("disassembler"){{
|
||||||
@@ -1080,6 +1082,8 @@ public class Blocks{
|
|||||||
consumePower(4f);
|
consumePower(4f);
|
||||||
consumeItem(Items.scrap);
|
consumeItem(Items.scrap);
|
||||||
consumeLiquid(Liquids.slag, 0.12f);
|
consumeLiquid(Liquids.slag, 0.12f);
|
||||||
|
|
||||||
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawLiquidTile(), new DrawRegion("-spinner", 3), new DrawDefault());
|
||||||
}};
|
}};
|
||||||
|
|
||||||
sporePress = new GenericCrafter("spore-press"){{
|
sporePress = new GenericCrafter("spore-press"){{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.distribution;
|
package mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
@@ -49,6 +50,11 @@ public class Sorter extends Block{
|
|||||||
return build == null || build.sortItem == null ? 0 : build.sortItem.color.rgba();
|
return build == null || build.sortItem == null ? 0 : build.sortItem.color.rgba();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TextureRegion[] icons(){
|
||||||
|
return new TextureRegion[]{Core.atlas.find("source-bottom"), region};
|
||||||
|
}
|
||||||
|
|
||||||
public class SorterBuild extends Building{
|
public class SorterBuild extends Building{
|
||||||
public @Nullable Item sortItem;
|
public @Nullable Item sortItem;
|
||||||
|
|
||||||
@@ -63,15 +69,16 @@ public class Sorter extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
super.draw();
|
|
||||||
|
|
||||||
if(sortItem == null){
|
if(sortItem == null){
|
||||||
Draw.rect("cross", x, y);
|
Draw.rect("cross-full", x, y);
|
||||||
}else{
|
}else{
|
||||||
Draw.color(sortItem.color);
|
Draw.color(sortItem.color);
|
||||||
Draw.rect("center", x, y);
|
Fill.square(x, y, tilesize/2f - 0.00001f);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
package mindustry.world.blocks.production;
|
package mindustry.world.blocks.production;
|
||||||
|
|
||||||
import arc.*;
|
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.io.*;
|
import arc.util.io.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
|
||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.consumers.*;
|
import mindustry.world.consumers.*;
|
||||||
|
import mindustry.world.draw.*;
|
||||||
import mindustry.world.meta.*;
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,9 +22,7 @@ public class Separator extends Block{
|
|||||||
public ItemStack[] results;
|
public ItemStack[] results;
|
||||||
public float craftTime;
|
public float craftTime;
|
||||||
|
|
||||||
public @Load("@-liquid") TextureRegion liquidRegion;
|
public DrawBlock drawer = new DrawDefault();
|
||||||
public @Load("@-spinner") TextureRegion spinnerRegion;
|
|
||||||
public float spinnerSpeed = 3f;
|
|
||||||
|
|
||||||
public Separator(String name){
|
public Separator(String name){
|
||||||
super(name);
|
super(name);
|
||||||
@@ -51,6 +48,23 @@ public class Separator extends Block{
|
|||||||
consItems = findConsumer(c -> c instanceof ConsumeItems);
|
consItems = findConsumer(c -> c instanceof ConsumeItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
super.load();
|
||||||
|
|
||||||
|
drawer.load(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawPlanRegion(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
|
drawer.drawPlan(this, plan, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureRegion[] icons(){
|
||||||
|
return drawer.finalIcons(this);
|
||||||
|
}
|
||||||
|
|
||||||
public class SeparatorBuild extends Building{
|
public class SeparatorBuild extends Building{
|
||||||
public float progress;
|
public float progress;
|
||||||
public float totalProgress;
|
public float totalProgress;
|
||||||
@@ -79,6 +93,7 @@ public class Separator extends Block{
|
|||||||
return total < itemCapacity && enabled;
|
return total < itemCapacity && enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
super.draw();
|
super.draw();
|
||||||
@@ -88,6 +103,32 @@ public class Separator extends Block{
|
|||||||
if(Core.atlas.isFound(spinnerRegion)){
|
if(Core.atlas.isFound(spinnerRegion)){
|
||||||
Draw.rect(spinnerRegion, x, y, totalProgress * spinnerSpeed);
|
Draw.rect(spinnerRegion, x, y, totalProgress * spinnerSpeed);
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(){
|
||||||
|
drawer.draw(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawLight(){
|
||||||
|
super.drawLight();
|
||||||
|
drawer.drawLight(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float warmup(){
|
||||||
|
return warmup;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float progress(){
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float totalProgress(){
|
||||||
|
return totalProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.world.blocks.sandbox;
|
package mindustry.world.blocks.sandbox;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@@ -45,6 +46,11 @@ public class ItemSource extends Block{
|
|||||||
stats.add(Stat.output, itemsPerSecond, StatUnit.itemsSecond);
|
stats.add(Stat.output, itemsPerSecond, StatUnit.itemsSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected TextureRegion[] icons(){
|
||||||
|
return new TextureRegion[]{Core.atlas.find("source-bottom"), region};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlanConfig(BuildPlan plan, Eachable<BuildPlan> list){
|
public void drawPlanConfig(BuildPlan plan, Eachable<BuildPlan> list){
|
||||||
drawPlanConfigCenter(plan, plan.config, "center", true);
|
drawPlanConfigCenter(plan, plan.config, "center", true);
|
||||||
@@ -61,15 +67,15 @@ public class ItemSource extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
super.draw();
|
|
||||||
|
|
||||||
if(outputItem == null){
|
if(outputItem == null){
|
||||||
Draw.rect("cross", x, y);
|
Draw.rect("cross-full", x, y);
|
||||||
}else{
|
}else{
|
||||||
Draw.color(outputItem.color);
|
Draw.color(outputItem.color);
|
||||||
Draw.rect("center", x, y);
|
Fill.square(x, y, tilesize/2f - 0.00001f);
|
||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ public class DrawRegion extends DrawBlock{
|
|||||||
this.suffix = suffix;
|
this.suffix = suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DrawRegion(String suffix, float rotateSpeed){
|
||||||
|
this.suffix = suffix;
|
||||||
|
this.rotateSpeed = rotateSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
public DrawRegion(){
|
public DrawRegion(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||