|
Dayz
1.11.153731
Dayz Code Explorer by Zeroy
|
Go to the documentation of this file.
80 if (m_processing)
return;
122 for (
int i =
Count() - 1; i >= 0; i--)
159 m_mouse_params =
new Param3<int, int, bool>(0,0,
true);
167 if (m_processing)
return;
174 bool is_holding =
false;
184 if (!is_holding || mouse_x != m_mouse_params.param1 || mouse_y != m_mouse_params.param2)
186 m_mouse_params.param1 = mouse_x;
187 m_mouse_params.param2 = mouse_y;
188 m_mouse_params.param3 = is_holding;
190 while (
Count() > last_index)
192 ctx =
Get(last_index);
211 m_processing =
false;
327 protected void OnStart(
float duration,
bool loop)
369 class TimerQueue
extends array<TimerBase>
376 m_processing =
false;
384 for (
int i =
Count() - 1; i >= 0; i--)
386 Get(i).OnTimerQueueDestoryed();
396 if (m_processing)
return;
402 for (
int i =
Count() - 1; i >= 0; i--)
404 Get(i).Tick(timeslice);
408 m_processing =
false;
436 float alpha = w.GetAlpha();
438 if (continue_ && alpha > 0.95)
452 alpha = m_widget.GetAlpha();
453 m_widget.SetAlpha(0);
471 m_alpha = w.GetAlpha();
473 if (continue_ && m_alpha < 0.05)
485 if (m_widget && !continue_)
488 m_widget.SetAlpha(m_alpha);
504 m_widget.SetAlpha(1);
508 m_widget.SetAlpha(0);
509 m_widget.Show(
false);
517 float progress =
Math.
Max( 0.0, timeDiff );
523 m_widget.SetAlpha( timeDiff );
527 m_widget.SetAlpha( m_alpha - timeDiff );
582 void Run(
float duration,
Managed obj,
string fn_name,
Param params = NULL,
bool loop =
false)
585 m_function = fn_name;
714 float step =
m_time * timeslice;
766 index = m_keys.Find(key);
782 index = m_keys.Find(key);
787 return m_values.Get(index);
795 return m_values.Get(index);
800 return m_keys.Get(index);
809 m_keys =
new array<K>;
810 m_values =
new array<ref array<V> >;
814 index = m_keys.Find(key);
819 array<V> value_array =
new array<V>;
820 value_array.Insert(value);
823 m_values.Insert(value_array);
828 m_values.Get(index).Insert(value);
834 m_keys.Remove(index);
835 m_values.Remove(index);
843 index = m_keys.Find(key);
848 RemoveByIndex(index);
856 return m_keys.Count();
864 if ( m_keys && m_values)
887 if ( temperature < 20 )
889 temperature = temperature - 20;
890 temperature =
Math.
Clamp( temperature, -50, 50);
893 red =
Math.
Clamp ( red - ((red/50 )*temperature), 0, 255 );
894 green =
Math.
Clamp ( green - ((green/50 )*temperature), 0, 255 );
895 blue =
Math.
Clamp ( blue+((blue/50)*temperature), 0, 255 );
897 else if ( temperature > 20 )
899 temperature =
Math.
Clamp( temperature, -100, 100);
900 blue =
Math.
Clamp ( blue - ((blue/100 )*temperature), 0, 255 );
901 green =
Math.
Clamp ( green - ((green/100 )*temperature), 0, 255 );
902 red =
Math.
Clamp ( red+((red/100)*temperature), 0, 255 );
905 int color =
ARGB( alpha, red, green, blue );
915 if (value ==
"true" || value ==
"1")
946 i = i - ((i >> 1) & 0x55555555);
947 i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
948 return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
proto native CGame GetGame()
void Insert(K key, V value)
override protected void OnTimer()
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)
Base Param Class with no parameters.
protected ref Param m_params
void Remove(Object object)
static float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
void Tick(float timeslice)
void FadeIn(Widget w, float time, bool continue_=false)
Make "fade in" effect on Widget (transparency goes from 0.0 to 1.0)
proto void GetMousePos(out int x, out int y)
DragQueue Class provide callbacks while mouse is dragging.
proto static native float Sin(float angle)
Returns sinus of angle in radians.
array< V > GetByIndex(int index)
void Timer(int category=CALL_CATEGORY_SYSTEM)
void FadeOut(Widget w, float time, bool continue_=false)
Make "fade out" effect on Widget (transparency goes from 1.0 to 0.0)
void Tick(float timeslice)
Ticks the timer, is called by timer subsystem.
proto volatile int CallFunction(Class inst, string function, out void returnVal, void parm)
dynamic call of function when inst == NULL, it's global function call, otherwise it's method of class...
Simple class for fading Widgets.
private ref array< ref array< V > > m_values
proto volatile int CallFunctionParams(Class inst, string function, out void returnVal, Class parms)
void Tick()
System function, don't call it.
protected Managed m_target
private bool m_processing
float GetValue()
Returns actual animated value.
void Run(float duration, Managed obj, string fn_name, Param params=NULL, bool loop=false)
Starts timer.
private float m_target_value
proto native int GetMouseState(MouseState index)
Returns state of mouse button.
TimerQueue GetTimerQueue(int call_category)
Returns TimerQueue for certain category.
void SetValue(float val)
Sets both value and target value.
void RemoveCalls(Class obj)
Removes all queued calls for object (call this function when object is going to be deleted)
void RemoveByIndex(int index)
static float Max(float x, float y)
Returns bigger of two given values.
array< ref PlayerStatBase > Get()
private ref array< K > m_keys
override void Tick()
System function, don't call it.
void Animate(float val, float speed=1.0)
Starts animate value until value reaches target value.
override private void OnUpdate()
override private void OnTimer()
float GetTargetValue()
Returns target value.
void AnimateLoop(float speed=1.0)
Starts infinite animation loop <-1,1>.
void CallQueueContext(Class target, string fn, Param params)
K GetKeyByIndex(int index)
private bool m_processing
proto static native float AbsFloat(float f)
Returns absolute value.
proto native void SetProfileString(string name, string value)
Sets string to profile variable.
TimerQueue Class using for system purpose only.
Super root of all classes in Enforce script.
void CallParams(Param params)
int ARGB(int a, int r, int g, int b)
protected string m_function
proto static native int AbsInt(int i)
Returns absolute value.
private ref Param3< int, int, bool > m_mouse_params