Building custom shadow support

This commit is contained in:
Anuken
2022-01-07 10:04:59 -05:00
parent 38cb7aa41d
commit 2e0f9ed020
3 changed files with 21 additions and 1 deletions

View File

@@ -220,6 +220,8 @@ public class Block extends UnlockableContent{
public int outlinedIcon = -1;
/** Whether this block has a shadow under it. */
public boolean hasShadow = true;
/** If true, a custom shadow (name-shadow) is drawn under this block. */
public boolean customShadow = false;
/** Should the sound made when this block is built change in pitch. */
public boolean placePitchChange = true;
/** Should the sound made when this block is deconstructed change in pitch. */
@@ -288,6 +290,7 @@ public class Block extends UnlockableContent{
protected TextureRegion[] editorVariantRegions;
public TextureRegion region, editorIcon;
public @Load("@-shadow") TextureRegion customShadowRegion;
public @Load("@-team") TextureRegion teamRegion;
public TextureRegion[] teamRegions, variantRegions;
@@ -914,6 +917,11 @@ public class Block extends UnlockableContent{
@Override
@CallSuper
public void init(){
//disable standard shadow
if(customShadow){
hasShadow = false;
}
//initialize default health based on size
if(health == -1){
boolean round = false;