Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
TimerBase Class Reference

Simple class for fading Widgets. More...

Inheritance diagram for TimerBase:
AnimationTimer

Protected Member Functions

void Timer (int category=CALL_CATEGORY_SYSTEM)
void Run (float duration, Managed obj, string fn_name, Param params=NULL, bool loop=false)
 Starts timer.
void OnTimer ()
override void Stop ()

Protected Attributes

Managed m_target
string m_function
ref Param m_params

Detailed Description

Simple class for fading Widgets.

Timer class. Use when you want call function after some time, or repeatedly in time intervals. Call is not executed after the Timer object is deleted.
usage:

class MyObject
{
ref Timer myTimer2;
ref Timer myTimer3;
void MyObject()
{
myTimer1 = new Timer();
myTimer1.Run(10, this, "Refresh"); // calls "Refresh" on "this" after 10 seconds
myTimer2 = new Timer();
myTimer2.Run(10, this, "Refresh", NULL, true); // calls "Refresh" on "this" every 10 seconds, until Pause or Stop is called
myTimer3 = new Timer();
myTimer3.Run(15, this, "Show", new Param1<bool>(false)); // calls "Show" on "this" with one bool argument after 15 seconds
}
void Refresh();
void Show(bool visible);
}
void Timer(int category=CALL_CATEGORY_SYSTEM)
Definition tools.c:582
void Show()
Definition dayzgame.c:163
ref Timer myTimer1
void Refresh()

Definition at line 427 of file tools.c.

Member Function Documentation

◆ OnTimer()

void TimerBase::OnTimer ( )
protected

Definition at line 604 of file tools.c.

◆ Run()

void TimerBase::Run ( float duration,
Managed obj,
string fn_name,
Param params = NULL,
bool loop = false )
protected

Starts timer.

Parameters
durationfunction is executed after this time (in seconds).
objtarget object on which function will be executed
fn_namename of function (on object "obj") which will be executed
paramsfunction arguments see Param for usage, default NULL (no arguments)
loopwhen true, timer is looped endlessly and function is executed after every loop.

Definition at line 595 of file tools.c.

◆ Stop()

override void TimerBase::Stop ( )
protected

Definition at line 617 of file tools.c.

◆ Timer()

void TimerBase::Timer ( int category = CALL_CATEGORY_SYSTEM)
protected

Definition at line 582 of file tools.c.

Member Data Documentation

◆ m_function

string TimerBase::m_function
protected

Definition at line 579 of file tools.c.

◆ m_params

ref Param TimerBase::m_params
protected

Definition at line 580 of file tools.c.

◆ m_target

Managed TimerBase::m_target
protected

Definition at line 578 of file tools.c.


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