move 'devtools:console' binding handler to __vc_on_hud_open

This commit is contained in:
MihailRis
2024-11-20 12:15:09 +03:00
parent e842b217da
commit f4f479d389
4 changed files with 10 additions and 11 deletions
-1
View File
@@ -10,7 +10,6 @@ inline const std::string CORE_STRUCT_AIR = "core:struct_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_CHUNKS_RELOAD = "chunks.reload";
inline const std::string BIND_MOVE_FORWARD = "movement.forward";
inline const std::string BIND_MOVE_BACK = "movement.back";
-8
View File
@@ -229,17 +229,9 @@ void Hud::processInput(bool visible) {
setPause(true);
}
}
if (!pause && Events::jactive(BIND_DEVTOOLS_CONSOLE)) {
showOverlay(
assets->get<UiDocument>("core:console"),
false,
dv::list({std::string("console")})
);
}
if (!Window::isFocused() && !pause && !isInventoryOpen()) {
setPause(true);
}
if (!pause && visible && Events::jactive(BIND_HUD_INVENTORY)) {
if (inventoryOpen) {
closeInventory();
+1 -1
View File
@@ -37,7 +37,7 @@ void scripting::on_frontend_init(Hud* hud, WorldRenderer* renderer) {
load_script("hud_classes.lua");
if (lua::getglobal(L, "__vc_create_hud_rules")) {
if (lua::getglobal(L, "__vc_on_hud_open")) {
lua::call_nothrow(L, 0, 0);
}