diff --git a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp index 479dbd2e8..3cbe953b9 100644 --- a/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp +++ b/code/ryzom/server/src/entities_game_service/camera_animation_manager/camera_animation_modifiers.cpp @@ -36,7 +36,7 @@ public: std::string value; // We get the strength - if (!prim->getPropertyByName("duration", value)) + if (!prim->getPropertyByName("strength", value)) { nlwarning(" impossible to get the strength property of the basic modifier in primitive : %s", filename.c_str()); return false; @@ -50,4 +50,45 @@ public: return true; } }; -CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake"); \ No newline at end of file +CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake"); + +///////////////////////////////////////////////////////////////////////////// +/// This animation modifier plays a sound. The parameters are +/// - sound_name +/// - sound_position +class CCameraAnimationModifierSoundTrigger : public ICameraAnimationModifier +{ +protected: + std::string SoundName; + std::string SoundPos; + +public: + CCameraAnimationModifierSoundTrigger() + { + SoundName = ""; + SoundPos = ""; + } + + virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename) + { + std::string value; + + // We get the sound name + if (!prim->getPropertyByName("sound_name", value)) + { + nlwarning(" impossible to get the sound_name property of the basic modifier in primitive : %s", filename.c_str()); + return false; + } + SoundName = value; + // We get the sound position + if (!prim->getPropertyByName("sound_position", value)) + { + nlwarning(" impossible to get the sound_position property of the basic modifier in primitive : %s", filename.c_str()); + return false; + } + SoundPos = value; + + return true; + } +}; +CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierSoundTrigger, "sound_trigger"); \ No newline at end of file