DayZ 1.24
Loading...
Searching...
No Matches
Tools

Classes

class  Param
 Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Param4 templates. More...
 
class  Param7< Class T1, Class T2, Class T3, Class T4, Class T5, Class T6, Class T7 >
 Param Class Template with seven parameters. More...
 
class  Param8< Class T1, Class T2, Class T3, Class T4, Class T5, Class T6, Class T7, Class T8 >
 Param Class Template with eight parameters. More...
 
class  Param9< Class T1, Class T2, Class T3, Class T4, Class T5, Class T6, Class T7, Class T8, Class T9 >
 Param Class Template with nine parameters. More...
 
class  Param10< Class T1, Class T2, Class T3, Class T4, Class T5, Class T6, Class T7, Class T8, Class T9, Class T10 >
 Param Class Template with ten parameters. More...
 
class  CallQueueContext
 
class  array< ref CallQueueContext >
 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...
 
class  CallQueue
 DragQueue Class provide callbacks while mouse is dragging. Callback function must have exact arguments: More...
 
class  array< TimerBase >
 TimerQueue Class using for system purpose only. More...
 
class  TimerBase
 Simple class for fading Widgets. More...
 
class  AnimationTimer
 AnimationTimer class. This timer is for animating float value.
usage: More...
 
class  AnimatorTimer
 
class  multiMap< Class K, Class V >
 Associative array template, with multiple values per key
usage: More...
 

Typedefs

typedef map< string, stringTStringMap
 

Functions

void ~TimerBase ()
 
void Pause ()
 Pause Timer, internal counter is not restarted, so timer can continue later. Can be unpaused via Continue.
 
void Continue ()
 Timer continue when it was paused.
 
void Stop ()
 Stop Timer and restart internal counter. Cannot be unpaused, must be started again.
 
bool IsRunning ()
 
void Tick (float timeslice)
 System function, don't call.
 
void OnTimerQueueDestoryed ()
 System function, don't call.
 
float GetTime ()
 
float GetDuration ()
 
float GetRemaining ()
 
float GetRunTime ()
 
void OnInit (int category)
 
void OnStart (float duration, bool loop)
 
void OnUpdate ()
 
void OnTimer ()
 DEPRECATED.
 
void SetRunning (bool running)
 
int GetTemperatureColor (int temperature)
 
bool GetProfileValueBool (string name, bool def=false)
 Return value from profile variable, if variable with given name is not present, default value is returned.
 
void SetProfileValueBool (string name, bool value)
 Writes bool variable to profile, after write don't forget to call CGame::SaveProfile() to save profile to storage!
 
int GetNumberOfSetBits (int i)
 

Variables

const int CALL_CATEGORY_SYSTEM = 0
 
const int CALL_CATEGORY_GUI = 1
 
const int CALL_CATEGORY_GAMEPLAY = 2
 
const int CALL_CATEGORY_COUNT = 3
 
class DragQueue extends CallQueue m_running
 TimerBase Class provide just interface for all Timer classes. Don't instance this class, use Timer class instead.
 
bool m_loop
 
float m_duration
 
float m_time
 
array< TimerBasem_timerQueue
 
float m_RunTime
 

Detailed Description

\desc Helpful functions & classes

\desc Helpful functions & classes

Typedef Documentation

◆ TStringMap

Definition at line 927 of file tools.c.

Function Documentation

◆ Continue()

void Continue ( )
protected

Timer continue when it was paused.

Definition at line 235 of file tools.c.

236 {
237 SetRunning(true);
238 }
void SetRunning(bool running)
Definition tools.c:335

References SetRunning().

Referenced by UIScriptedMenu::OnClick(), and UIScriptedMenu::OnClick_Continue().

◆ GetDuration()

float GetDuration ( )
protected

Definition at line 297 of file tools.c.

298 {
299 return m_duration;
300 }
float m_duration
Definition tools.c:211

References m_duration.

Referenced by SymptomBase::OnGetActivatedServer().

◆ GetNumberOfSetBits()

int GetNumberOfSetBits ( int i)
protected

Definition at line 982 of file tools.c.

983{
984 return Math.GetNumberOfSetBits(i);
985}
Definition EnMath.c:7
static proto int GetNumberOfSetBits(int i)
returns the number of bits set in a bitmask i

References Math::GetNumberOfSetBits().

◆ GetProfileValueBool()

bool GetProfileValueBool ( string name,
bool def = false )
protected

Return value from profile variable, if variable with given name is not present, default value is returned.

Definition at line 958 of file tools.c.

959{
960 string value;
961 if (GetGame().GetProfileString(name, value))
962 {
963 if (value == "true" || value == "1")
964 return true;
965 else
966 return false;
967 }
968 else
969 return def;
970}
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native CGame GetGame()

References GetGame(), and name.

Referenced by DayZProfilesOptions::RegisterProfileOption(), and DayZProfilesOptions::ResetOptionsBool().

◆ GetRemaining()

float GetRemaining ( )
protected

Definition at line 302 of file tools.c.

303 {
304 return m_duration - m_time;
305 }
float m_time
Definition tools.c:212

References m_duration, and m_time.

◆ GetRunTime()

float GetRunTime ( )
protected

Definition at line 307 of file tools.c.

308 {
309 return m_RunTime;
310 }
float m_RunTime
Definition tools.c:214

References m_RunTime.

◆ GetTemperatureColor()

int GetTemperatureColor ( int temperature)
protected

Definition at line 929 of file tools.c.

930{
931 int alpha = 255;
932 int red = 153;
933 int green = 153;
934 int blue = 153;
935 if (temperature < 20)
936 {
938 temperature = Math.Clamp(temperature, -50, 50);
940
941 red = Math.Clamp(red - ((red / 50) * temperature), 0, 255);
942 green = Math.Clamp(green - ((green / 50) * temperature), 0, 255);
943 blue = Math.Clamp(blue + ((blue / 50) * temperature), 0, 255);
944 }
945 else if (temperature > 20)
946 {
947 temperature = Math.Clamp(temperature, -100, 100);
948 blue = Math.Clamp(blue - ((blue / 100) * temperature), 0, 255);
949 green = Math.Clamp(green - ((green / 100) * temperature), 0, 255);
950 red = Math.Clamp(red + ((red / 100) * temperature), 0, 255);
951 }
952
953 int color = ARGB(alpha, red, green, blue);
954 return color;
955}
static proto int AbsInt(int i)
Returns absolute value.
static proto 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'.
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

References Math::AbsInt(), ARGB(), and Math::Clamp().

Referenced by ColorManager::GetItemColor(), UIScriptedMenu::UpdateItemInfoQuantity(), and UIScriptedMenu::UpdateItemInfoTemperature().

◆ GetTime()

float GetTime ( )
protected

Definition at line 292 of file tools.c.

293 {
294 return m_time;
295 }

References m_time.

◆ IsRunning()

◆ OnInit()

void OnInit ( int category)
protected

Definition at line 312 of file tools.c.

313 {
314 m_duration = 1;
315 m_loop = false;
316 m_time = 0;
317 m_running = false;
318 if (GetGame())
319 m_timerQueue = GetGame().GetTimerQueue(category);
320 else
321 ErrorEx("Attempting to Init a timer when the game does not exist (GetGame() == null)");
322 }
enum ShapeType ErrorEx
bool m_loop
Definition tools.c:210
array< TimerBase > m_timerQueue
Definition tools.c:213

References ErrorEx, GetGame(), m_duration, m_loop, m_running, m_time, and m_timerQueue.

◆ OnStart()

void OnStart ( float duration,
bool loop )
protected

Definition at line 324 of file tools.c.

325 {
326 m_RunTime = 0;
328 m_loop = loop;
329 m_time = 0;
330 SetRunning(true);
331 }

References m_duration, m_loop, m_RunTime, m_time, and SetRunning().

Referenced by TimerBase::FadeIn(), and TimerBase::FadeOut().

◆ OnTimer()

void OnTimer ( )
protected

DEPRECATED.

Definition at line 334 of file tools.c.

334{}

◆ OnTimerQueueDestoryed()

void OnTimerQueueDestoryed ( )
protected

System function, don't call.

Definition at line 287 of file tools.c.

288 {
290 }

References m_timerQueue.

◆ OnUpdate()

void OnUpdate ( )
protected

Definition at line 333 of file tools.c.

333{}

◆ Pause()

void Pause ( )
protected

Pause Timer, internal counter is not restarted, so timer can continue later. Can be unpaused via Continue.

Definition at line 227 of file tools.c.

228 {
229 SetRunning(false);
230 }

References SetRunning().

◆ SetProfileValueBool()

void SetProfileValueBool ( string name,
bool value )
protected

Writes bool variable to profile, after write don't forget to call CGame::SaveProfile() to save profile to storage!

Definition at line 973 of file tools.c.

974{
975 if (value)
976 GetGame().SetProfileString(name, "1");
977 else
978 GetGame().SetProfileString(name, "0");
979}

References GetGame(), and name.

◆ SetRunning()

void SetRunning ( bool running)
protected

Definition at line 335 of file tools.c.

336 {
337 int index = -1;
338
339 if (m_running == running) return;
340
342 if (m_timerQueue == NULL) return;
343
344 if (running)
345 {
346 if (m_timerQueue.Find(this) == -1)
347 m_timerQueue.Insert(this);
348 }
349 else
350 {
351 index = m_timerQueue.Find(this);
352 if (index != -1)
353 m_timerQueue.Remove(index);
354 }
355 }

References m_running, and m_timerQueue.

Referenced by Continue(), OnStart(), Pause(), AnimationTimer::Run(), UniversalTemperatureSource::Stop(), Stop(), Tick(), AnimationTimer::~AnimationTimer(), and ~TimerBase().

◆ Stop()

void Stop ( )
protected

Stop Timer and restart internal counter. Cannot be unpaused, must be started again.

Definition at line 243 of file tools.c.

244 {
245 SetRunning(false);
246 m_time = 0;
247 }

References m_time, and SetRunning().

◆ Tick()

void Tick ( float timeslice)
protected

System function, don't call.

Definition at line 260 of file tools.c.

261 {
262 if (IsRunning())
263 {
266
267 if (m_time >= m_duration)
268 {
269 if (m_loop)
271 else
272 {
273 SetRunning(false);
274 m_time = 0;
275 }
276
277 OnTimer();
278 }
279 else
280 OnUpdate();
281 }
282 }
bool IsRunning()
Definition tools.c:252
void OnUpdate()
Definition tools.c:333
void OnTimer()
DEPRECATED.
Definition tools.c:334

References IsRunning(), m_duration, m_loop, m_RunTime, m_time, TimerBase::OnTimer(), TimerBase::OnUpdate(), and SetRunning().

◆ ~TimerBase()

void ~TimerBase ( )
protected

Definition at line 216 of file tools.c.

217 {
218 if (!m_timerQueue) return;
219
220 SetRunning(false);
221 }

References m_timerQueue, and SetRunning().

Variable Documentation

◆ CALL_CATEGORY_COUNT

const int CALL_CATEGORY_COUNT = 3

Definition at line 12 of file tools.c.

Referenced by CGame::DayZGame().

◆ CALL_CATEGORY_GAMEPLAY

◆ CALL_CATEGORY_GUI

const int CALL_CATEGORY_GUI = 1

Definition at line 9 of file tools.c.

Referenced by MissionBase::AbortMission(), ActionMenu::ActionMenu(), ChatLine::ChatLine(), ScriptedWidgetEventHandler::ContinuousActionProgress(), CrossHairSelector(), CGame::DayZGame(), DayZIntroScene::DayZIntroScene(), DayZIntroSceneXbox::DayZIntroSceneXbox(), Component::DebugBBoxDelete(), Component::DebugBBoxDraw(), Component::DebugDirectionDelete(), Component::DebugDirectionDraw(), Clothing_Base::EEHealthLevelChanged(), ManBase::EEHealthLevelChanged(), ManBase::EEItemAttached(), ManBase::EEItemDetached(), UIScriptedMenu::GameRespawn(), UIScriptedMenu::GameRetry(), Init(), ScriptedWidgetEventHandler::ItemActionsWidget(), MainMenuButtonEffect::MainMenuButtonEffect(), MissionBase::MissionGameplay(), OnActivate(), UIScriptedMenu::OnClick(), UIScriptedMenu::OnClick_Continue(), UIScriptedMenu::OnClick_Exit(), UIScriptedMenu::OnClick_Respawn(), UIScriptedMenu::OnClick_Restart(), CGame::OnEvent(), UIScriptedMenu::OnModalResult(), ScriptedWidgetEventHandler::OnMouseButtonDown(), ManBase::OnPlayerLoaded(), MissionBase::OnPlayerRespawned(), CGame::OnPostUpdate(), ManBase::OnSelectPlayer(), CGame::OnUpdate(), ScriptedWidgetEventHandler::OptionsMenuControls(), UIScriptedMenu::PerformSetToDefaultsExt(), UIScriptedMenu::Play(), ScriptedWidgetEventHandler::PrepareTooltip(), ScriptedWidgetEventHandler::ProjectedCrosshair(), RadialProgressBar::RadialProgressBar(), ManBase::RefreshHandAnimationState(), DayZPlayer::ShowDeadScreen(), ScriptedWidgetEventHandler::StartSlideshow(), ScriptedWidgetEventHandler::StopSlideShow(), ToggleDebugWindowEvent(), CGame::UpdateInputDeviceDisconnectWarning(), TimerBase::WidgetFadeTimer(), ScriptedWidgetEventHandler::~ContinuousActionProgress(), ~CrossHairSelector(), ScriptedWidgetEventHandler::~ItemActionsWidget(), MainMenuButtonEffect::~MainMenuButtonEffect(), ScriptedWidgetEventHandler::~ProjectedCrosshair(), and RadialProgressBar::~RadialProgressBar().

◆ CALL_CATEGORY_SYSTEM

const int CALL_CATEGORY_SYSTEM = 0

Definition at line 8 of file tools.c.

Referenced by Ammo_40mm_Smoke_ColorBase::Activate(), AreaDamageBase::AreaDamageBase(), ItemBase::BarbedWire(), ItemBase::BatteryCharger(), UIScriptedMenu::Cancel(), CGame::CancelLoginTimeCountdown(), Entity::CheckForDestroy(), ItemBase::CheckRainStart(), ItemBase::CheckWater(), UIManager::CloseWindow(), ScriptConsoleEnfScriptTab::ColorRunButton(), CreateTrigger(), IEntity::DecreaseHealth(), IEntity::Delete(), EntityLightSource::DeleteLightWithDelay(), Entity::DeleteOnClient(), DeleteThis(), DynamicArea_Flare::DynamicArea_Flare(), FlammableBase::EEItemDetached(), ManBase::EEItemOutOfHands(), Entity::EEKilled(), Ammo_40mm_Explosive::EEKilled(), EndLoading(), Entity::EntityAI(), EOnFrame(), ComponentEnergyManager::Event_OnAwake(), UIScriptedMenu::Exit(), InventoryItem::ExplodeAmmo(), ItemBase::GrowthTimerTick(), HandleSoundEffectsPipeCreaking(), Clothing::Headtorch_ColorBase(), InventoryItem::IncreaseOverheating(), Init(), ManBase::Init(), UIScriptedMenu::Init(), ItemBase::Init(), Interact(), Land_Underground_EntranceBase::Land_Underground_EntranceBase(), UIScriptedMenu::Leave(), ScriptedWidgetEventHandler::LoadVideo(), DrowningMdfr::OnActivate(), ImprovisedExplosive::OnActivatedByItem(), ClaymoreMine::OnArmed(), ScriptConsoleGeneralTab::OnClick(), UIPopupScript::OnClose(), ZombieMaleBase::OnDamageDestroyed(), Grenade_ChemGas::OnDamageDestroyed(), PluginBase::OnDestroy(), ManBase::OnDrowningEnd(), CGame::OnEvent(), FireworksLauncherClientEvent::OnExplode(), OnExplode(), OnFinishProgressServer(), FireworksLauncher::OnFuseIgnitedServer(), BiosSessionService::OnGetSessionError(), DestructionEffectBase::OnHealthLevelChanged(), PluginBase::OnInit(), ComponentEnergyManager::OnIsPlugged(), CGame::OnLoginTimeEvent(), ConnectErrorScriptModuleUI::OnModalResult(), UIPopupScript::OnOpen(), Land_Underground_Panel_Lever::OnPanelUsedSynchronized(), ScriptedWidgetEventHandler::OnPlaybackStart(), ScriptedWidgetEventHandler::OnPlaybackStop(), CGame::OnPostUpdate(), CGame::OnRespawnEvent(), PluginBase::OnRPCSyncSceneObject(), OnShow(), ItemBase::OnStoreLoadCustom(), PluginBase::OnUIEditorOpened(), CGame::OnUpdate(), ItemBase::OnWorkStart(), Roadflare::OnWorkStop(), ItemBase::PlantSeed(), MissionBase::PlayerDisconnected(), PresenceNotifierNoiseEvents::PresenceNotifierNoiseEvents(), ComponentEnergyManager::RefreshDebug(), ItemBase::RegenerateNavmesh(), RegisterCooldowns(), UndergroundTriggerCarrierBase::RequestDelayedTriggerSpawn(), Land_Underground_EntranceBase::RequestLatentTransition(), FireworksLauncherClientEvent::RequestSecondaryExplosion(), ItemBase::SetSpoiled(), SoftSkillManagerDebug(), ManBase::SpawnDrowningBubbles(), PluginBase::SpawnEntityInPlayerInventory(), StartActivate(), StartFire(), MissionBase::StartLogoutMenu(), ComponentEnergyManager::StartUpdates(), StopFire(), Synchronize(), Entity::TryDelete(), UIScriptedMenu::Update(), ItemBase::UpdateNavmesh(), ItemBase::UpdatePhysics(), ScriptedWidgetEventHandler::UpdateTotalTime(), ~SoftSkillManagerDebug(), UIPopupScript::~UIPopupScriptSceneManager(), and UIPopupScript::~UIPopupScriptSceneSettings().

◆ m_duration

float m_duration
protected

Definition at line 211 of file tools.c.

Referenced by GetDuration(), GetRemaining(), OnInit(), OnStart(), TimerBase::OnUpdate(), and Tick().

◆ m_loop

bool m_loop
protected

Definition at line 210 of file tools.c.

Referenced by OnInit(), OnStart(), AnimationTimer::Run(), Tick(), and AnimationTimer::Tick().

◆ m_running

class DragQueue extends CallQueue m_running

TimerBase Class provide just interface for all Timer classes. Don't instance this class, use Timer class instead.

Referenced by IsRunning(), OnInit(), and SetRunning().

◆ m_RunTime

◆ m_time

◆ m_timerQueue

array<TimerBase> m_timerQueue
protected