| 1481 | } |
| 1482 | |
| 1483 | void ScriptModule::SetUpFromSaveData() |
| 1484 | { |
| 1485 | if (mModuleSaveData.GetBool("execute_on_init")) |
| 1486 | { |
| 1487 | mInitExecutePriority = mModuleSaveData.GetInt("init_execute_priority"); |
| 1488 | sScriptsRequestingInitExecution.insert(std::lower_bound(sScriptsRequestingInitExecution.begin(), |
| 1489 | sScriptsRequestingInitExecution.end(), |
| 1490 | this, |
| 1491 | [](const ScriptModule* left, const ScriptModule* right) |
| 1492 | { |
| 1493 | return left->mInitExecutePriority < right->mInitExecutePriority; |
| 1494 | }), |
| 1495 | this); |
| 1496 | } |
| 1497 | |
| 1498 | mCodeEntry->SetDoSyntaxHighlighting(mModuleSaveData.GetBool("syntax_highlighting")); |
| 1499 | |
| 1500 | std::string styleName = mModuleSaveData.GetString("style"); |
| 1501 | for (auto i = 0; i < sStyleJSON.size(); ++i) |
| 1502 | { |
| 1503 | try |
| 1504 | { |
| 1505 | if (sStyleJSON[i]["name"].asString() == styleName) |
| 1506 | mCodeEntry->SetStyleFromJSON(sStyleJSON[i]); |
| 1507 | } |
| 1508 | catch (Json::LogicError& e) |
| 1509 | { |
| 1510 | TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error); |
| 1511 | } |
| 1512 | } |
| 1513 | |
| 1514 | mHotloadScripts = mModuleSaveData.GetBool("hotload_script_files"); |
| 1515 | mDrawBoundModuleConnections = mModuleSaveData.GetBool("draw_bound_module_connections"); |
| 1516 | } |
| 1517 | |
| 1518 | void ScriptModule::SaveLayout(ofxJSONElement& moduleInfo) |
| 1519 | { |
nothing calls this directly
no test coverage detected