Formatting cleanup / Bugfix

This commit is contained in:
Anuken
2018-12-11 17:29:13 -05:00
parent 2056d5e350
commit 65e65ba308
4 changed files with 69 additions and 67 deletions
@@ -11,7 +11,7 @@ public class ItemImage extends Stack{
public ItemImage(TextureRegion region, Supplier<CharSequence> text){ public ItemImage(TextureRegion region, Supplier<CharSequence> text){
Table t = new Table().left().bottom(); Table t = new Table().left().bottom();
t.label(text); t.label(text).name("item-label");
add(new Image(region)); add(new Image(region));
add(t); add(t);
@@ -22,7 +22,7 @@ public class ItemImage extends Stack{
if(stack.amount != 0){ if(stack.amount != 0){
Table t = new Table().left().bottom(); Table t = new Table().left().bottom();
t.add(stack.amount + ""); t.add(stack.amount + "").name("item-label");
add(t); add(t);
} }
} }
@@ -75,10 +75,12 @@ public class PlacementFragment extends Fragment{
} }
return true; return true;
}else if(Inputs.keyDown("select")){ // Mouse eyedropper select }else if(Inputs.keyDown("select")){ // Mouse eyedropper select
Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y).target(); Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y);
if(tile.block() != null){
if(tile != null){
tile = tile.target();
Recipe tryRecipe = Recipe.getByResult(tile.block()); Recipe tryRecipe = Recipe.getByResult(tile.block());
if((tryRecipe != null) && control.unlocks.isUnlocked(tryRecipe)){ if(tryRecipe != null && control.unlocks.isUnlocked(tryRecipe)){
input.recipe = tryRecipe; input.recipe = tryRecipe;
currentCategory = input.recipe.category; currentCategory = input.recipe.category;
return true; return true;