Render fix

This commit is contained in:
Anuken 2019-01-18 15:41:49 -05:00
parent 2385011f96
commit 4ff1d0c2e1
3 changed files with 8 additions and 23 deletions

View File

@ -60,7 +60,7 @@ public class BlockRenderer{
public void drawShadows(){
if(disableShadows) return;
if(shadows.getWidth() != Core.graphics.getWidth() || shadows.getHeight() != Core.graphics.getHeight()){
if(!Core.graphics.isHidden() && (shadows.getWidth() != Core.graphics.getWidth() || shadows.getHeight() != Core.graphics.getHeight())){
shadows.resize(Core.graphics.getWidth(), Core.graphics.getHeight());
}

View File

@ -130,14 +130,6 @@ public abstract class InputHandler implements InputProcessor{
return Core.input.mouseY();
}
public void resetCursor(){
}
public boolean isCursorVisible(){
return false;
}
public void buildUI(Table table){
}
@ -162,7 +154,7 @@ public abstract class InputHandler implements InputProcessor{
boolean tileTapped(Tile tile){
tile = tile.target();
boolean consumed = false, showedInventory = false, showedConsume = false;
boolean consumed = false, showedInventory = false;
//check if tapped block is configurable
if(tile.block().configurable && tile.getTeam() == player.getTeam()){
@ -329,12 +321,8 @@ public abstract class InputHandler implements InputProcessor{
}
public boolean validPlace(int x, int y, Block type, int rotation){
for(Tile tile : state.teams.get(player.getTeam()).cores){
return Build.validPlace(player.getTeam(), x, y, type, rotation) &&
Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance;
}
return false;
return Build.validPlace(player.getTeam(), x, y, type, rotation) &&
Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance;
}
public boolean validBreak(int x, int y){

View File

@ -30,7 +30,7 @@ public class Item extends UnlockableContent implements Comparable<Item>{
public float fluxiness = 0f;
/**drill hardness of the item*/
public int hardness = 0;
/**the burning color of this item*/
/**the burning color of this item. TODO unused; implement*/
public Color flameColor = Palette.darkFlame.cpy();
/**
* base material cost of this item, used for calculating place times
@ -49,7 +49,7 @@ public class Item extends UnlockableContent implements Comparable<Item>{
if(!Core.bundle.has("item." + this.name + ".name")){
Log.err("Warning: item '" + name + "' is missing a localized name. Add the following to bundle.properties:");
Log.err("item." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_')));
Log.err("item." + this.name + ".name = " + Strings.capitalize(name.replace('-', '_')));
}
}
@ -97,11 +97,8 @@ public class Item extends UnlockableContent implements Comparable<Item>{
return ContentType.item;
}
/**Allocates a new array containing all items the generate ores.*/
public static Array<Item> getAllOres(){
Array<Item> arr = new Array<>();
for(Item item : Vars.content.items()){
if(item.genOre) arr.add(item);
}
return arr;
return Vars.content.items().select(i -> i.genOre);
}
}