mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 02:29:49 -06:00
* Add a function for getting all propertyowners matching a certain regex * Fix broken toggleFade - now works with multiple nodes * Utilize updated toggle fade function in existing toggle actions * Make `openspace.propertyOwner` work when only tag is included * And make toggleFade work in a situation where tag matches both a screenspace renderable and scene graph node * Remove mistakenly added scene graph node (it is really a screenspace renderable) * Cleanup property check code to reuse check in both property and propertyowner function
34 lines
1003 B
Lua
34 lines
1003 B
Lua
asset.require("./base")
|
|
local allTrailsAction = asset.require("actions/trails/toggle_all_trails").ToggleTrails
|
|
local allTrailsInstantAction = asset.require("actions/trails/toggle_all_trails").ToggleTrailsInstant
|
|
|
|
|
|
|
|
local TogglePlanetLabels = {
|
|
Identifier = "os_default.TogglePlanetLabels",
|
|
Name = "Toggle planet labels",
|
|
Command = [[openspace.toggleFade("{solarsystem_labels}.Renderable")]],
|
|
Documentation = "Turns on visibility for all solar system labels",
|
|
GuiPath = "/Solar System",
|
|
IsLocal = false
|
|
}
|
|
|
|
|
|
asset.onInitialize(function()
|
|
openspace.action.registerAction(TogglePlanetLabels)
|
|
openspace.bindKey("L", TogglePlanetLabels.Identifier)
|
|
|
|
openspace.bindKey("T", allTrailsAction)
|
|
openspace.bindKey("SHIFT+T", allTrailsInstantAction)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.clearKey("SHIFT+T")
|
|
openspace.clearKey("T")
|
|
|
|
openspace.action.removeAction(TogglePlanetLabels)
|
|
openspace.clearKey("L")
|
|
end)
|
|
|
|
asset.export("TogglePlanetLabels", TogglePlanetLabels.Identifier)
|