Fixed #9224
This commit is contained in:
@@ -114,7 +114,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
|
|
||||||
//draw break selection
|
//draw break selection
|
||||||
if(mode == breaking){
|
if(mode == breaking){
|
||||||
drawBreakSelection(selectX, selectY, cursorX, cursorY, !Core.input.keyDown(Binding.schematic_select) ? maxLength : Vars.maxSchematicSize);
|
drawBreakSelection(selectX, selectY, cursorX, cursorY, !Core.input.keyDown(Binding.schematic_select) ? maxLength : Vars.maxSchematicSize, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Core.scene.hasKeyboard() && mode != breaking){
|
if(!Core.scene.hasKeyboard() && mode != breaking){
|
||||||
|
|||||||
@@ -1298,6 +1298,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void drawBreakSelection(int x1, int y1, int x2, int y2, int maxLength){
|
protected void drawBreakSelection(int x1, int y1, int x2, int y2, int maxLength){
|
||||||
|
drawBreakSelection(x1, y1, x2, y2, maxLength, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawBreakSelection(int x1, int y1, int x2, int y2, int maxLength, boolean useSelectPlans){
|
||||||
NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, maxLength, 1f);
|
NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, maxLength, 1f);
|
||||||
NormalizeResult dresult = Placement.normalizeArea(x1, y1, x2, y2, rotation, false, maxLength);
|
NormalizeResult dresult = Placement.normalizeArea(x1, y1, x2, y2, rotation, false, maxLength);
|
||||||
|
|
||||||
@@ -1316,16 +1320,16 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
Lines.stroke(1f);
|
Lines.stroke(1f);
|
||||||
|
|
||||||
for(var plan : player.unit().plans()){
|
for(var plan : player.unit().plans()){
|
||||||
if(plan.breaking) continue;
|
if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
||||||
if(plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
|
||||||
drawBreaking(plan);
|
drawBreaking(plan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var plan : selectPlans){
|
if(useSelectPlans){
|
||||||
if(plan.breaking) continue;
|
for(var plan : selectPlans){
|
||||||
if(plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
||||||
drawBreaking(plan);
|
drawBreaking(plan);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1487,11 +1491,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
it = selectPlans.iterator();
|
//don't remove plans on desktop, where flushing is false
|
||||||
while(it.hasNext()){
|
if(flush){
|
||||||
var plan = it.next();
|
it = selectPlans.iterator();
|
||||||
if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
while(it.hasNext()){
|
||||||
it.remove();
|
var plan = it.next();
|
||||||
|
if(!plan.breaking && plan.bounds(Tmp.r2).overlaps(Tmp.r1)){
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user