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(){ public void drawShadows(){
if(disableShadows) return; 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()); shadows.resize(Core.graphics.getWidth(), Core.graphics.getHeight());
} }

View File

@ -130,14 +130,6 @@ public abstract class InputHandler implements InputProcessor{
return Core.input.mouseY(); return Core.input.mouseY();
} }
public void resetCursor(){
}
public boolean isCursorVisible(){
return false;
}
public void buildUI(Table table){ public void buildUI(Table table){
} }
@ -162,7 +154,7 @@ public abstract class InputHandler implements InputProcessor{
boolean tileTapped(Tile tile){ boolean tileTapped(Tile tile){
tile = tile.target(); tile = tile.target();
boolean consumed = false, showedInventory = false, showedConsume = false; boolean consumed = false, showedInventory = false;
//check if tapped block is configurable //check if tapped block is configurable
if(tile.block().configurable && tile.getTeam() == player.getTeam()){ 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){ 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) &&
return Build.validPlace(player.getTeam(), x, y, type, rotation) && Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance;
Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance;
}
return false;
} }
public boolean validBreak(int x, int y){ 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; public float fluxiness = 0f;
/**drill hardness of the item*/ /**drill hardness of the item*/
public int hardness = 0; 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(); public Color flameColor = Palette.darkFlame.cpy();
/** /**
* base material cost of this item, used for calculating place times * 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")){ 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("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; return ContentType.item;
} }
/**Allocates a new array containing all items the generate ores.*/
public static Array<Item> getAllOres(){ public static Array<Item> getAllOres(){
Array<Item> arr = new Array<>(); return Vars.content.items().select(i -> i.genOre);
for(Item item : Vars.content.items()){
if(item.genOre) arr.add(item);
}
return arr;
} }
} }