This commit is contained in:
Anuken
2020-06-15 21:52:51 -04:00
parent b789394efc
commit caea5c7df2
21 changed files with 30 additions and 12 deletions

View File

@@ -0,0 +1,8 @@
package mindustry.ui;
import arc.scene.ui.layout.*;
/** An interface for things that can be displayed when hovered over. */
public interface Displayable{
void display(Table table);
}

View File

@@ -479,6 +479,10 @@ public class PlacementFragment extends Fragment{
/** Returns the block currently being hovered over in the world. */
Block tileDisplayBlock(){
return hoverTile == null ? null : hoverTile.block().synthetic() ? hoverTile.block() : hoverTile.drop() != null && hoverTile.block() == Blocks.air ? hoverTile.overlay().itemDrop != null ? hoverTile.overlay() : hoverTile.floor() : null;
return hoverTile == null ? null :
hoverTile.block().synthetic() ? hoverTile.block() :
hoverTile.drop() != null && hoverTile.block() == Blocks.air ?
hoverTile.overlay().itemDrop != null ? hoverTile.overlay() :
hoverTile.floor() : null;
}
}