From 7b9471736c9c37f8c831f219e134ecc8575455c3 Mon Sep 17 00:00:00 2001 From: St4lker0k765 <126080360+St4lker0k765@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:35:06 +0300 Subject: [PATCH] Add script override for key press --- src/xrGame/Level_input.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/xrGame/Level_input.cpp b/src/xrGame/Level_input.cpp index 7da83c0119..94da02fe89 100644 --- a/src/xrGame/Level_input.cpp +++ b/src/xrGame/Level_input.cpp @@ -23,6 +23,12 @@ #include "../Include/xrRender/DebugRender.h" +//Alundaio +#include "pch_script.h" +#include "../../xrScripts/script_engine.h" +using namespace luabind; +//-Alundaio + #ifdef DEBUG # include "ai/monsters/BaseMonster/base_monster.h" @@ -174,6 +180,13 @@ void CLevel::IR_OnKeyboardPress (int key) if ( game && game->OnKeyboardPress(get_binded_action(key)) ) return; + luabind::functor funct; + if (ai().script_engine().functor("level_input.on_key_press", funct)) + { + if (funct(key, _curr)) + return; + } + if(_curr == kQUICK_SAVE && IsGameTypeSingle()) { Console->Execute ("save");