| 68 | } |
| 69 | |
| 70 | void NewSimulationDialog::onNewSimulation() |
| 71 | { |
| 72 | SimulationParameters parameters; |
| 73 | if (_adoptSimulationParameters) { |
| 74 | parameters = _simulationFacade->getSimulationParameters(); |
| 75 | } |
| 76 | for (int i = 0; i < ProjectNameSize; ++i) { |
| 77 | parameters.projectName[i] = _projectName[i]; |
| 78 | } |
| 79 | _simulationFacade->closeSimulation(); |
| 80 | |
| 81 | GeneralSettings generalSettings; |
| 82 | generalSettings.worldSizeX = _width; |
| 83 | generalSettings.worldSizeY = _height; |
| 84 | _simulationFacade->newSimulation(0, generalSettings, parameters); |
| 85 | Viewport::get().setCenterInWorldPos({toFloat(_width) / 2, toFloat(_height) / 2}); |
| 86 | Viewport::get().setZoomFactor(4.0f); |
| 87 | TemporalControlWindow::get().onSnapshot(); |
| 88 | } |
nothing calls this directly
no test coverage detected