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

Simple class for fading Widgets. More...

Private Member Functions

void WidgetFadeTimer ()
 
void FadeIn (Widget w, float time, bool continue_=false)
 Make "fade in" effect on Widget (transparency goes from 0.0 to 1.0)
 
void FadeOut (Widget w, float time, bool continue_=false)
 Make "fade out" effect on Widget (transparency goes from 1.0 to 0.0)
 
override private void OnTimer ()
 
override private void OnUpdate ()
 
void Timer (int category=CALL_CATEGORY_SYSTEM)
 
void Run (float duration, Managed obj, string fn_name, Param params=NULL, bool loop=false)
 Starts timer.
 
override protected void OnTimer ()
 
override void Stop ()
 

Private Attributes

private Widget m_widget
 
bool m_fadeIn
 
float m_alpha
 
protected Managed m_target
 
protected string m_function
 
protected 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 Show()
Definition DayZGame.c:162
ref Timer myTimer1
Definition PluginItemDiagnostic.c:46
void Refresh()
Definition SizeToChild.c:108
Definition DayZPlayerImplement.c:63

Member Function Documentation

◆ FadeIn()

void FadeIn ( Widget  w,
float  time,
bool  continue_ = false 
)
inlineprivate

Make "fade in" effect on Widget (transparency goes from 0.0 to 1.0)

Parameters
wwidget which will be faded
timeduration of effect
continue- if True continue from current alpha value, otherwise always begin from 0.0 alpha

References m_time, and OnStart().

◆ FadeOut()

void FadeOut ( Widget  w,
float  time,
bool  continue_ = false 
)
inlineprivate

Make "fade out" effect on Widget (transparency goes from 1.0 to 0.0)

Parameters
wwidget which will be faded
timeduration of effect
continue- if True continue from current alpha value, otherwise always begin from 1.0 alpha

References m_alpha, m_time, and OnStart().

◆ OnTimer() [1/2]

override private void OnTimer ( )
inlineprivate

Referenced by Tick().

◆ OnTimer() [2/2]

override protected void OnTimer ( )
inlineprivate

◆ OnUpdate()

override private void OnUpdate ( )
inlineprivate

References Math::Clamp(), Math::Lerp(), m_duration, and m_time.

Referenced by Tick().

◆ Run()

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

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.

References OnStart().

◆ Stop()

override void Stop ( )
inlineprivate

◆ Timer()

void Timer ( int  category = CALL_CATEGORY_SYSTEM)
inlineprivate

References OnInit().

◆ WidgetFadeTimer()

void WidgetFadeTimer ( )
inlineprivate

References CALL_CATEGORY_GUI, and OnInit().

Field Documentation

◆ m_alpha

float m_alpha
private

Referenced by FadeOut().

◆ m_fadeIn

bool m_fadeIn
private

◆ m_function

protected string m_function
private

◆ m_params

protected ref Param m_params
private

◆ m_target

protected Managed m_target
private

◆ m_widget

private Widget m_widget
private

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