Implemented basic block inventories
This commit is contained in:
@@ -29,6 +29,7 @@ public class DefaultKeybinds {
|
||||
"chat_history_prev", Input.UP,
|
||||
"chat_history_next", Input.DOWN,
|
||||
"chat_scroll", new Axis(Input.SCROLL),
|
||||
"item_withdraw", Input.SHIFT_LEFT,
|
||||
"console", Input.GRAVE,
|
||||
"weapon_1", Input.NUM_1,
|
||||
"weapon_2", Input.NUM_2,
|
||||
|
||||
@@ -91,7 +91,6 @@ public class DesktopInput extends InputHandler{
|
||||
if(Inputs.keyTap("weapon_" + i)){
|
||||
player.weaponLeft = player.weaponRight = control.upgrades().getWeapons().get(i - 1);
|
||||
if(Net.active()) NetEvents.handleWeaponSwitch();
|
||||
ui.hudfrag.updateWeapons();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,15 +98,18 @@ public class DesktopInput extends InputHandler{
|
||||
Tile target = cursor == null ? null : cursor.target();
|
||||
boolean showCursor = false;
|
||||
|
||||
if(recipe == null && target != null && !ui.hasMouse() && Inputs.keyDown("block_info")
|
||||
&& target.block().fullDescription != null){
|
||||
if(recipe == null && target != null && !ui.hasMouse() && Inputs.keyDown("block_info") && target.block().isAccessible()){
|
||||
showCursor = true;
|
||||
if(Inputs.keyTap("select")){
|
||||
ui.hudfrag.blockfrag.showBlockInfo(target.block());
|
||||
ui.blockinvfrag.showFor(target);
|
||||
Cursors.restoreCursor();
|
||||
}
|
||||
}
|
||||
|
||||
if(!ui.hasMouse() && (target == null || !target.block().isAccessible()) && Inputs.keyTap("select")){
|
||||
ui.blockinvfrag.hide();
|
||||
}
|
||||
|
||||
if(target != null && target.block().isConfigurable(target)){
|
||||
showCursor = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user