mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 02:29:49 -06:00
Create lua function to show or hide all targets and browsers
This commit is contained in:
@@ -434,7 +434,8 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const {
|
||||
codegen::lua::StartFinetuningTarget,
|
||||
codegen::lua::FinetuneTargetPosition,
|
||||
codegen::lua::ScrollOverBrowser,
|
||||
codegen::lua::LoadingImageCollectionComplete
|
||||
codegen::lua::LoadingImageCollectionComplete,
|
||||
codegen::lua::ShowAllTargetsAndBrowsers
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -735,6 +735,20 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide all targets and browsers
|
||||
* \param identifier Identifier of the sky browser
|
||||
* \param show Sets if the targets and browsers should be enabled or disabled
|
||||
*/
|
||||
[[codegen::luawrap]] void showAllTargetsAndBrowsers(bool show) {
|
||||
using namespace openspace;
|
||||
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
|
||||
const std::vector<std::unique_ptr<TargetBrowserPair>>& pairs = module->getPairs();
|
||||
for (const std::unique_ptr<TargetBrowserPair>& pair : pairs) {
|
||||
pair->setEnabled(show);
|
||||
}
|
||||
}
|
||||
|
||||
#include "skybrowsermodule_lua_codegen.cpp"
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -123,7 +123,7 @@ void TargetBrowserPair::synchronizeAim() {
|
||||
|
||||
void TargetBrowserPair::setEnabled(bool enable) {
|
||||
_browser->setEnabled(enable);
|
||||
_targetRenderable->property("Enabled")->set(false);
|
||||
_targetRenderable->property("Enabled")->set(enable);
|
||||
}
|
||||
|
||||
void TargetBrowserPair::setOpacity(float opacity) {
|
||||
|
||||
Reference in New Issue
Block a user