add 'istoplevel' argument to input.add_callback
This commit is contained in:
parent
97c8bac9ff
commit
bcfdb6196a
@ -70,6 +70,7 @@ void Engine::onContentLoad() {
|
|||||||
for (auto& pack : content->getAllContentPacks()) {
|
for (auto& pack : content->getAllContentPacks()) {
|
||||||
auto configFolder = pack.folder / "config";
|
auto configFolder = pack.folder / "config";
|
||||||
auto bindsFile = configFolder / "bindings.toml";
|
auto bindsFile = configFolder / "bindings.toml";
|
||||||
|
logger.info() << "loading bindings: " << bindsFile.string();
|
||||||
if (io::is_regular_file(bindsFile)) {
|
if (io::is_regular_file(bindsFile)) {
|
||||||
input->getBindings().read(
|
input->getBindings().read(
|
||||||
toml::parse(
|
toml::parse(
|
||||||
|
|||||||
@ -50,8 +50,11 @@ static int l_add_callback(lua::State* L) {
|
|||||||
handler = input.addKeyCallback(key, actual_callback);
|
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 actual_callback();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user