| 461 | } |
| 462 | |
| 463 | static void LiveUpdate(SceneGraph* scenegraph, AssetManager* asset_manager, ScriptableUI* scriptable_ui) { |
| 464 | Input* input = Input::Instance(); |
| 465 | Graphics* graphics = Graphics::Instance(); |
| 466 | Engine* engine = Engine::Instance(); |
| 467 | |
| 468 | if (config.PrimarySourceModified()) { |
| 469 | config.Load(config.GetPrimaryPath()); |
| 470 | engine->SetGameSpeed(config["global_time_scale_mult"].toNumber<float>(), true); |
| 471 | input->SetFromConfig(config); |
| 472 | graphics->SetFromConfig(config, true); |
| 473 | ActiveCameras::Get()->SetAutoCamera(config["auto_camera"].toNumber<bool>()); |
| 474 | graphics->InitScreen(); |
| 475 | DebugDrawAux::Instance()->visible_sound_spheres = config["visible_sound_spheres"].toNumber<bool>(); |
| 476 | engine->GetSound()->SetMusicVolume(config["music_volume"].toNumber<float>()); |
| 477 | engine->GetSound()->SetMasterVolume(config["master_volume"].toNumber<float>()); |
| 478 | } |
| 479 | |
| 480 | ModLoading::Instance().Reload(); |
| 481 | AssetPreload::Instance().Reload(); |
| 482 | |
| 483 | Textures::Instance()->Reload(); |
| 484 | if (scenegraph) { |
| 485 | if (scenegraph->sky) { |
| 486 | scenegraph->sky->Reload(); |
| 487 | scenegraph->sky->LightingChanged(scenegraph->terrain_object_ != NULL); |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | asset_manager->Reload<Attack>(); |
| 492 | asset_manager->Reload<Reaction>(); |
| 493 | asset_manager->Reload<SyncedAnimationGroup>(); |
| 494 | asset_manager->Reload<Animation>(); |
| 495 | asset_manager->Reload<SoundGroup>(); |
| 496 | asset_manager->Reload<ParticleType>(); |
| 497 | asset_manager->Reload<Material>(); |
| 498 | asset_manager->Reload<Character>(); |
| 499 | asset_manager->Reload<Animation>(); |
| 500 | asset_manager->Reload<Item>(); |
| 501 | |
| 502 | if (scenegraph) { |
| 503 | scenegraph->SendMessageToAllObjects(OBJECT_MSG::RELOAD); |
| 504 | scenegraph->level->LiveUpdateCheck(); |
| 505 | scenegraph->particle_system->script_context_.Reload(); |
| 506 | } |
| 507 | if (scriptable_ui) { |
| 508 | scriptable_ui->Reload(); |
| 509 | } |
| 510 | AnimationRetargeter::Instance()->Reload(); |
| 511 | Shaders::Instance()->Reload(); |
| 512 | |
| 513 | ReloadImGui(); |
| 514 | } |
| 515 | |
| 516 | const char* CStrEngineStateType(const EngineStateType& state) { |
| 517 | switch (state) { |
no test coverage detected