added 'hud.inventory' binding

This commit is contained in:
MihailRis 2023-11-19 23:11:35 +03:00
parent 9051db3526
commit 7ab69ebc1e
3 changed files with 3 additions and 1 deletions

View File

@ -106,4 +106,5 @@ void setup_bindings() {
Events::bind(BIND_CAM_ZOOM, inputtype::keyboard, keycode::C);
Events::bind(BIND_PLAYER_NOCLIP, inputtype::keyboard, keycode::N);
Events::bind(BIND_PLAYER_FLIGHT, inputtype::keyboard, keycode::F);
Events::bind(BIND_HUD_INVENTORY, inputtype::keyboard, keycode::TAB);
}

View File

@ -32,6 +32,7 @@
#define BIND_CAM_ZOOM "camera.zoom"
#define BIND_PLAYER_NOCLIP "player.noclip"
#define BIND_PLAYER_FLIGHT "player.flight"
#define BIND_HUD_INVENTORY "hud.inventory"
extern void setup_bindings();
extern void setup_definitions();

View File

@ -309,7 +309,7 @@ void HudRenderer::draw(const GfxContext& ctx){
pauseMenu->visible(true);
}
}
if (Events::jpressed(keycode::TAB)) {
if (Events::jactive("hud.inventory")) {
if (!pause) {
inventoryOpen = !inventoryOpen;
}