mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 17:20:09 -06:00
Move the keybindings out of the base.asset and the specific label keybinding out of the default_keybindings
This commit is contained in:
@@ -57,53 +57,9 @@ asset.require("scene/digitaluniverse/voids")
|
||||
asset.require("customization/globebrowsing")
|
||||
asset.require("util/default_actions")
|
||||
|
||||
local toggle_trails = {
|
||||
Identifier = "os_default.toggle_trails",
|
||||
Name = "Toggle Trails",
|
||||
Command = [[
|
||||
local list = openspace.getProperty("{planetTrail_solarSystem}.Renderable.Enabled");
|
||||
for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
|
||||
|
||||
local moonlist = openspace.getProperty("{moonTrail_solarSystem}.Renderable.Enabled");
|
||||
for _,v in pairs(moonlist) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
|
||||
]],
|
||||
Documentation = "Toggles the visibility of planet and moon trails",
|
||||
GuiPath = "/Rendering",
|
||||
IsLocal = false,
|
||||
|
||||
Key = "h"
|
||||
}
|
||||
|
||||
local toggle_planet_labels = {
|
||||
Identifier = "os_default.toggle_planet_labels",
|
||||
Name = "Toggle planet labels",
|
||||
Command = [[
|
||||
local list = openspace.getProperty("{solarsystem_labels}.Renderable.Enabled");
|
||||
for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
|
||||
]],
|
||||
Documentation = "Turns on visibility for all solar system labels",
|
||||
GuiPath = "/Rendering",
|
||||
IsLocal = false,
|
||||
|
||||
Key = "l"
|
||||
}
|
||||
|
||||
local trailAction = asset.require("actions/trails/toggle_trails_planets_moons").toggle_trails
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.bindKey("h", trailAction.Identifier)
|
||||
|
||||
openspace.action.registerAction(toggle_planet_labels)
|
||||
openspace.bindKey(toggle_planet_labels.Key, toggle_planet_labels.Identifier)
|
||||
|
||||
openspace.globebrowsing.loadWMSServersFromFile(
|
||||
openspace.absPath("${DATA}/globebrowsing_servers.lua")
|
||||
)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.clearKey(toggle_trails.Key)
|
||||
|
||||
openspace.action.removeAction(toggle_planet_labels)
|
||||
openspace.clearKey(toggle_planet_labels.Key)
|
||||
end)
|
||||
|
||||
30
data/assets/base_keybindings.asset
Normal file
30
data/assets/base_keybindings.asset
Normal file
@@ -0,0 +1,30 @@
|
||||
asset.require("./base")
|
||||
|
||||
local trailAction = asset.require("actions/trails/toggle_trails_planets_moons").toggle_trails
|
||||
|
||||
local toggle_planet_labels = {
|
||||
Identifier = "os_default.toggle_planet_labels",
|
||||
Name = "Toggle planet labels",
|
||||
Command = [[
|
||||
local list = openspace.getProperty("{solarsystem_labels}.Renderable.Enabled");
|
||||
for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
|
||||
]],
|
||||
Documentation = "Turns on visibility for all solar system labels",
|
||||
GuiPath = "/Solar System",
|
||||
IsLocal = false,
|
||||
Key = "l"
|
||||
}
|
||||
|
||||
asset.onInitialize(function ()
|
||||
openspace.action.registerAction(toggle_planet_labels)
|
||||
openspace.bindKey(toggle_planet_labels.Key, toggle_planet_labels.Identifier)
|
||||
|
||||
openspace.bindKey("h", trailAction.Identifier)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function ()
|
||||
openspace.clearKey("h")
|
||||
|
||||
openspace.action.removeAction(toggle_planet_labels)
|
||||
openspace.clearKey(toggle_planet_labels.Key)
|
||||
end)
|
||||
@@ -187,27 +187,12 @@ local previous_delta_step_immediate = {
|
||||
Key = "Shift+Left"
|
||||
}
|
||||
|
||||
local toggle_planet_labels = {
|
||||
Identifier = "os_default.toggle_planet_labels",
|
||||
Name = "Toggle planet labels",
|
||||
Command = [[
|
||||
local list = openspace.getProperty("{solarsystem_labels}.Renderable.Enabled");
|
||||
for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end
|
||||
]],
|
||||
Documentation = "Turns on visibility for all solar system labels",
|
||||
GuiPath = "/Solar System",
|
||||
IsLocal = false,
|
||||
Key = "l"
|
||||
}
|
||||
|
||||
|
||||
|
||||
local Actions = {
|
||||
toggle_native_ui, toggle_shutdown, take_screenshot, toggle_pause_interpolated,
|
||||
toggle_pause_immediate, toggle_rotation_friction, toggle_zoom_friction,
|
||||
toggle_roll_friction, fade_to_black, toggle_main_gui, toggle_overlays,
|
||||
toggle_master_rendering, next_delta_step_interpolate, next_delta_step_immediate,
|
||||
previous_delta_step_interpolate, previous_delta_step_immediate, toggle_planet_labels
|
||||
previous_delta_step_interpolate, previous_delta_step_immediate
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/apollo/8/apollo8",
|
||||
"scene/solarsystem/missions/apollo/11/apollo11",
|
||||
"scene/solarsystem/missions/apollo/11/lem_flipbook",
|
||||
@@ -110,4 +111,4 @@
|
||||
"major": 1,
|
||||
"minor": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/interstellar/c-2019_q4_borisov",
|
||||
"scene/solarsystem/interstellar/oumuamua",
|
||||
"scene/solarsystem/sssb/amor_asteroid",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"dashboard/default_dashboard",
|
||||
"scene/solarsystem/heliosphere/bastille_day/actions",
|
||||
"scene/solarsystem/heliosphere/bastille_day/density_volume",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/dwarf_planets/ceres/ceres",
|
||||
"scene/solarsystem/dwarf_planets/ceres/default_layers",
|
||||
"scene/solarsystem/dwarf_planets/ceres/trail",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"events/toggle_sun",
|
||||
"scene/solarsystem/planets/earth/earth",
|
||||
"scene/solarsystem/planets/earth/satellites/satellites"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"events/toggle_sun",
|
||||
"scene/solarsystem/planets/earth/earth",
|
||||
"scene/solarsystem/planets/earth/satellites/satellites",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/milkyway/gaia/apogee",
|
||||
"scene/milkyway/gaia/gaiastars",
|
||||
"scene/milkyway/gaia/galah",
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"additional_scripts": [
|
||||
""
|
||||
],
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/juice/fieldlines",
|
||||
"scene/solarsystem/missions/juice/fov/janus",
|
||||
"scene/solarsystem/missions/juice/fov/navcam",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/juno/juno"
|
||||
],
|
||||
"camera": {
|
||||
@@ -61,4 +62,4 @@
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
],
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/planets/earth/earth",
|
||||
"scene/solarsystem/planets/earth/satellites/satellites",
|
||||
"scene/solarsystem/planets/earth/satellites/misc/hubble_trail",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/insight/edl",
|
||||
"scene/solarsystem/missions/perseverance/perseverance"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/messenger/dashboard",
|
||||
"scene/solarsystem/missions/messenger/mercurymagnetosphere",
|
||||
"scene/solarsystem/missions/messenger/messengerSC"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/newhorizons/dashboard",
|
||||
"scene/solarsystem/missions/newhorizons/model",
|
||||
"scene/solarsystem/missions/newhorizons/newhorizons"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/osirisrex/dashboard",
|
||||
"scene/solarsystem/missions/osirisrex/model",
|
||||
"scene/solarsystem/missions/osirisrex/osirisrex",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/rosetta/67p",
|
||||
"scene/solarsystem/missions/rosetta/dashboard",
|
||||
"scene/solarsystem/missions/rosetta/rosetta",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"dashboard/default_dashboard",
|
||||
"scene/solarsystem/heliosphere/2012/sun_earth_2012_fieldlines",
|
||||
"scene/solarsystem/planets/earth/magnetosphere/magnetosphere",
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"openspace.setPropertyValueSingle(\"Modules.CefWebGui.GuiUrl\", 'http://127.0.0.1:4680/frontend/#/ontouch');"
|
||||
],
|
||||
"assets": [
|
||||
"base"
|
||||
"base",
|
||||
"base_keybindings"
|
||||
],
|
||||
"camera": {
|
||||
"altitude": 20000000.0,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"assets": [
|
||||
"base",
|
||||
"base_keybindings",
|
||||
"scene/solarsystem/missions/voyager/dashboard",
|
||||
"scene/solarsystem/missions/voyager/voyager1",
|
||||
"scene/solarsystem/missions/voyager/voyager2",
|
||||
|
||||
Reference in New Issue
Block a user