Bugfixes
This commit is contained in:
@@ -131,7 +131,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.anuke.mindustry.ui.fragments;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.input.*;
|
||||
import io.anuke.arc.math.geom.*;
|
||||
import io.anuke.arc.scene.*;
|
||||
import io.anuke.arc.scene.event.*;
|
||||
@@ -37,19 +36,6 @@ public class PlacementFragment extends Fragment{
|
||||
Table blockTable, toggler, topTable;
|
||||
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(){
|
||||
Events.on(WorldLoadEvent.class, event -> {
|
||||
Core.app.post(() -> {
|
||||
@@ -92,27 +78,6 @@ public class PlacementFragment extends Fragment{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -272,6 +237,14 @@ public class PlacementFragment extends Fragment{
|
||||
blocksSelect.table(control.input::buildPlacementUI).name("inputTable").growX();
|
||||
}).fillY().bottom().touchable(Touchable.enabled);
|
||||
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);
|
||||
|
||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||
@@ -296,7 +269,7 @@ public class PlacementFragment extends Fragment{
|
||||
rebuildCategory.run();
|
||||
}).group(group).update(i -> i.setChecked(currentCategory == cat)).name("category-" + cat.name());
|
||||
}
|
||||
}).touchable(Touchable.enabled);
|
||||
}).fillY().bottom().touchable(Touchable.enabled);
|
||||
|
||||
rebuildCategory.run();
|
||||
frame.update(() -> {
|
||||
|
||||
Reference in New Issue
Block a user