DayZ 1.24
|
Manager class for managing Effect (EffectParticle, EffectSound) More...
Static Protected Attributes | |
static ref map< int, ref Effect > | m_EffectsMap |
Static map of all registered effects <id, Effect> | |
static ref array< int > | m_FreeEffectIDs |
Static array of IDs that were previously used, but freed up by unregistering. | |
static int | m_HighestFreeEffectID = 1 |
Counter for quickly getting the next ID if FreeEffectIDs array is empty. | |
static const int | INVALID_ID = 0 |
As the counter starts at 1, Effect ID can never be 0. | |
static bool | m_IsCleanup |
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed. | |
static bool | m_IsInitialized |
Bool to check whether Init was called. | |
static ref map< string, ref SoundParams > | m_ParamsMap |
Static map of cached sound params, to prevent having to recreate them. | |
static ref ScriptInvoker | Event_OnFrameUpdate |
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate. | |
Manager class for managing Effect (EffectParticle, EffectSound)
Definition at line 5 of file EffectManager.c.
Cleanup method to properly clean up the static data.
Definition at line 474 of file EffectManager.c.
References ErrorEx, Event_OnFrameUpdate, GetGame(), m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, m_ParamsMap, and Print().
Referenced by MissionBaseWorld::MissionBase(), and CGame::~CGame().
|
inlinestaticprotected |
Create an EffectSound.
sound_set | string The sound set name of the sound |
position | vector The position to play the sound |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
enviroment | bool Whether to set environment variables (Optional) |
EffectSound
The created EffectSound Definition at line 130 of file EffectManager.c.
References EffectRegister().
Referenced by HandleEngineSound(), FlashbangEffect::PlaySound(), PlaySound(), PlaySoundCachedParams(), PlaySoundEnviroment(), PlaySoundOnObject(), PlaySoundParams(), and UpdateMusic().
Unregisters, stops and frees the Effect.
effect_sound | EffectSound The EffectSound to free |
Definition at line 256 of file EffectManager.c.
Referenced by CleanupEffects(), CleanupSound(), Destroy(), ActionBuildShelter::DestroyActionLoopSound(), DestroySound(), EEDelete(), Roadflare::EEDelete(), ManBase::EEDelete(), House::EEDelete(), OnRingingStartClient(), OnRingingStopClient(), InventoryItem::OnRPC(), OnVariablesSynchronized(), ItemBase::OnWorkStop(), RemoveParticle(), ManBase::SetDecayEffects(), FlashbangEffect::StopSound(), KitchenTimer::TurnOff(), ItemBase::~BarbedWire(), ~Bottle_Base(), ~ClockBase(), DayZIntroSceneXbox::~DayZIntroSceneXbox(), ItemBase::~Defibrillator(), DestructionEffectBase::~DestructionEffectBase(), FireworksLauncher::~FireworksLauncher(), FireworksLauncherClientEvent::~FireworksLauncherClientEvent(), FlashbangEffect::~FlashbangEffect(), Inventory_Base::~HescoBox(), InventoryItem::~ItemBase(), ItemBase::~KitBase(), ~LandMineTrap(), ~LargeTent(), Backpack_Base::~LargeTentBackPack(), ManBase::~PlayerBase(), ItemBase::~PowerGeneratorBase(), ItemBase::~Spotlight(), ItemBase::~TentBase(), ~TrapBase(), and ItemBase::~TrapSpawnBase().
|
inlinestaticprotected |
Legacy, backwards compatibility.
sound_effect | EffectSound The EffectSound to free |
bool
A bool which is always true Definition at line 396 of file EffectManager.c.
References DestroyEffect().
Referenced by CleanSoundEffects(), CleanUpOnClosedClient(), and Land_Underground_Stairs_Exit::CleanUpOnClosedClient().
Registers Effect in SEffectManager.
effect | Effect The Effect to register |
int
The Effect ID Definition at line 307 of file EffectManager.c.
References ErrorEx, GetFreeEffectID(), m_EffectsMap, and m_IsCleanup.
Referenced by CreateSound(), PlayInWorld(), and PlayOnObject().
Unregisters Effect in SEffectManager.
id | int The ID of the Effect to unregister |
Definition at line 336 of file EffectManager.c.
References m_EffectsMap, m_FreeEffectIDs, and m_IsCleanup.
Referenced by EffectUnregisterEx(), and ~Effect().
Unregisters Effect in SEffectManager.
effect | Effect The Effect to unregister |
Definition at line 356 of file EffectManager.c.
References EffectUnregister().
Event called on frame.
time_delta | float Time passed since the previous frame |
Definition at line 443 of file EffectManager.c.
References Event_OnFrameUpdate.
|
inlinestaticprotected |
Event called from EffectSound.Event_OnSoundWaveEnded.
effect_sound | EffectSound The EffectSound calling the event |
Definition at line 431 of file EffectManager.c.
Referenced by EffectSound::Event_OnRegistered(), and EffectSound::Event_OnUnregistered().
|
inlinestaticprotected |
Get or create a cached SoundParams object.
soundset | string The sound set name of the sound |
SoundParams
The cached SoundParams for the given soundset Definition at line 407 of file EffectManager.c.
References m_ParamsMap.
Referenced by PlaySoundCachedParams().
Gets the Effect with the given registered Effect ID.
effect_id | int The Effect ID |
Effect
The Effect registered to the ID or null Definition at line 292 of file EffectManager.c.
References m_EffectsMap, and m_IsCleanup.
Helper function for EffectRegister to decide an Effect ID.
int
A currently unused Effect ID Definition at line 365 of file EffectManager.c.
References m_FreeEffectIDs, and m_HighestFreeEffectID.
Referenced by EffectRegister().
Initialize the containers.
Definition at line 460 of file EffectManager.c.
References Event_OnFrameUpdate, m_EffectsMap, m_FreeEffectIDs, m_IsInitialized, and m_ParamsMap.
Referenced by CGame::CGame().
Checks whether an Effect ID is registered in SEffectManager.
effect_id | int The Effect ID to check |
bool
Whether there is an Effect registered for this ID Definition at line 279 of file EffectManager.c.
References m_EffectsMap, and m_IsCleanup.
Referenced by CreateCarDestroyedEffect(), EOnPostSimulate(), and ManBase::SetDecayEffects().
Play an Effect.
eff | Effect The Effect to play |
pos | vector The position to play the Effect |
int
The registered ID of the Effect Definition at line 42 of file EffectManager.c.
References EffectRegister().
Referenced by Hit_MeatBones::BloodSplatGround(), CreateParticle(), ImpactMaterials::EvaluateImpactEffect(), ManBase::OnParticleEvent(), AmmoEffects::PlayAmmoEffect(), BleedingSourcesManagerBase::SetDiag(), DayZIntroSceneXbox::SetupParticles(), and Explosion::SpawnEffect().
|
inlinestaticprotected |
Play an Effect.
eff | Effect The Effect to play |
obj | Object The parent of the Effect |
local_pos | vector The local position to play the Effect in relation to the parent (Optional) |
local_ori | vector The local orientation to play the Effect in relation to the parent (Optional) |
force_rotation_relative_to_world | bool Whether to force the orientation to stay in WS (Optional) |
int
The registered ID of the Effect Definition at line 65 of file EffectManager.c.
References EffectRegister(), and ErrorEx.
Referenced by CreateCarDestroyedEffect(), EOnPostSimulate(), ManBase::SetDecayEffects(), and ItemBase::StartLoopSound().
|
inlinestaticprotected |
Create and play an EffectSound.
sound_set | string The sound set name of the sound |
position | vector The position to play the sound |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
EffectSound
The created EffectSound Definition at line 155 of file EffectManager.c.
References CreateSound().
Referenced by CGame::DelayedMidAirDetonation(), House::EEInit(), ItemBase::EEItemAttached(), ItemBase::EEItemDetached(), HandleDoorsSound(), HandleEngineSound(), HandleSeatAdjustmentSound(), CarScript::OnAnimationPhaseStarted(), Weapon::OnFireModeChange(), InventoryItem::OnRPC(), CGame::OnRPC(), OnSteppedOn(), InventoryItemSuper::OnWasAttached(), InventoryItemSuper::OnWasDetached(), SpookyEventBase::Perform(), ActionBuildShelter::PlayActionFinishSound(), ActionBuildShelter::PlayActionLoopSound(), ActionBuildShelter::PlayActionStartSound(), InventoryItem::PlayAttachSound(), InventoryItem::PlayDeployFinishSound(), ItemBase::PlayDeployLoopSound(), Inventory_Base::PlayDeployLoopSound(), InventoryItem::PlayDeployLoopSoundEx(), InventoryItem::PlayDeploySound(), PlayDisarmingLoopSound(), InventoryItem::PlayPlaceSound(), PlayRepackingLoopSound(), Backpack_Base::PlayRepackingLoopSound(), PlaySoundActivate(), TrapBase::PlaySoundBiteEmpty(), TrapBase::PlaySoundBiteLeg(), TrapBase::PlaySoundOpen(), Barrel_ColorBase::SoundBarrelClosePlay(), FireplaceBase::SoundBarrelClosePlay(), Barrel_ColorBase::SoundBarrelOpenPlay(), FireplaceBase::SoundBarrelOpenPlay(), Edible_Base::SoundCookingStart(), Entity::SoundHardBushFallingPlay(), Entity::SoundHardTreeFallingPlay(), Entity::SoundSoftBushFallingPlay(), Entity::SoundSoftTreeFallingPlay(), ItemBase::SoundTentClosePlay(), ItemBase::SoundTentCloseWindowPlay(), ItemBase::SoundTentOpenPlay(), ItemBase::SoundTentOpenWindowPlay(), and StartActivate().
|
inlinestaticprotected |
Create and play an EffectSound, using or creating cached SoundParams.
sound_set | string The sound set name of the sound |
position | vector The position to play the sound |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
EffectSound
The created EffectSound Definition at line 193 of file EffectManager.c.
References CreateSound(), and GetCachedSoundParam().
Referenced by PlaySoundEx().
|
inlinestaticprotected |
Create and play an EffectSound, updating environment variables.
sound_set | string The sound set name of the sound |
position | vector The position to play the sound |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
EffectSound
The created EffectSound Definition at line 214 of file EffectManager.c.
References CreateSound().
Referenced by ScriptConsoleSoundsTab::HandleKeys(), ScriptConsoleSoundsTab::OnClick(), and IEntity::PlaySoundSetAtMemoryPoint().
|
inlinestaticprotected |
Create and play an EffectSound.
sound_set | string The sound set name of the sound |
parent_object | Object The parent Object for the sound to follow |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
EffectSound
The created EffectSound Definition at line 233 of file EffectManager.c.
References CreateSound(), and vector::Zero.
Referenced by ItemBase::DischargeClient(), ManBase::EEHitByRemote(), ManBase::OnBleedingSourceAdded(), ItemBase::OnIsCharged(), ManBase::OnPlayerRecievedHit(), ItemBase::OnWorkStart(), PlayEmptyingLoopSound(), PlayPouringLoopSound(), PlaySound(), IEntity::PlaySoundSet(), and StopEmptyingLoopSound().
|
inlinestaticprotected |
Create and play an EffectSound.
params | SoundParams Params to create the sound with |
position | vector The position to play the sound |
play_fade_in | float The fade in duration of the sound (Optional) |
stop_fade_out | float The fade out duration of the sound (Optional) |
loop | bool Whether the sound should loop (Optional) |
EffectSound
The created EffectSound Definition at line 174 of file EffectManager.c.
References CreateSound().
Stops the Effect.
effect_id | int The ID of the Effect to Stop |
Definition at line 101 of file EffectManager.c.
References ErrorEx, and m_EffectsMap.
Referenced by EOnPostSimulate().
|
staticprotected |
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate.
Definition at line 24 of file EffectManager.c.
Referenced by Cleanup(), Event_OnFrameUpdate(), Init(), MissionBase::OnUpdate(), and SetEnableEventFrame().
As the counter starts at 1, Effect ID can never be 0.
Definition at line 14 of file EffectManager.c.
Referenced by Event_OnUnregistered().
Static map of all registered effects <id, Effect>
Definition at line 8 of file EffectManager.c.
Referenced by Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID(), Init(), IsEffectExist(), and Stop().
Static array of IDs that were previously used, but freed up by unregistering.
Definition at line 10 of file EffectManager.c.
Referenced by EffectUnregister(), GetFreeEffectID(), and Init().
|
staticprotected |
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
Definition at line 12 of file EffectManager.c.
Referenced by Cleanup(), and GetFreeEffectID().
|
staticprotected |
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
Definition at line 16 of file EffectManager.c.
Referenced by Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID(), and IsEffectExist().
|
staticprotected |
Bool to check whether Init was called.
Definition at line 18 of file EffectManager.c.
|
staticprotected |
Static map of cached sound params, to prevent having to recreate them.
Definition at line 21 of file EffectManager.c.
Referenced by Cleanup(), GetCachedSoundParam(), and Init().