Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
TimerBase Class Reference

Simple class for fading Widgets. More...

Inheritance diagram for TimerBase:
AnimationTimer

Protected Member Functions

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

Protected Attributes

string m_function
ref Param m_params
Managed m_target

Private Member Functions

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).
void OnTimer ()
void OnUpdate ()
void WidgetFadeTimer ()

Private Attributes

float m_alpha
bool m_fadeIn
Widget m_widget

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

◆ 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

Definition at line 445 of file tools.c.

References m_alpha, m_fadeIn, m_time, m_widget, 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

Definition at line 480 of file tools.c.

References m_alpha, m_fadeIn, m_time, m_widget, and OnStart().

◆ OnTimer() [1/2]

void OnTimer ( )
inlineprotected

Definition at line 604 of file tools.c.

References g_Game, m_function, m_params, and m_target.

◆ OnTimer() [2/2]

void OnTimer ( )
inlineprivate

Definition at line 509 of file tools.c.

References m_fadeIn, and m_widget.

Referenced by Tick().

◆ OnUpdate()

void OnUpdate ( )
inlineprivate

Definition at line 525 of file tools.c.

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

Referenced by Tick().

◆ Run()

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

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.

References m_function, m_params, m_target, and OnStart().

◆ Stop()

override void Stop ( )
inlineprotected

Definition at line 617 of file tools.c.

References m_params.

◆ Timer()

void Timer ( int category = CALL_CATEGORY_SYSTEM)
inlineprotected

Definition at line 582 of file tools.c.

References CALL_CATEGORY_SYSTEM, and OnInit().

◆ WidgetFadeTimer()

void WidgetFadeTimer ( )
inlineprivate

Definition at line 433 of file tools.c.

References CALL_CATEGORY_GUI, m_fadeIn, and OnInit().

Field Documentation

◆ m_alpha

float m_alpha
private

Definition at line 431 of file tools.c.

Referenced by FadeIn(), FadeOut(), and OnUpdate().

◆ m_fadeIn

bool m_fadeIn
private

Definition at line 430 of file tools.c.

Referenced by FadeIn(), FadeOut(), OnTimer(), OnUpdate(), and WidgetFadeTimer().

◆ m_function

string m_function
protected

Definition at line 579 of file tools.c.

Referenced by OnTimer(), and Run().

◆ m_params

ref Param m_params
protected

Definition at line 580 of file tools.c.

Referenced by OnTimer(), Run(), and Stop().

◆ m_target

Managed m_target
protected

Definition at line 578 of file tools.c.

Referenced by OnTimer(), and Run().

◆ m_widget

Widget m_widget
private

Definition at line 429 of file tools.c.

Referenced by FadeIn(), FadeOut(), OnTimer(), and OnUpdate().


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/3_game/tools/tools.c