MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ApplyScriptParams

Method ApplyScriptParams

Source/Editors/map_editor.cpp:1570–1588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1568}
1569
1570void MapEditor::ApplyScriptParams(const ScriptParamMap& spm, int id) {
1571 if (id == LEVEL_PARAM_ID) {
1572 if (!testScriptParamsEqual(spm, scenegraph_->level->script_params().GetParameterMap())) {
1573 SceneGraph::ApplyScriptParams(scenegraph_, spm);
1574 QueueSaveHistoryState();
1575 }
1576 } else {
1577 Object* obj = scenegraph_->GetObjectFromID(id);
1578 if (obj) {
1579 const ScriptParamMap& new_spm = spm;
1580 ScriptParamMap::iterator iter;
1581
1582 if (!testScriptParamsEqual(new_spm, obj->GetScriptParamMap())) {
1583 obj->SetScriptParams(new_spm);
1584 QueueSaveHistoryState();
1585 }
1586 }
1587 }
1588}
1589
1590OGPalette* MapEditor::GetPalette(int id) {
1591 Object* obj = scenegraph_->GetObjectFromID(id);

Callers

nothing calls this directly

Calls 3

testScriptParamsEqualFunction · 0.85
GetObjectFromIDMethod · 0.80
SetScriptParamsMethod · 0.45

Tested by

no test coverage detected