mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-07 21:08:33 -06:00
Delete ScreenSpaceCygnet with lua script
This commit is contained in:
@@ -271,7 +271,6 @@ void DataPlane::readHeader(std::string& dataBuffer){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_dataOptions.setValue(std::vector<int>(1,0));
|
||||
|
||||
if(_data->groupId > 0)
|
||||
|
||||
@@ -56,6 +56,13 @@ ScreenSpaceCygnet::ScreenSpaceCygnet(const ghoul::Dictionary& dictionary)
|
||||
_lastUpdateRealTime = _realTime;
|
||||
_minRealTimeUpdateInterval = 100;
|
||||
|
||||
_delete.onChange([this](){
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.iswa.removeScreenSpaceCygnet("+std::to_string(_cygnetId)+");"
|
||||
);
|
||||
});
|
||||
// IswaManager::ref().deleteIswaCygnet(name());});
|
||||
|
||||
}
|
||||
|
||||
ScreenSpaceCygnet::~ScreenSpaceCygnet(){}
|
||||
|
||||
@@ -94,6 +94,9 @@ int iswa_removeScrenSpaceCygnet(lua_State* L){
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto info = cygnetInformation[id];
|
||||
info->selected = false;
|
||||
|
||||
std::string script = "openspace.unregisterScreenSpaceRenderable('" + cygnetInformation[id]->name + "');";
|
||||
OsEng.scriptEngine().queueScript(script);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user