DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс BoatHud
+ Граф наследования:BoatHud:

Защищенные члены

override void Init (Widget vehicleHudPanels)
 
override void ShowVehicleInfo (PlayerBase player)
 
override void HideVehicleInfo ()
 
override void RefreshVehicleHud (float timeslice)
 
void UpdateEngineIcon (int level)
 
void UpdateFuelIcon (float level)
 
void UpdateSpeedPointer ()
 
void UpdateGear ()
 
void UpdateEngineBlink (float timeSlice)
 
float GetSpeedometer ()
 

Защищенные данные

const float ENGINE_BLINK_DURATION = 3
 
ImageWidget m_SpeedPointer
 
ImageWidget m_EngineLight
 
ImageWidget m_FuelLight
 
bool m_HasEngine
 
int m_EngagedGear
 
int m_EngineHealthLevel
 
float m_FuelLevel
 
float m_TimeSinceEngineHit
 
float m_TimeSinceEngineBlink
 
BoatScript m_CurrentVehicle
 
ref WidgetFadeTimer m_FadeTimer = new WidgetFadeTimer()
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от VehicleHudBase
void VehicleHudBase ()
 
void ~VehicleHudBase ()
 
void Init (Widget vehicleHudPanels)
 
void ShowVehicleInfo (PlayerBase player)
 
void HideVehicleInfo ()
 
void HidePanel ()
 
void RefreshVehicleHud (float timeslice)
 
- Закрытые данные унаследованные от VehicleHudBase
Widget m_VehiclePanel
 
TextWidget m_VehicleCurrentGearValue
 
TextWidget m_VehicleNextGearValue
 
TextWidget m_VehiclePrevGearValue
 
ref map< int, stringm_VehicleGearTable
 
ref map< int, stringm_VehicleGearTableAuto
 

Подробное описание

Методы

◆ GetSpeedometer()

float GetSpeedometer ( )
inlineprotected
175 {
176 vector transform[4];
177 m_CurrentVehicle.GetTransform(transform);
178
179 return GetVelocity(m_CurrentVehicle).InvMultiply3(transform)[2];
180 }
BoatScript m_CurrentVehicle
Definition BoatHud.c:16
Definition EntityAI.c:95
Definition EnConvert.c:106
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.

Перекрестные ссылки GetVelocity() и m_CurrentVehicle.

◆ HideVehicleInfo()

override void HideVehicleInfo ( )
inlineprotected
62 {
64 m_VehicleGearTable.Clear();
65 }
ref map< int, string > m_VehicleGearTable
Definition VehicleHudBase.c:9

Перекрестные ссылки m_CurrentVehicle и VehicleHudBase::m_VehicleGearTable.

◆ Init()

override void Init ( Widget vehicleHudPanels)
inlineprotected
21 {
23
24 m_VehiclePanel = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_hud_boats.layout", vehicleHudPanels);
25
26 m_SpeedPointer = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("SpeedPointer") );
27 m_EngineLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("EngineLight"));
28 m_FuelLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("FuelLight"));
29
30 m_VehicleCurrentGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Current") );
31 m_VehicleNextGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Next") );
32 m_VehiclePrevGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Prev") );
33 }
ImageWidget m_FuelLight
Definition BoatHud.c:8
ImageWidget m_EngineLight
Definition BoatHud.c:7
ImageWidget m_SpeedPointer
Definition BoatHud.c:6
Definition EnWidgets.c:220
TextWidget m_VehiclePrevGearValue
Definition VehicleHudBase.c:7
TextWidget m_VehicleCurrentGearValue
Definition VehicleHudBase.c:5
TextWidget m_VehicleNextGearValue
Definition VehicleHudBase.c:6
Widget m_VehiclePanel
Definition VehicleHudBase.c:4
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_EngineLight, m_FuelLight, m_SpeedPointer, VehicleHudBase::m_VehicleCurrentGearValue, VehicleHudBase::m_VehicleNextGearValue, VehicleHudBase::m_VehiclePanel и VehicleHudBase::m_VehiclePrevGearValue.

◆ RefreshVehicleHud()

override void RefreshVehicleHud ( float timeslice)
inlineprotected
68 {
69 int engineHealthLevel = m_CurrentVehicle.GetHealthLevel("Engine");
70 float fuelFraction = m_CurrentVehicle.GetFluidFraction(BoatFluid.FUEL);
71
74
77
78 if (m_CurrentVehicle.HasEngineZoneReceivedHit())
80
83
85 UpdateGear();
86 }
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Boat.c:14
int m_EngineHealthLevel
Definition BoatHud.c:12
void UpdateSpeedPointer()
Definition BoatHud.c:123
void UpdateEngineBlink(float timeSlice)
Definition BoatHud.c:153
void UpdateGear()
Definition BoatHud.c:137
float m_FuelLevel
Definition BoatHud.c:13
void UpdateFuelIcon(float level)
Definition BoatHud.c:104
void UpdateEngineIcon(int level)
Definition BoatHud.c:88
const float ENGINE_BLINK_DURATION
Definition BoatHud.c:4
float m_TimeSinceEngineHit
Definition BoatHud.c:14

Перекрестные ссылки ENGINE_BLINK_DURATION, m_CurrentVehicle, m_EngineHealthLevel, m_FuelLevel, m_TimeSinceEngineHit, UpdateEngineBlink(), UpdateEngineIcon(), UpdateFuelIcon(), UpdateGear() и UpdateSpeedPointer().

◆ ShowVehicleInfo()

override void ShowVehicleInfo ( PlayerBase player)
inlineprotected
36 {
37 HumanCommandVehicle hcv = player.GetCommand_Vehicle();
38 if (!hcv)
39 return;
40
41 m_CurrentVehicle = BoatScript.Cast(hcv.GetTransport());
42
43 m_VehiclePanel.Show(true);
44
46 m_FuelLevel = -1;
47
48 if (m_CurrentVehicle.HasEngine())
49 m_HasEngine = true;
50
51 float gearNeutral = m_CurrentVehicle.GetNeutralGear();
53 m_VehicleGearTable.Set(gearNeutral - 1, "R");
55 m_VehicleGearTable.Set(gearNeutral + 1, "F");
57
58 m_EngagedGear = -10; // force initial update
59 }
bool m_HasEngine
Definition BoatHud.c:10
int m_EngagedGear
Definition BoatHud.c:11
Definition BoatScript.c:27
Definition human.c:690

Перекрестные ссылки m_CurrentVehicle, m_EngagedGear, m_EngineHealthLevel, m_FuelLevel, m_HasEngine, VehicleHudBase::m_VehicleGearTable и VehicleHudBase::m_VehiclePanel.

◆ UpdateEngineBlink()

void UpdateEngineBlink ( float timeSlice)
inlineprotected
154 {
156 if (m_TimeSinceEngineHit <= 0)
157 {
158 m_FadeTimer.Stop();
159 m_EngineLight.SetAlpha(1);
160 return;
161 }
162
164 if (m_TimeSinceEngineBlink <= 0)
165 {
167 if (m_EngineLight.GetAlpha() == 0)
168 m_FadeTimer.FadeIn(m_EngineLight, 0.1);
169 else
170 m_FadeTimer.FadeOut(m_EngineLight, 0.1);
171 }
172 }
ref WidgetFadeTimer m_FadeTimer
Definition BoatHud.c:18
float m_TimeSinceEngineBlink
Definition BoatHud.c:15

Перекрестные ссылки m_EngineLight, m_FadeTimer, m_TimeSinceEngineBlink и m_TimeSinceEngineHit.

Используется в RefreshVehicleHud().

◆ UpdateEngineIcon()

void UpdateEngineIcon ( int level)
inlineprotected
89 {
91
93 {
94 m_EngineLight.SetColor(COLOR_WHITE);
95 m_EngineLight.SetAlpha(0);
96 }
98 {
100 m_EngineLight.SetAlpha(1);
101 }
102 }
Definition constants.c:638
Definition ItemManager.c:2
static int GetItemHealthColor(int pHealthLevel)
Definition ItemManager.c:410
const int COLOR_WHITE
Definition constants.c:63
const int STATE_WORN
Definition constants.c:810

Перекрестные ссылки COLOR_WHITE, ItemManager::GetItemHealthColor(), m_EngineHealthLevel, m_EngineLight и GameConstants::STATE_WORN.

Используется в RefreshVehicleHud().

◆ UpdateFuelIcon()

void UpdateFuelIcon ( float level)
inlineprotected
105 {
107
108 if (m_FuelLevel > 0.45)
109 {
110 m_FuelLight.SetAlpha(0);
111 return;
112 }
113 else if (m_FuelLevel > 0.15)
115 else if (m_FuelLevel > 0)
117 else
119
120 m_FuelLight.SetAlpha(1);
121 }
Definition Colors.c:4
const int COLOR_BADLY_DAMAGED
Definition Colors.c:21
const int COLOR_DAMAGED
Definition Colors.c:22
const int COLOR_RUINED
Definition Colors.c:20

Перекрестные ссылки Colors::COLOR_BADLY_DAMAGED, Colors::COLOR_DAMAGED, Colors::COLOR_RUINED, m_FuelLevel и m_FuelLight.

Используется в RefreshVehicleHud().

◆ UpdateGear()

void UpdateGear ( )
inlineprotected

◆ UpdateSpeedPointer()

void UpdateSpeedPointer ( )
inlineprotected
124 {
125 if (m_HasEngine)
126 {
127 float min, max, current;
128 min = 0;
129 max = m_CurrentVehicle.EngineGetRPMMax();
130 current = Math.Clamp(m_CurrentVehicle.EngineGetRPM(), min, max);
131
133 m_SpeedPointer.SetRotation(0, 0, Math.Lerp(225, 495, Math.AbsFloat(percentVal)), true);
134 }
135 }
Definition EnMath.c:7
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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), Math::Clamp(), Math::InverseLerp(), Math::Lerp(), m_CurrentVehicle, m_HasEngine и m_SpeedPointer.

Используется в RefreshVehicleHud().

Поля

◆ ENGINE_BLINK_DURATION

const float ENGINE_BLINK_DURATION = 3
protected

Используется в RefreshVehicleHud().

◆ m_CurrentVehicle

◆ m_EngagedGear

int m_EngagedGear
protected

Используется в ShowVehicleInfo() и UpdateGear().

◆ m_EngineHealthLevel

int m_EngineHealthLevel
protected

Используется в RefreshVehicleHud(), ShowVehicleInfo() и UpdateEngineIcon().

◆ m_EngineLight

ImageWidget m_EngineLight
protected

Используется в Init(), UpdateEngineBlink() и UpdateEngineIcon().

◆ m_FadeTimer

ref WidgetFadeTimer m_FadeTimer = new WidgetFadeTimer()
protected

Используется в UpdateEngineBlink().

◆ m_FuelLevel

float m_FuelLevel
protected

Используется в RefreshVehicleHud(), ShowVehicleInfo() и UpdateFuelIcon().

◆ m_FuelLight

ImageWidget m_FuelLight
protected

Используется в Init() и UpdateFuelIcon().

◆ m_HasEngine

bool m_HasEngine
protected

Используется в ShowVehicleInfo(), UpdateGear() и UpdateSpeedPointer().

◆ m_SpeedPointer

ImageWidget m_SpeedPointer
protected

Используется в Init() и UpdateSpeedPointer().

◆ m_TimeSinceEngineBlink

float m_TimeSinceEngineBlink
protected

Используется в UpdateEngineBlink().

◆ m_TimeSinceEngineHit

float m_TimeSinceEngineHit
protected

Используется в RefreshVehicleHud() и UpdateEngineBlink().


Объявления и описания членов класса находятся в файле: