mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 06:19:57 -05:00
Fix h key to correctly toggl all trail visibilities
This commit is contained in:
@@ -28,16 +28,6 @@ asset.onInitialize(function ()
|
||||
"Dawn", "Ceres", "Vesta"
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = DawnAsset.Dawn.Identifier,
|
||||
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
|
||||
@@ -46,7 +36,6 @@ asset.onInitialize(function ()
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
openspace.removeInterestingNodes({
|
||||
"Dawn", "Ceres", "Vesta"
|
||||
})
|
||||
|
||||
@@ -48,9 +48,9 @@ local Keybindings = {
|
||||
},
|
||||
{
|
||||
Key = "h",
|
||||
Name="Hide Trails",
|
||||
Command = "openspace.setPropertyValue('Scene.*Trail.Renderable.Enabled', false)",
|
||||
Documentation = "Disables visibility of the trails",
|
||||
Name="Toggle Trails",
|
||||
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
|
||||
Documentation = "Toggles the visibility of all trails",
|
||||
GuiPath = "/Rendering",
|
||||
Local = false
|
||||
},
|
||||
@@ -75,16 +75,6 @@ asset.onInitialize(function ()
|
||||
openspace.absPath("${DATA}/globebrowsing_servers.lua")
|
||||
)
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"Scene.*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = earthAsset.Earth.Identifier,
|
||||
Position = { 0, 0, 0 },
|
||||
@@ -96,6 +86,4 @@ end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
sceneHelper.unbindKeys(Keybindings)
|
||||
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
end)
|
||||
|
||||
@@ -32,16 +32,6 @@ asset.onInitialize(function ()
|
||||
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = junoAsset.Juno.Identifier,
|
||||
Position = { 1837386367.601345, -389860693812.834839, 714830404470.398926 },
|
||||
@@ -50,5 +40,4 @@ asset.onInitialize(function ()
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
end)
|
||||
|
||||
@@ -52,16 +52,6 @@ asset.onInitialize(function ()
|
||||
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"Scene.*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = "Mercury",
|
||||
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
|
||||
|
||||
@@ -161,7 +161,16 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not
|
||||
Name = "Toggle NH Trail",
|
||||
GuiPath = "/New Horizons",
|
||||
Local = false
|
||||
}
|
||||
},
|
||||
{
|
||||
Key = "h",
|
||||
Name="Hide Trails",
|
||||
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
|
||||
Documentation = "Disables visibility of the trails",
|
||||
GuiPath = "/Rendering",
|
||||
Local = false
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -208,16 +217,6 @@ asset.onInitialize(function ()
|
||||
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', false)
|
||||
openspace.setPropertyValueSingle("Scene.PlutoBarycenterTrail.Renderable.Enabled", false)
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = NewHorizonsAsset.NewHorizons.Identifier,
|
||||
Position = { 4662120063743.592773, 1263245003503.724854, -955413856565.788086 },
|
||||
@@ -230,6 +229,4 @@ asset.onDeinitialize(function ()
|
||||
openspace.setPropertyValueSingle('Scene.Pluto.Renderable.Enabled', true)
|
||||
openspace.setPropertyValueSingle('Scene.Charon.Renderable.Enabled', true)
|
||||
openspace.setPropertyValueSingle('Scene.PlutoBarycenterTrail.Renderable.Enabled', true)
|
||||
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
end)
|
||||
|
||||
+10
-12
@@ -78,7 +78,16 @@ local Keybindings = {
|
||||
Command = propertyHelper.invert('Scene.EarthMarker.Renderable.Enabled'),
|
||||
Documentation = "Toggles the visibility of the text marking the location of the Earth.",
|
||||
Local = false
|
||||
}
|
||||
},
|
||||
{
|
||||
Key = "h",
|
||||
Name="Hide Trails",
|
||||
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
|
||||
Documentation = "Disables visibility of the trails",
|
||||
GuiPath = "/Rendering",
|
||||
Local = false
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
local OsirisRexAsset = asset.require('scene/solarsystem/missions/osirisrex/model')
|
||||
@@ -122,16 +131,6 @@ asset.onInitialize(function ()
|
||||
"OsirisRex", "BennuBarycenter", "Earth"
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = OsirisRexAsset.OsirisRex.Identifier,
|
||||
Position = { 26974590199.661884, 76314608558.908020, -127086452897.101791 },
|
||||
@@ -142,7 +141,6 @@ end)
|
||||
asset.onDeinitialize(function ()
|
||||
sceneHelper.unbindKeys(Keybindings)
|
||||
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
openspace.removeInterestingNodes({
|
||||
"OsirisRex", "BennuBarycenter", "Earth"
|
||||
})
|
||||
|
||||
+10
-13
@@ -83,7 +83,16 @@ local Keybindings = {
|
||||
Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.performProjection'),
|
||||
Documentation = "Enables or disables the image projection on 67P.",
|
||||
Local = false
|
||||
}
|
||||
},
|
||||
{
|
||||
Key = "h",
|
||||
Name="Hide Trails",
|
||||
Command = "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end",
|
||||
Documentation = "Disables visibility of the trails",
|
||||
GuiPath = "/Rendering",
|
||||
Local = false
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
local Comet67PAsset = asset.require('scene/solarsystem/missions/rosetta/67p')
|
||||
@@ -126,16 +135,6 @@ asset.onInitialize(function ()
|
||||
28800, 57600, 115200, 230400, 460800, 921600, 1843200, 3686400, 7372800, 14745600
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = Comet67PAsset.Comet67P.Identifier,
|
||||
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
|
||||
@@ -147,6 +146,4 @@ end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
sceneHelper.unbindKeys(Keybindings)
|
||||
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
end)
|
||||
|
||||
@@ -60,16 +60,6 @@ asset.onInitialize(function ()
|
||||
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
|
||||
})
|
||||
|
||||
openspace.addVirtualProperty(
|
||||
"BoolProperty",
|
||||
"Show Trails",
|
||||
"*Trail.Renderable.Enabled",
|
||||
"Disable or enable all trails of the scene at the same time",
|
||||
true,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
|
||||
openspace.navigation.setCameraState({
|
||||
Anchor = VoyagerAsset.Voyager_1.Identifier,
|
||||
Position = { 526781518487.171326, 257168309890.072144, -1381125204152.817383 },
|
||||
@@ -78,7 +68,6 @@ asset.onInitialize(function ()
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.removeVirtualProperty("*Trail.Renderable.Enabled")
|
||||
openspace.removeInterestingNodes({
|
||||
"Earth", "Voyager 1", "Voyager 2", "Jupiter", "Saturn", "Uranus", "Neptune"
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user