PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
ScriptCallQueue Class Reference

ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage: More...

Private Member Functions

proto native void Tick (float timeslice)
 executes calls on queue if their time is already elapsed, if 'repeat = false' call is removed from queue
 
proto void Call (func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
 adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)
 
proto void CallByName (Class obj, string fnName, Param params=NULL)
 adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)
 
proto void CallLater (func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
 adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)
 
proto void CallLaterByName (Class obj, string fnName, int delay=0, bool repeat=false, Param params=NULL)
 adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)
 
proto void Remove (func fn)
 remove specific call from queue
 
proto int GetRemainingTime (func fn)
 return Remaining time to the call execution (in miliseconds)
 
proto void RemoveByName (Class obj, string fnName)
 remove specific call from queue
 
proto int GetRemainingTimeByName (Class obj, string fnName)
 return Remaining time to the call execution (in miliseconds)
 
proto native void Clear ()
 remove all calls from queue
 

Detailed Description

ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage:

class Arkanoid extends Game
{
ref ScriptCallQueue m_CallQueue = new ScriptCallQueue();
ScriptCallQueue GetCallQueue() {
return m_CallQueue;
}
override void OnUpdate(float timeslice)
{
m_CallQueue.Tick(timeslice);
...
}
...
}
class MyObject
{
int m_cnt = 0;
void Hello(int p1, string p2)
{
Print("Hello( " + p1 + " , " + p2 + ")");
}
void Test()
{
Print(m_cnt);
m_cnt++;
if (m_cnt > 10)
{
queue.Remove(Test);
}
}
}
void Test(MyObject obj)
{
queue.CallLater(obj.Hello, 5000, false, 65, "world"); // adds call 'obj.Hello(65, "world")' into queue, and it will be executed once after 5s
queue.CallLater(obj.Test, 3000, true); // adds call 'obj.Test()' into queue, and it will be executed each 3s
queue.Call(obj.Hello, 72, "world 2"); // adds call 'obj.Hello(72, "world 2")' into queue, and it will be executed next frame (on next call of ScriptCallQueue.Tick)
}
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1187
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition tools.c:53
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Remove(func fn)
remove specific call from queue
Attribute used for tests annotation and assignment to Suites.
Definition TestingFramework.c:97
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
proto native void OnUpdate()
Definition tools.c:349

Member Function Documentation

◆ Call()

proto void Call ( func  fn,
void  param1 = NULL,
void  param2 = NULL,
void  param3 = NULL,
void  param4 = NULL,
void  param5 = NULL,
void  param6 = NULL,
void  param7 = NULL,
void  param8 = NULL,
void  param9 = NULL 
)
private

◆ CallByName()

proto void CallByName ( Class  obj,
string  fnName,
Param  params = NULL 
)
private

adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)

Referenced by PluginBase::OnRPCSyncSceneObject(), and UIScriptedMenu::Play().

◆ CallLater()

proto void CallLater ( func  fn,
int  delay = 0,
bool  repeat = false,
void  param1 = NULL,
void  param2 = NULL,
void  param3 = NULL,
void  param4 = NULL,
void  param5 = NULL,
void  param6 = NULL,
void  param7 = NULL,
void  param8 = NULL,
void  param9 = NULL 
)
private

adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)

Referenced by Ammo_40mm_Smoke_ColorBase::Activate(), Grenade_Base::ActivateRandomTime(), Entity::CheckForDestroy(), BaseBuildingBase::CloseFence(), ScriptConsoleEnfScriptTab::ColorRunButton(), DayZIntroSceneXbox::CreateRandomCharacter(), Component::DebugBBoxDraw(), Component::DebugDirectionDraw(), VicinitySlotsContainer::DoubleClick(), DynamicArea_Flare::DynamicArea_Flare(), Clothing_Base::EEHealthLevelChanged(), ManBase::EEHealthLevelChanged(), EEHitBy(), ItemBase::EEInit(), EEInit(), ManBase::EEItemAttached(), FlammableBase::EEItemDetached(), ManBase::EEItemDetached(), Entity::EEKilled(), Ammo_40mm_Explosive::EEKilled(), ItemBase::EEOnAfterLoad(), Entity::EntityAI(), TerritoryFlag::FullyBuild(), HandleEngineSound(), HandleSoundEffectsPipeCreaking(), Init(), UIScriptedMenu::Init(), InitZoneServer(), Interact(), Land_Underground_EntranceBase::Land_Underground_EntranceBase(), ScriptedWidgetEventHandler::LoadVideo(), MissionBase::MissionServer(), OnActivate(), DrowningMdfr::OnActivate(), ImprovisedExplosive::OnActivatedByItem(), ClaymoreMine::OnArmed(), MissionBase::OnClientDisconnectedEvent(), ZombieMaleBase::OnDamageDestroyed(), Grenade_ChemGas::OnDamageDestroyed(), BoatScript::OnEngineStop(), FireworksLauncherClientEvent::OnExplode(), OnExplode(), ActionDestroyCombinationLock::OnFinishProgressServer(), FireworksLauncher::OnFuseIgnitedServer(), BiosSessionService::OnGetSessionError(), DestructionEffectBase::OnHealthLevelChanged(), FireplaceBase::OnIgnitedThis(), MissionBase::OnInputBufferEvent(), CGame::OnLoginTimeEvent(), Land_Underground_Panel_Lever::OnPanelUsedSynchronized(), ItemBase::OnPartBuiltServer(), ItemBase::OnPartDestroyedServer(), ItemBase::OnPartDismantledServer(), OnPlacementComplete(), ItemBase::OnPlacementComplete(), ScriptedWidgetEventHandler::OnPlaybackStart(), ManBase::OnPlayerLoaded(), CGame::OnRespawnEvent(), CGame::OnRPC(), OnStartServer(), ItemBase::OnVariablesSynchronized(), Torch_Video::OnWorkStart(), BaseBuildingBase::OpenFence(), OutdoorThermometer(), MissionBase::PlayerDisconnected(), ManBase::RefreshHandAnimationState(), ItemBase::RegenerateNavmesh(), UndergroundTriggerCarrierBase::RequestDelayedTriggerSpawn(), Land_Underground_EntranceBase::RequestLatentTransition(), FireworksLauncherClientEvent::RequestSecondaryExplosion(), DayZPlayer::ShowDeadScreen(), ManBase::SpawnDrowningBubbles(), PluginBase::SpawnEntityInPlayerInventory(), CrashBase::SpawnRandomDeerLater(), StartFire(), InventoryItem::StartItemSoundServer(), MissionBase::StartLogoutMenu(), StopFire(), InventoryItem::StopItemSoundServer(), Synchronize(), ToggleDebugWindowEvent(), VicinitySlotsContainer::TransferItem(), Entity::TryDelete(), ItemBase::UpdateNavmesh(), and UpdateVisuals().

◆ CallLaterByName()

proto void CallLaterByName ( Class  obj,
string  fnName,
int  delay = 0,
bool  repeat = false,
Param  params = NULL 
)
private

adds call into the queue with given parameters and arguments (arguments are held in memory until the call is executed/removed or ScriptCallQueue is destroyed)

Referenced by ImprovisedExplosive::OnActivatedByItem(), Play(), and UniversalTemperatureSourceDebug::SetDefferedActive().

◆ Clear()

proto native void Clear ( )
private

remove all calls from queue

◆ GetRemainingTime()

proto int GetRemainingTime ( func  fn)
private

return Remaining time to the call execution (in miliseconds)

◆ GetRemainingTimeByName()

proto int GetRemainingTimeByName ( Class  obj,
string  fnName 
)
private

return Remaining time to the call execution (in miliseconds)

◆ Remove()

◆ RemoveByName()

proto void RemoveByName ( Class  obj,
string  fnName 
)
private

remove specific call from queue

Referenced by Stop().

◆ Tick()

proto native void Tick ( float  timeslice)
private

executes calls on queue if their time is already elapsed, if 'repeat = false' call is removed from queue

Referenced by CGame::OnUpdate().


The documentation for this class was generated from the following file: