mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
Add Lua functions to query keyboard bindings and remove individual keybinds
Add core script file that defines possibility of rebinding keyboard commands to a different key Enable the execution of global customization scripts Make `scene_helper.lua` a script automatically included in the ScriptScheduler
This commit is contained in:
20
scripts/common_scripts.lua
Normal file
20
scripts/common_scripts.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
openspace.documentation = {
|
||||
{
|
||||
Name = "rebindKey",
|
||||
Arguments = "string, string",
|
||||
Documentation = "Rebinds all scripts from the old key (first argument) to the " ..
|
||||
"new key (second argument)."
|
||||
}
|
||||
}
|
||||
|
||||
openspace.rebindKey = function(old_key, new_key)
|
||||
local t = openspace.getKeyBinding(old_key)
|
||||
openspace.clearKey(old_key)
|
||||
for _, v in pairs(t) do
|
||||
if v["Remote"] then
|
||||
openspace.bindKey(new_key, v["Command"])
|
||||
else
|
||||
openspace.bindKeyLocal(new_key, v["Command"])
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,21 @@
|
||||
mark_interesting_nodes = function(nodes)
|
||||
openspace.documentation = {
|
||||
{
|
||||
Name = "mark_interating_nodes",
|
||||
Arguments = "List of nodes",
|
||||
Documentation = "This function marks the scene graph nodes identified by name " ..
|
||||
"as interesting, which will provide shortcut access to focus buttons and " ..
|
||||
"featured properties."
|
||||
},
|
||||
{
|
||||
Name = "set_default_gui_sorting",
|
||||
Arguments = "",
|
||||
Documentation = "This function sets the default GUI sorting for the space " ..
|
||||
"environment to increasing size, from solar system, through Milky Way, " ..
|
||||
"Universe and finishing with other elements"
|
||||
}
|
||||
}
|
||||
|
||||
openspace.mark_interesting_nodes = function(nodes)
|
||||
for _, n in pairs(nodes) do
|
||||
if openspace.hasSceneGraphNode(n) then
|
||||
openspace.addTag(n, "GUI.Interesting")
|
||||
@@ -6,7 +23,7 @@ mark_interesting_nodes = function(nodes)
|
||||
end
|
||||
end
|
||||
|
||||
set_default_gui_sorting = function()
|
||||
openspace.set_default_gui_sorting = function()
|
||||
openspace.setPropertyValueSingle(
|
||||
'Global Properties.ImGUI.Main.Properties.Ordering',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user