| 679 | |
| 680 | SArtefactDetectorsSupport::~SArtefactDetectorsSupport() { m_sound.destroy(); } |
| 681 | void SArtefactDetectorsSupport::SetVisible(bool b) |
| 682 | { |
| 683 | m_switchVisTime = Device.dwTimeGlobal; |
| 684 | if (b == !!m_parent->getVisible()) |
| 685 | return; |
| 686 | |
| 687 | if (b) |
| 688 | m_parent->StartLights(); |
| 689 | else |
| 690 | m_parent->StopLights(); |
| 691 | |
| 692 | if (b) |
| 693 | { |
| 694 | LPCSTR curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b) ? "det_show_particles" : "det_hide_particles"); |
| 695 | |
| 696 | IKinematics* K = smart_cast<IKinematics*>(m_parent->Visual()); |
| 697 | R_ASSERT2(K, m_parent->cNameSect().c_str()); |
| 698 | LPCSTR bone = pSettings->r_string(m_parent->cNameSect().c_str(), "particles_bone"); |
| 699 | u16 bone_id = K->LL_BoneID(bone); |
| 700 | R_ASSERT2(bone_id != BI_NONE, bone); |
| 701 | |
| 702 | m_parent->CParticlesPlayer::StartParticles(curr, bone_id, Fvector().set(0, 1, 0), m_parent->ID()); |
| 703 | |
| 704 | curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b) ? "det_show_snd" : "det_hide_snd"); |
| 705 | m_sound.create(curr, st_Effect, sg_SourceType); |
| 706 | m_sound.play_at_pos(0, m_parent->Position(), 0); |
| 707 | } |
| 708 | |
| 709 | m_parent->setVisible(b); |
| 710 | m_parent->SwitchAfParticles(b); |
| 711 | } |
| 712 | |
| 713 | void SArtefactDetectorsSupport::Blink() |
| 714 | { |
no test coverage detected