DayZ Enforce
Script API
Private Member Functions | Private Attributes | List of all members
CallQueue Class Reference

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

#include <tools.h>

Inheritance diagram for CallQueue:
DragQueue

Private Member Functions

void  CallQueue ()
 
void  ~CallQueue ()
 
void  Tick ()
  System function, don't call it. More...
 
void  Call (class obj, string fn_name, Param params=NULL)
  Creates new call request, add it on queue and execute during frame update (depends on call category) More...
 
void  RemoveCalls (class obj)
  Removes all queued calls for object (call this function when object is going to be deleted) More...
 

Private Attributes

private bool  m_processing
 

Detailed Description

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

GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Refresh"); // calls "Refresh" function on "this" with no arguments
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Show", new Param1<bool>(true)); // calls "Show" function on "this" with one bool argument
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "SetPos", new Param2<float, float>(0.2, 0.5)); // calls "SetPos" function on "this" with two float arguments

Constructor & Destructor Documentation

void CallQueue::CallQueue ( )
private

References m_processing.

void CallQueue::~CallQueue ( )
private

Member Function Documentation

void CallQueue::Tick ( )
private

System function, don't call it.

References CallQueueContext::Call(), CallQueueContext::IsValid(), and m_processing.

Referenced by DayZGame::OnUpdate().

void CallQueue::Call ( class obj  ,
string  fn_name,
Param  params = NULL 
)
private

Creates new call request, add it on queue and execute during frame update (depends on call category)

Parameters
obj target object on which function will be executed
fn_name name of function (on object "obj") which will be executed
params function arguments see Param for usage, default NULL (no arguments)
Warning
When object "obj" is deleted prior call execution, don't forget to remove calls for this object with RemoveCalls

Referenced by Object::AddDamage(), LoadingScreen::Dec(), EntityAI::Delete(), EnableFreeCamera(), Crafting_WoodenStick::OnAction(), InGameMenu::OnClick(), MainMenu::OnClick(), OptionsMenu::OnClick(), InventoryMenu::OnDoubleClick(), DayZGame::OnEvent(), InGameMenu::OnModalResult(), OptionsMenu::OnModalResult(), ContextMenu::OnMouseButtonDown(), and ModuleSceneEditor::OnUIEditorOpened().

void CallQueue::RemoveCalls ( class obj  )
private

Removes all queued calls for object (call this function when object is going to be deleted)

Parameters
obj object for which you want remove all "lazy" calls

References CallQueueContext::Invalidate().

Referenced by ChatInputMenu::~ChatInputMenu(), DayZIntroScene::~DayZIntroScene(), InGameMenu::~InGameMenu(), InspectMenu::~InspectMenu(), MainMenu::~MainMenu(), MissionBase::~MissionBase(), and OptionsMenu::~OptionsMenu().

Member Data Documentation

private bool CallQueue::m_processing
private

Referenced by CallQueue(), Tick(), and DragQueue::Tick().


The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)