mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add 'istoplevel' argument to input.add_callback
This commit is contained in:
parent
97c8bac9ff
commit
bcfdb6196a
2 changed files with 6 additions and 2 deletions
|
|
@ -50,8 +50,11 @@ static int l_add_callback(lua::State* L) {
|
|||
handler = input.addKeyCallback(key, actual_callback);
|
||||
}
|
||||
}
|
||||
auto callback = [&gui, actual_callback]() -> bool {
|
||||
if (!gui.isFocusCaught()) {
|
||||
|
||||
bool isTopLevel = lua::toboolean(L, 4);
|
||||
|
||||
auto callback = [&gui, actual_callback, isTopLevel]() -> bool {
|
||||
if (isTopLevel || !gui.isFocusCaught()) {
|
||||
return actual_callback();
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue