mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
BIND_DEVTOOLS_CONSOLE
This commit is contained in:
parent
bb4f573d0f
commit
5834233162
6 changed files with 8 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ void corecontent::setup(ContentBuilder* builder) {
|
|||
}
|
||||
|
||||
void corecontent::setup_bindings() {
|
||||
Events::bind(BIND_DEVTOOLS_CONSOLE, inputtype::keyboard, keycode::GRAVE_ACCENT);
|
||||
Events::bind(BIND_MOVE_FORWARD, inputtype::keyboard, keycode::W);
|
||||
Events::bind(BIND_MOVE_BACK, inputtype::keyboard, keycode::S);
|
||||
Events::bind(BIND_MOVE_RIGHT, inputtype::keyboard, keycode::D);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ inline const std::string CORE_AIR = "core:air";
|
|||
inline const std::string TEXTURE_NOTFOUND = "notfound";
|
||||
|
||||
// built-in bindings
|
||||
inline const std::string BIND_DEVTOOLS_CONSOLE = "devtools.console";
|
||||
inline const std::string BIND_MOVE_FORWARD = "movement.forward";
|
||||
inline const std::string BIND_MOVE_BACK = "movement.back";
|
||||
inline const std::string BIND_MOVE_LEFT = "movement.left";
|
||||
|
|
|
|||
|
|
@ -204,6 +204,9 @@ void Hud::processInput(bool visible) {
|
|||
setPause(true);
|
||||
}
|
||||
}
|
||||
if (!pause && Events::active(BIND_DEVTOOLS_CONSOLE)) {
|
||||
showOverlay(assets->getLayout("core:console"), false);
|
||||
}
|
||||
if (!Window::isFocused() && !pause && !isInventoryOpen()) {
|
||||
setPause(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
/// @brief Represents glfw3 keycode values.
|
||||
enum class keycode : int {
|
||||
GRAVE_ACCENT = 96,
|
||||
ENTER = 257,
|
||||
TAB = 258,
|
||||
SPACE = 32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue