mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-05 03:00:21 -06:00
- Remove the asset_helper file and call the onInitialize and onDeinitialize functions directly - Small compile fix on Windows - Removes the need for the registerIdentifierWithMeta function by automatically doing that for all asset.export statements - Allow the passing of either identifiers (as before) or entire tables to the removeSceneGraphNode, removeScreenSpaceRenderable, deleteLayer, removeAction, and export methods. In that case, the Identifier key from the table is extracted and used instead
85 lines
2.2 KiB
Lua
85 lines
2.2 KiB
Lua
local angle = {
|
|
Type = "DashboardItemAngle",
|
|
Identifier = "Angle",
|
|
GuiName = "Angle",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Earth",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Moon"
|
|
}
|
|
|
|
local date = {
|
|
Type = "DashboardItemDate",
|
|
Identifier = "Date",
|
|
GuiName = "Date"
|
|
}
|
|
|
|
local simulation_increment = {
|
|
Type = "DashboardItemSimulationIncrement",
|
|
Identifier = "SimulationIncrement",
|
|
GuiName = "Simulation Increment"
|
|
}
|
|
|
|
local distance = {
|
|
Type = "DashboardItemDistance",
|
|
Identifier = "Distance",
|
|
GuiName = "Distance"
|
|
}
|
|
|
|
local framerate = {
|
|
Type = "DashboardItemFramerate",
|
|
Identifier = "Framerate",
|
|
GuiName = "Framerate"
|
|
}
|
|
|
|
local parallel_connection = {
|
|
Type = "DashboardItemParallelConnection",
|
|
Identifier = "ParallelConnection",
|
|
GuiName = "Parallel Connection"
|
|
}
|
|
|
|
local mission = {
|
|
Type = "DashboardItemMission",
|
|
Identifier = "Mission",
|
|
GuiName = "Mission"
|
|
}
|
|
|
|
local property_value = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "asd",
|
|
GuiName = "adasd",
|
|
URI = "Scene.Earth.Renderable.Enabled",
|
|
DisplayString = "Earth is enabled: {}"
|
|
}
|
|
|
|
asset.onInitialize(function()
|
|
openspace.dashboard.addDashboardItem(angle)
|
|
openspace.dashboard.addDashboardItem(date)
|
|
openspace.dashboard.addDashboardItem(simulation_increment)
|
|
openspace.dashboard.addDashboardItem(distance)
|
|
openspace.dashboard.addDashboardItem(framerate)
|
|
openspace.dashboard.addDashboardItem(parallel_connection)
|
|
openspace.dashboard.addDashboardItem(mission)
|
|
openspace.dashboard.addDashboardItem(property_value)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.dashboard.removeDashboardItem(property_value)
|
|
openspace.dashboard.removeDashboardItem(mission)
|
|
openspace.dashboard.removeDashboardItem(parallel_connection)
|
|
openspace.dashboard.removeDashboardItem(framerate)
|
|
openspace.dashboard.removeDashboardItem(distance)
|
|
openspace.dashboard.removeDashboardItem(simulation_increment)
|
|
openspace.dashboard.removeDashboardItem(date)
|
|
openspace.dashboard.removeDashboardItem(angle)
|
|
end)
|
|
|
|
asset.export(property_value)
|
|
asset.export(mission)
|
|
asset.export(parallel_connection)
|
|
asset.export(framerate)
|
|
asset.export(distance)
|
|
asset.export(simulation_increment)
|
|
asset.export(date)
|
|
asset.export(angle)
|