mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-21 18:38:20 -05:00
distinguish between local and remote scripting
This commit is contained in:
@@ -155,7 +155,7 @@ void addScreenSpaceRenderable(std::string texturePath) {
|
||||
std::string luaTable =
|
||||
"{Type = 'ScreenSpaceImage', TexturePath = '" + absPath(texturePath) + "' }";
|
||||
std::string script = "openspace.registerScreenSpaceRenderable(" + luaTable + ");";
|
||||
OsEng.scriptEngine().queueScript(script);
|
||||
OsEng.scriptEngine().queueScript(script, openspace::scripting::ScriptEngine::RemoteScripting::Yes);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -453,22 +453,26 @@ void GUI::render() {
|
||||
|
||||
if (toSun) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun');"
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
if (toPluto) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');"
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
if (toJupiter) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');"
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
if (to67P) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', '67P');"
|
||||
"openspace.setPropertyValue('Interaction.coordinateSystem', '67P');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ void GuiOriginComponent::render() {
|
||||
if (hasChanged) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('Interaction.origin', '" +
|
||||
nodes[currentPosition]->name() + "');"
|
||||
nodes[currentPosition]->name() + "');",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ void GuiTimeComponent::render() {
|
||||
bool changed = ImGui::SliderFloat("Delta Time", &deltaTime, -5000.f, 5000.f);
|
||||
if (changed) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")"
|
||||
"openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void renderTooltip(Property* prop) {
|
||||
void executeScript(const std::string& id, const std::string& value) {
|
||||
std::string script =
|
||||
"openspace.setPropertyValueSingle('" + id + "', " + value + ");";
|
||||
OsEng.scriptEngine().queueScript(script);
|
||||
OsEng.scriptEngine().queueScript(script, scripting::ScriptEngine::RemoteScripting::Yes);
|
||||
}
|
||||
|
||||
void renderBoolProperty(Property* prop, const std::string& ownerName) {
|
||||
|
||||
Reference in New Issue
Block a user