mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
22 lines
1.0 KiB
Lua
22 lines
1.0 KiB
Lua
asset.onInitialize(function()
|
|
-- Disable the server, add production gui endpoint, and restart server.
|
|
-- The temporary disabling avoids restarting the server on each property change.
|
|
-- TODO: Add a trigger property to the module to restart the server "manually" and
|
|
-- remove automatic restart on each property change, since frequent restarting seems to
|
|
-- be unstable on MacOS.
|
|
|
|
local enabled = openspace.propertyValue("Modules.WebGui.ServerProcessEnabled")
|
|
openspace.setPropertyValueSingle("Modules.WebGui.ServerProcessEnabled", false)
|
|
|
|
local directories = openspace.propertyValue("Modules.WebGui.Directories")
|
|
directories[#directories + 1] = "screenshots"
|
|
directories[#directories + 1] = "${SCREENSHOTS}"
|
|
openspace.setPropertyValueSingle("Modules.WebGui.Directories", directories)
|
|
openspace.setPropertyValueSingle("Modules.WebGui.ServerProcessEnabled", enabled)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
-- TODO: Remove endpoints. As of 2019-10-29, OpenSpace sometimes
|
|
-- crashes when endpoints are removed while the application is closing.
|
|
end)
|