Merge pull request #1514 from Arkanic/patch-7

make batteries glow based on power contents (a redo that works)
This commit is contained in:
Anuken 2020-02-11 16:31:14 -05:00 committed by GitHub
commit a4a3e7fc48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 908 additions and 849 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 753 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 723 KiB

After

Width:  |  Height:  |  Size: 939 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 KiB

After

Width:  |  Height:  |  Size: 1001 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

After

Width:  |  Height:  |  Size: 333 KiB

View File

@ -1,10 +1,41 @@
package mindustry.world.blocks.power;
import arc.*;
import arc.graphics.Color;
import arc.graphics.g2d.*;
import mindustry.world.*;
public class Battery extends PowerDistributor{
public TextureRegion baseRegion;
public Color emptyLightColor = Color.valueOf("6e7080");
public Color fullLightColor = Color.valueOf("fb9567");
public Battery(String name){
super(name);
outputsPower = true;
consumesPower = true;
}
@Override
public void load(){
super.load();
baseRegion = Core.atlas.find(name + "-base");
}
@Override
public void draw(Tile tile){
Draw.color(emptyLightColor, fullLightColor, tile.entity.power.status);
Draw.rect(baseRegion, tile.drawx(), tile.drawy());
Draw.reset();
super.draw(tile);
}
@Override
public TextureRegion[] generateIcons(){
return new TextureRegion[]{Core.atlas.find(name + "-icon")};
}
}