Default value is used when the setting key is not found in the config
file. If default value is not set, 'nil' is returned.
#6188
#### Methods
* `get(key)`: returns a value
-* `get_bool(key)`: returns a boolean
+* `get_bool(key, [default])`: returns a boolean
+ * `default` is the value returned if `key` is not found.
+ * Returns `nil` if `key` is not found and `default` not specified.
* `get_np_group(key)`: returns a NoiseParams table
* `set(key, value)`
* Setting names can't contain whitespace or any of `="{}#`.
bool value = o->m_settings->getBool(key);
lua_pushboolean(L, value);
} else {
- lua_pushnil(L);
+ // Push default value
+ if (lua_isboolean(L, 3))
+ lua_pushboolean(L, lua_toboolean(L, 3));
+ else
+ lua_pushnil(L);
}
return 1;