This commit is contained in:
Anuken
2019-10-19 21:09:59 -04:00
parent cc105e5029
commit 00054e2c61
5 changed files with 23 additions and 10 deletions

View File

@@ -18,9 +18,10 @@ public enum Binding implements KeyBind{
rotateplaced(KeyCode.R),
diagonal_placement(KeyCode.CONTROL_LEFT),
pick(KeyCode.MOUSE_MIDDLE),
schematic(KeyCode.F),
schematic_select(KeyCode.F),
schematic_flip_x(KeyCode.Z),
schematic_flip_y(KeyCode.X),
schematic_menu(KeyCode.T),
dash(KeyCode.SHIFT_LEFT),
gridMode(KeyCode.BACKTICK),
gridModeShift(KeyCode.ALT_LEFT),

View File

@@ -51,7 +51,7 @@ public class DesktopInput extends InputHandler{
b.row();
b.add(Core.bundle.format("cancelbuilding", Core.keybinds.get(Binding.clear_building).key.name())).style(Styles.outlineLabel);
b.row();
b.add(Core.bundle.format("selectschematic", Core.keybinds.get(Binding.schematic).key.name())).style(Styles.outlineLabel);
b.add(Core.bundle.format("selectschematic", Core.keybinds.get(Binding.schematic_select).key.name())).style(Styles.outlineLabel);
}).margin(10f);
});
@@ -129,7 +129,7 @@ public class DesktopInput extends InputHandler{
drawSelected(sreq.x, sreq.y, sreq.block, getRequest(sreq.x, sreq.y, sreq.block.size, sreq) != null ? Pal.remove : Pal.accent);
}
if(Core.input.keyDown(Binding.schematic)){
if(Core.input.keyDown(Binding.schematic_select)){
drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize);
}
@@ -289,17 +289,21 @@ public class DesktopInput extends InputHandler{
player.clearBuilding();
}
if(Core.input.keyTap(Binding.schematic)){
if(Core.input.keyTap(Binding.schematic_select)){
schemX = rawCursorX;
schemY = rawCursorY;
}
if(Core.input.keyTap(Binding.schematic_menu)){
ui.schematics.show();
}
if(Core.input.keyTap(Binding.clear_building)){
lastSchematic = null;
selectRequests.clear();
}
if(Core.input.keyRelease(Binding.schematic)){
if(Core.input.keyRelease(Binding.schematic_select)){
lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY);
useSchematic(lastSchematic);
if(selectRequests.isEmpty()){