mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-13 17:27:35 +07:00
Bugfixes / Cleanup
This commit is contained in:
@ -132,30 +132,32 @@ public class DesktopInput extends InputHandler{
|
||||
drawOverRequest(request);
|
||||
}
|
||||
|
||||
//draw things that may be placed soon
|
||||
if(mode == placing && block != null){
|
||||
for(int i = 0; i < lineRequests.size; i++){
|
||||
BuildRequest req = lineRequests.get(i);
|
||||
if(i == lineRequests.size - 1 && req.block.rotate){
|
||||
drawArrow(block, req.x, req.y, req.rotation);
|
||||
if(player.isBuilder()){
|
||||
//draw things that may be placed soon
|
||||
if(mode == placing && block != null){
|
||||
for(int i = 0; i < lineRequests.size; i++){
|
||||
BuildRequest req = lineRequests.get(i);
|
||||
if(i == lineRequests.size - 1 && req.block.rotate){
|
||||
drawArrow(block, req.x, req.y, req.rotation);
|
||||
}
|
||||
drawRequest(lineRequests.get(i));
|
||||
}
|
||||
drawRequest(lineRequests.get(i));
|
||||
}
|
||||
}else if(isPlacing()){
|
||||
if(block.rotate){
|
||||
drawArrow(block, cursorX, cursorY, rotation);
|
||||
}
|
||||
Draw.color();
|
||||
drawRequest(cursorX, cursorY, block, rotation);
|
||||
block.drawPlace(cursorX, cursorY, rotation, validPlace(cursorX, cursorY, block, rotation));
|
||||
}else if(isPlacing()){
|
||||
if(block.rotate){
|
||||
drawArrow(block, cursorX, cursorY, rotation);
|
||||
}
|
||||
Draw.color();
|
||||
drawRequest(cursorX, cursorY, block, rotation);
|
||||
block.drawPlace(cursorX, cursorY, rotation, validPlace(cursorX, cursorY, block, rotation));
|
||||
|
||||
if(block.saveConfig && block.lastConfig != null){
|
||||
brequest.set(cursorX, cursorY, rotation, block);
|
||||
brequest.config = block.lastConfig;
|
||||
if(block.saveConfig && block.lastConfig != null){
|
||||
brequest.set(cursorX, cursorY, rotation, block);
|
||||
brequest.config = block.lastConfig;
|
||||
|
||||
block.drawRequestConfig(brequest, allRequests());
|
||||
}
|
||||
|
||||
block.drawRequestConfig(brequest, allRequests());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
@ -254,7 +256,7 @@ public class DesktopInput extends InputHandler{
|
||||
isShooting = false;
|
||||
}
|
||||
|
||||
if(isPlacing()){
|
||||
if(isPlacing() && player.isBuilder()){
|
||||
cursorType = SystemCursor.hand;
|
||||
selectScale = Mathf.lerpDelta(selectScale, 1f, 0.2f);
|
||||
}else{
|
||||
@ -463,7 +465,7 @@ public class DesktopInput extends InputHandler{
|
||||
}else if(Core.input.keyTap(Binding.deselect) && !selectRequests.isEmpty()){
|
||||
selectRequests.clear();
|
||||
lastSchematic = null;
|
||||
}else if(Core.input.keyTap(Binding.break_block) && !Core.scene.hasMouse()){
|
||||
}else if(Core.input.keyTap(Binding.break_block) && !Core.scene.hasMouse() && player.isBuilder()){
|
||||
//is recalculated because setting the mode to breaking removes potential multiblock cursor offset
|
||||
deleting = false;
|
||||
mode = breaking;
|
||||
|
Reference in New Issue
Block a user