Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2023-06-16 17:03:46 -04:00
6 changed files with 27 additions and 13 deletions

View File

@@ -178,17 +178,18 @@ public class DesktopInput extends InputHandler{
}
linePlans.each(this::drawOverPlan);
}else if(isPlacing()){
int rot = block.planRotation(rotation);
if(block.rotate && block.drawArrow){
drawArrow(block, cursorX, cursorY, rotation);
drawArrow(block, cursorX, cursorY, rot);
}
Draw.color();
boolean valid = validPlace(cursorX, cursorY, block, rotation);
drawPlan(cursorX, cursorY, block, rotation);
block.drawPlace(cursorX, cursorY, rotation, valid);
boolean valid = validPlace(cursorX, cursorY, block, rot);
drawPlan(cursorX, cursorY, block, rot);
block.drawPlace(cursorX, cursorY, rot, valid);
if(block.saveConfig){
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f));
bplan.set(cursorX, cursorY, rotation, block);
bplan.set(cursorX, cursorY, rot, block);
bplan.config = block.lastConfig;
block.drawPlanConfig(bplan, allPlans());
bplan.config = null;

View File

@@ -1044,7 +1044,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
plan.x = World.toTile(wx - plan.block.offset) + ox;
plan.y = World.toTile(wy - plan.block.offset) + oy;
plan.rotation = Mathf.mod(plan.rotation + direction, 4);
plan.rotation = plan.block.planRotation(Mathf.mod(plan.rotation + direction, 4));
});
}

View File

@@ -415,9 +415,10 @@ public class MobileInput extends InputHandler implements GestureListener{
//draw last placed plan
if(!plan.breaking && plan == lastPlaced && plan.block != null){
boolean valid = validPlace(tile.x, tile.y, plan.block, rotation);
int rot = block.planRotation(rotation);
boolean valid = validPlace(tile.x, tile.y, plan.block, rot);
Draw.mixcol();
plan.block.drawPlace(tile.x, tile.y, rotation, valid);
plan.block.drawPlace(tile.x, tile.y, rot, valid);
drawOverlapCheck(plan.block, tile.x, tile.y, valid);
}