Added contribution guide
This commit is contained in:
@@ -64,9 +64,7 @@ public class HudFragment extends Fragment{
|
||||
select.addImageButton(Icon.menuLargeSmall, style, ui.paused::show);
|
||||
flip = select.addImageButton(Icon.arrowUpSmall, style, this::toggleMenus).get();
|
||||
|
||||
select.addImageButton(Icon.pasteSmall, style, () -> {
|
||||
ui.schematics.show();
|
||||
});
|
||||
select.addImageButton(Icon.pasteSmall, style, ui.schematics::show);
|
||||
|
||||
select.addImageButton(Icon.pauseSmall, style, () -> {
|
||||
if(net.active()){
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package io.anuke.mindustry.world.blocks.liquid;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.world.*;
|
||||
import io.anuke.mindustry.world.blocks.*;
|
||||
import io.anuke.mindustry.world.meta.*;
|
||||
|
||||
//TODO implement later
|
||||
public class LiquidOverflowGate extends LiquidBlock{
|
||||
int topRegion;
|
||||
|
||||
public LiquidOverflowGate(String name){
|
||||
super(name);
|
||||
rotate = true;
|
||||
topRegion = reg("-top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
stats.remove(BlockStat.liquidCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBars(){
|
||||
super.setBars();
|
||||
bars.remove("liquid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Tile tile){
|
||||
Draw.rect(name, tile.drawx(), tile.drawy());
|
||||
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy(), tile.rotation() * 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion[] generateIcons(){
|
||||
return new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-top")};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tile getLiquidDestination(Tile tile, Tile source, Liquid liquid){
|
||||
int dir = source.relativeTo(tile.x, tile.y);
|
||||
dir = (dir + 4) % 4;
|
||||
Tile next = tile.getNearby(dir).link();
|
||||
if(!next.block().acceptLiquid(next, tile, liquid, 0.0001f) && !(next.block() instanceof LiquidOverflowGate || next.block() instanceof LiquidJunction)){
|
||||
return tile;
|
||||
}
|
||||
return next.block().getLiquidDestination(next, tile, liquid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user