Block Fields for Modding (#2538)

* quickRotate

* quickRotate and rotateArrow

* rotateArrow

* rotateArrow

* Update contributors

* quickRotate

* removed rotateArrow

* remove rotateArrow

* removal
This commit is contained in:
Sunny Kim 2020-09-12 23:11:10 +09:00 committed by GitHub
parent 197b67f8c1
commit b5b75656d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View file

@ -89,3 +89,4 @@ Daniel Dusek
DeltaNedas
GioIacca9
SnakkiZXZ
sk7725

View file

@ -140,7 +140,7 @@ public class OverlayRenderer{
build.drawDisabled();
}
if(Core.input.keyDown(Binding.rotateplaced) && build.block.rotate && build.interactable(player.team())){
if(Core.input.keyDown(Binding.rotateplaced) && build.block.rotate && build.block.quickRotate && build.interactable(player.team())){
control.input.drawArrow(build.block, build.tileX(), build.tileY(), build.rotation, true);
Draw.color(Pal.accent, 0.3f + Mathf.absin(4f, 0.2f));
Fill.square(build.x, build.y, build.block.size * tilesize/2f);

View file

@ -306,7 +306,7 @@ public class DesktopInput extends InputHandler{
cursorType = ui.unloadCursor;
}
if(cursor.build != null && cursor.interactable(player.team()) && !isPlacing() && Math.abs(Core.input.axisTap(Binding.rotate)) > 0 && Core.input.keyDown(Binding.rotateplaced) && cursor.block().rotate){
if(cursor.build != null && cursor.interactable(player.team()) && !isPlacing() && Math.abs(Core.input.axisTap(Binding.rotate)) > 0 && Core.input.keyDown(Binding.rotateplaced) && cursor.block().rotate && cursor.block().quickRotate){
Call.rotateBlock(player, cursor.build, Core.input.axisTap(Binding.rotate) > 0);
}
}

View file

@ -195,6 +195,8 @@ public class Block extends UnlockableContent{
public float buildCostMultiplier = 1f;
/** Whether this block has instant transfer.*/
public boolean instantTransfer = false;
/** Whether you can rotate this block with Keybind rotateplaced + Scroll Wheel. */
public boolean quickRotate = true;
protected Prov<Building> entityType = null; //initialized later
public ObjectMap<Class<?>, Cons2> configurations = new ObjectMap<>();