sim: add ability to add prefabs. Also added cmd comment

This commit is contained in:
openshwprojects
2022-12-05 12:49:32 +01:00
parent 1cbebe7ee8
commit 22c432f85e
9 changed files with 107 additions and 27 deletions

View File

@@ -248,6 +248,15 @@ bool CSimulator::createSimulation(bool bDemo) {
return false;
}
bool CSimulator::beginAddingPrefab(const char *s) {
CShape *newShape = prefabs->instantiatePrefab(s);
if (newShape == 0) {
return true;
}
newShape->setPosition(80, 80);
sim->addObject(newShape);
return false;
}
bool CSimulator::loadSimulation(const char *s) {
CString fixed;
if (FS_Exists(s) == false) {