Bugfixes
This commit is contained in:
@@ -641,8 +641,6 @@ category.multiplayer.name = Multiplayer
|
|||||||
command.attack = Attack
|
command.attack = Attack
|
||||||
command.rally = Rally
|
command.rally = Rally
|
||||||
command.retreat = Retreat
|
command.retreat = Retreat
|
||||||
keybind.gridMode.name = Block Select
|
|
||||||
keybind.gridModeShift.name = Category Select
|
|
||||||
keybind.clear_building.name = Clear Building
|
keybind.clear_building.name = Clear Building
|
||||||
keybind.press = Press a key...
|
keybind.press = Press a key...
|
||||||
keybind.press.axis = Press an axis or key...
|
keybind.press.axis = Press an axis or key...
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
|
|
||||||
float xa = Core.input.axis(Binding.move_x);
|
float xa = Core.input.axis(Binding.move_x);
|
||||||
float ya = Core.input.axis(Binding.move_y);
|
float ya = Core.input.axis(Binding.move_y);
|
||||||
if(!Core.input.keyDown(Binding.gridMode) && !(Core.scene.getKeyboardFocus() instanceof TextField)){
|
if(!(Core.scene.getKeyboardFocus() instanceof TextField)){
|
||||||
movement.y += ya * speed;
|
movement.y += ya * speed;
|
||||||
movement.x += xa * speed;
|
movement.x += xa * speed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ public enum Binding implements KeyBind{
|
|||||||
schematic_flip_y(KeyCode.X),
|
schematic_flip_y(KeyCode.X),
|
||||||
schematic_menu(KeyCode.T),
|
schematic_menu(KeyCode.T),
|
||||||
dash(KeyCode.SHIFT_LEFT),
|
dash(KeyCode.SHIFT_LEFT),
|
||||||
gridMode(KeyCode.BACKTICK),
|
|
||||||
gridModeShift(KeyCode.ALT_LEFT),
|
|
||||||
zoom_hold(KeyCode.CONTROL_LEFT, "view"),
|
zoom_hold(KeyCode.CONTROL_LEFT, "view"),
|
||||||
zoom(new Axis(KeyCode.SCROLL)),
|
zoom(new Axis(KeyCode.SCROLL)),
|
||||||
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE),
|
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE),
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
cont.update(() -> {
|
cont.update(() -> {
|
||||||
if(!Core.input.keyDown(Binding.gridMode) && Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){
|
if(Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){
|
||||||
toggleMenus();
|
toggleMenus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.ui.fragments;
|
|||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.collection.*;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.input.*;
|
|
||||||
import io.anuke.arc.math.geom.*;
|
import io.anuke.arc.math.geom.*;
|
||||||
import io.anuke.arc.scene.*;
|
import io.anuke.arc.scene.*;
|
||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
@@ -37,19 +36,6 @@ public class PlacementFragment extends Fragment{
|
|||||||
Table blockTable, toggler, topTable;
|
Table blockTable, toggler, topTable;
|
||||||
boolean lastGround;
|
boolean lastGround;
|
||||||
|
|
||||||
//not configurable, no plans to make it configurable
|
|
||||||
final KeyCode[] inputGrid = {
|
|
||||||
KeyCode.NUM_1, KeyCode.NUM_2, KeyCode.NUM_3, KeyCode.NUM_4,
|
|
||||||
KeyCode.Q, KeyCode.W, KeyCode.E, KeyCode.R,
|
|
||||||
KeyCode.A, KeyCode.S, KeyCode.D, KeyCode.F,
|
|
||||||
KeyCode.Z, KeyCode.X, KeyCode.C, KeyCode.V
|
|
||||||
}, inputCatGrid = {
|
|
||||||
KeyCode.NUM_1, KeyCode.NUM_2,
|
|
||||||
KeyCode.Q, KeyCode.W,
|
|
||||||
KeyCode.A, KeyCode.S,
|
|
||||||
KeyCode.Z, KeyCode.X, KeyCode.C, KeyCode.V
|
|
||||||
};
|
|
||||||
|
|
||||||
public PlacementFragment(){
|
public PlacementFragment(){
|
||||||
Events.on(WorldLoadEvent.class, event -> {
|
Events.on(WorldLoadEvent.class, event -> {
|
||||||
Core.app.post(() -> {
|
Core.app.post(() -> {
|
||||||
@@ -92,27 +78,6 @@ public class PlacementFragment extends Fragment{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Core.input.keyDown(Binding.gridMode) || ui.chatfrag.chatOpen()) return false;
|
|
||||||
if(Core.input.keyDown(Binding.gridModeShift)){ //select category
|
|
||||||
int i = 0;
|
|
||||||
for(KeyCode key : inputCatGrid){
|
|
||||||
if(Core.input.keyDown(key)){
|
|
||||||
input.block = getByCategory(Category.all[i]).first();
|
|
||||||
currentCategory = input.block.category;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}else{ //select block
|
|
||||||
int i = 0;
|
|
||||||
Array<Block> recipes = getByCategory(currentCategory);
|
|
||||||
for(KeyCode key : inputGrid){
|
|
||||||
if(Core.input.keyDown(key))
|
|
||||||
input.block = (i < recipes.size && unlocked(recipes.get(i))) ? recipes.get(i) : null;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,6 +237,14 @@ public class PlacementFragment extends Fragment{
|
|||||||
blocksSelect.table(control.input::buildPlacementUI).name("inputTable").growX();
|
blocksSelect.table(control.input::buildPlacementUI).name("inputTable").growX();
|
||||||
}).fillY().bottom().touchable(Touchable.enabled);
|
}).fillY().bottom().touchable(Touchable.enabled);
|
||||||
frame.table(categories -> {
|
frame.table(categories -> {
|
||||||
|
categories.bottom();
|
||||||
|
categories.add(new Image(Styles.black6){
|
||||||
|
@Override
|
||||||
|
public void draw(){
|
||||||
|
if(height <= Scl.scl(3f)) return;
|
||||||
|
getDrawable().draw(x, y, width, height - Scl.scl(3f));
|
||||||
|
}
|
||||||
|
}).colspan(2).growX().growY().padTop(-3f).row();
|
||||||
categories.defaults().size(50f);
|
categories.defaults().size(50f);
|
||||||
|
|
||||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||||
@@ -296,7 +269,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
rebuildCategory.run();
|
rebuildCategory.run();
|
||||||
}).group(group).update(i -> i.setChecked(currentCategory == cat)).name("category-" + cat.name());
|
}).group(group).update(i -> i.setChecked(currentCategory == cat)).name("category-" + cat.name());
|
||||||
}
|
}
|
||||||
}).touchable(Touchable.enabled);
|
}).fillY().bottom().touchable(Touchable.enabled);
|
||||||
|
|
||||||
rebuildCategory.run();
|
rebuildCategory.run();
|
||||||
frame.update(() -> {
|
frame.update(() -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user