Skip to content

Commit

Permalink
Add script override for key press
Browse files Browse the repository at this point in the history
  • Loading branch information
St4lker0k765 committed Dec 1, 2024
1 parent 8e66e73 commit 7b94717
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/xrGame/Level_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -174,6 +180,13 @@ void CLevel::IR_OnKeyboardPress (int key)

if ( game && game->OnKeyboardPress(get_binded_action(key)) ) return;

luabind::functor<bool> 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");
Expand Down

0 comments on commit 7b94717

Please sign in to comment.