Implemented basic block inventories

This commit is contained in:
Anuken
2018-04-13 20:05:42 -04:00
parent 1ff6a7e423
commit 43c9bc51dc
18 changed files with 238 additions and 60 deletions

View File

@@ -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,

View File

@@ -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;
}