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

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

override void Init (Widget vehicleHudPanels)
 
override void ShowVehicleInfo (PlayerBase player)
 
override void HideVehicleInfo ()
 
override void RefreshVehicleHud (float timeslice)
 

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

ImageWidget m_VehicleRPMPointer
 
ImageWidget m_VehicleRPMDial
 
ImageWidget m_VehicleRPMRedline
 
ImageWidget m_VehicleSpeedPointer
 
Widget m_VehicleTemperatureIndicator
 
ImageWidget m_VehicleTemperaturePointer
 
ImageWidget m_VehicleTemperatureLight
 
ImageWidget m_VehicleFuelPointer
 
ImageWidget m_VehicleFuelLight
 
TextWidget m_VehicleSpeedValue
 
ImageWidget m_VehicleBatteryLight
 
ImageWidget m_VehicleEngineLight
 
ImageWidget m_VehicleOilLight
 
ImageWidget m_VehicleHandBrakeLight
 
ImageWidget m_VehicleWheelLight
 
bool m_VehicleDamageZoneHitEngineState
 
float m_VehicleDamageZonesHitTimer
 
CarScript m_CurrentVehicle
 
int m_VehicleGearCount = -1
 
float m_TimeSinceLastEngineLightChange
 
bool m_VehicleHasCoolant
 

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

- Закрытые члены унаследованные от 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
 

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

Методы

◆ HideVehicleInfo()

override void HideVehicleInfo ( )
inlineprotected
97 {
100 }
int m_VehicleGearCount
Definition CarHud.c:27
CarScript m_CurrentVehicle
Definition CarHud.c:25
Definition EntityAI.c:95

Перекрестные ссылки m_CurrentVehicle и m_VehicleGearCount.

◆ Init()

override void Init ( Widget vehicleHudPanels)
inlineprotected
32 {
34
35 m_VehiclePanel = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_hud_cars.layout", vehicleHudPanels);
36
37 m_VehicleRPMPointer = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("RPMPointer") );
38 m_VehicleRPMDial = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("RPMDial") );
39 m_VehicleRPMRedline = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("RPMDialRedline") );
40 m_VehicleSpeedPointer = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("SpeedPointer") );
41 m_VehicleSpeedValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("SpeedValue") );
42
43 m_VehicleCurrentGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Current") );
44 m_VehicleNextGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Next") );
45 m_VehiclePrevGearValue = TextWidget.Cast( m_VehiclePanel.FindAnyWidget("Prev") );
46
47 m_VehicleBatteryLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("BatteryLight"));
48 m_VehicleEngineLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("EngineLight"));
49 m_VehicleOilLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("OilLight"));
50 m_VehicleHandBrakeLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("HandBrakeLight"));
51 m_VehicleWheelLight = ImageWidget.Cast( m_VehiclePanel.FindAnyWidget("WheelLight"));
52
53 m_VehicleTemperatureIndicator = m_VehiclePanel.FindAnyWidget("TemperatureIndicator");
54 m_VehicleTemperaturePointer = ImageWidget.Cast(m_VehiclePanel.FindAnyWidget("TemperaturePointer"));
55 m_VehicleTemperatureLight = ImageWidget.Cast(m_VehiclePanel.FindAnyWidget("TemperatureLight"));
56 m_VehicleFuelPointer = ImageWidget.Cast(m_VehiclePanel.FindAnyWidget("FuelPointer"));
57 m_VehicleFuelLight = ImageWidget.Cast(m_VehiclePanel.FindAnyWidget("FuelLight"));
58
59 m_VehicleGearTable.Set(-1, "");
60 m_VehicleGearTable.Set(CarGear.REVERSE, "R");
61 m_VehicleGearTable.Set(CarGear.NEUTRAL, "N");
62 m_VehicleGearTable.Set(CarGear.FIRST, "1");
63 m_VehicleGearTable.Set(CarGear.SECOND, "2");
64 m_VehicleGearTable.Set(CarGear.THIRD, "3");
65 m_VehicleGearTable.Set(CarGear.FOURTH, "4");
66 m_VehicleGearTable.Set(CarGear.FIFTH, "5");
67 m_VehicleGearTable.Set(CarGear.SIXTH, "6");
68 m_VehicleGearTable.Set(CarGear.SEVENTH, "7");
69 m_VehicleGearTable.Set(CarGear.EIGTH, "8");
70
71 m_VehicleGearTableAuto.Set(-1, "");
75 }
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
Definition Car.c:69
ImageWidget m_VehicleRPMDial
Definition CarHud.c:5
TextWidget m_VehicleSpeedValue
Definition CarHud.c:14
ImageWidget m_VehicleFuelPointer
Definition CarHud.c:11
Widget m_VehicleTemperatureIndicator
Definition CarHud.c:8
ImageWidget m_VehicleSpeedPointer
Definition CarHud.c:7
ImageWidget m_VehicleFuelLight
Definition CarHud.c:12
ImageWidget m_VehicleRPMPointer
Definition CarHud.c:4
ImageWidget m_VehicleRPMRedline
Definition CarHud.c:6
ImageWidget m_VehicleTemperaturePointer
Definition CarHud.c:9
ImageWidget m_VehicleOilLight
Definition CarHud.c:18
ImageWidget m_VehicleEngineLight
Definition CarHud.c:17
ImageWidget m_VehicleWheelLight
Definition CarHud.c:20
ImageWidget m_VehicleHandBrakeLight
Definition CarHud.c:19
ImageWidget m_VehicleBatteryLight
Definition CarHud.c:16
ImageWidget m_VehicleTemperatureLight
Definition CarHud.c:10
Definition EnWidgets.c:220
TextWidget m_VehiclePrevGearValue
Definition VehicleHudBase.c:7
TextWidget m_VehicleCurrentGearValue
Definition VehicleHudBase.c:5
ref map< int, string > m_VehicleGearTable
Definition VehicleHudBase.c:9
ref map< int, string > m_VehicleGearTableAuto
Definition VehicleHudBase.c:10
TextWidget m_VehicleNextGearValue
Definition VehicleHudBase.c:6
Widget m_VehiclePanel
Definition VehicleHudBase.c:4
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_VehicleBatteryLight, VehicleHudBase::m_VehicleCurrentGearValue, m_VehicleEngineLight, m_VehicleFuelLight, m_VehicleFuelPointer, VehicleHudBase::m_VehicleGearTable, VehicleHudBase::m_VehicleGearTableAuto, m_VehicleHandBrakeLight, VehicleHudBase::m_VehicleNextGearValue, m_VehicleOilLight, VehicleHudBase::m_VehiclePanel, VehicleHudBase::m_VehiclePrevGearValue, m_VehicleRPMDial, m_VehicleRPMPointer, m_VehicleRPMRedline, m_VehicleSpeedPointer, m_VehicleSpeedValue, m_VehicleTemperatureIndicator, m_VehicleTemperatureLight, m_VehicleTemperaturePointer и m_VehicleWheelLight.

◆ RefreshVehicleHud()

override void RefreshVehicleHud ( float timeslice)
inlineprotected

engine

fuel tank

temperature

general hit timer reset

103 {
104 float rpm_value = m_CurrentVehicle.EngineGetRPM() / m_CurrentVehicle.EngineGetRPMMax();
105 float rpm_value_red = m_CurrentVehicle.EngineGetRPMRedline() / m_CurrentVehicle.EngineGetRPMMax();
106 float speed_value = m_CurrentVehicle.GetSpeedometerAbsolute() / 200;
107
108 m_VehicleRPMPointer.SetRotation(0, 0, rpm_value * 270 - 130, true);
109 m_VehicleSpeedPointer.SetRotation(0, 0, speed_value * 260 - 130, true);
110 m_VehicleSpeedValue.SetText(Math.AbsInt(m_CurrentVehicle.GetSpeedometer()).ToString());
111
112 int engineHealthLevel = m_CurrentVehicle.GetHealthLevel("Engine");
113 int fuelTankHealthLevel = m_CurrentVehicle.GetHealthLevel("FuelTank");
114 bool newHealth = false;
115
117 if (m_CurrentVehicle.HasEngineZoneReceivedHit())
118 {
120 {
123 {
125 }
126 else
127 {
129 }
130
131 m_VehicleEngineLight.SetAlpha(1);
133 }
134
136 newHealth = true;
137 }
139 {
141 m_VehicleEngineLight.SetAlpha(1);
142 m_VehicleEngineLight.Show(true);
143 }
144 else
145 {
146 m_VehicleEngineLight.Show(false);
147 }
148
151 {
153 m_VehicleFuelLight.SetAlpha(1);
154 m_VehicleFuelLight.Show(true);
155 }
157 {
159 m_VehicleFuelLight.SetAlpha(1);
160 m_VehicleFuelLight.Show(true);
161 }
162
165 {
167 if (m_CurrentVehicle.HasRadiator())
168 {
169 int radiatorHealthLevel = m_CurrentVehicle.GetRadiator().GetHealthLevel("");
171 {
173 m_VehicleTemperatureLight.SetAlpha(1);
174 m_VehicleTemperatureLight.Show(true);
175 }
177 {
179 m_VehicleTemperatureLight.SetAlpha(1);
180 m_VehicleTemperatureLight.Show(true);
181 }
182 }
183 else
184 {
186 m_VehicleTemperatureLight.SetAlpha(1);
187 m_VehicleTemperatureLight.Show(true);
188 }
189 }
190 else
191 {
193 }
194
195 m_VehicleHandBrakeLight.Show(m_CurrentVehicle.IsHandbrakeActive());
196 m_VehicleWheelLight.Show(m_CurrentVehicle.WheelIsAnyLocked());
197
198
199 int engagedGear = -1;
200 int prevGear = -1;
201 int nextGear = -1;
202
203 if (m_CurrentVehicle.GearboxGetType() == CarGearboxType.MANUAL)
204 {
205 engagedGear = m_CurrentVehicle.GetGear();
206 prevGear = engagedGear - 1;
207 nextGear = engagedGear + 1;
208
209 if (engagedGear == CarGear.NEUTRAL)
210 {
211 prevGear = CarGear.REVERSE;
212 }
213 else if (engagedGear == CarGear.REVERSE)
214 {
215 prevGear = -1;
216 nextGear = CarGear.NEUTRAL;
217 }
218
221
224 }
225 else
226 {
227 engagedGear = m_CurrentVehicle.GearboxGetMode();
228 prevGear = engagedGear - 1;
229 nextGear = engagedGear + 1;
230
233
236 }
237
238 // refresh backlit
239 GetDayZGame().GetBacklit().RefreshVehicleLayout(engagedGear, newHealth);
240
241 m_VehicleFuelPointer.SetRotation( 0, 0, m_CurrentVehicle.GetFluidFraction( CarFluid.FUEL ) * 260 - 130, true );
242 m_VehicleTemperaturePointer.SetRotation( 0, 0, -1 * m_CurrentVehicle.GetFluidFraction( CarFluid.COOLANT ) * 260 + 130, true );
243
246 {
249 }
250
252 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Definition Car.c:19
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
Definition Car.c:35
DayZGame GetDayZGame()
Definition DayZGame.c:3817
float m_TimeSinceLastEngineLightChange
Definition CarHud.c:28
bool m_VehicleDamageZoneHitEngineState
Definition CarHud.c:22
float m_VehicleDamageZonesHitTimer
Definition CarHud.c:23
override bool IsVitalRadiator()
Definition Offroad_02.c:386
Definition Colors.c:4
const int WHITE
Definition Colors.c:15
const int COLOR_RUINED
Definition Colors.c:20
Definition EnConvert.c:590
static int GetEnumSize(typename e)
Return amount of values in enum.
Definition EnConvert.c:623
Definition constants.c:638
Definition ItemManager.c:2
static int GetItemHealthColor(int pHealthLevel)
Definition ItemManager.c:410
Definition EnMath.c:7
const int STATE_WORN
Definition constants.c:810
static proto int AbsInt(int i)
Returns absolute value.

Перекрестные ссылки Math::AbsInt(), Colors::COLOR_RUINED, GetDayZGame(), EnumTools::GetEnumSize(), ItemManager::GetItemHealthColor(), CarScript::IsVitalRadiator(), m_CurrentVehicle, m_TimeSinceLastEngineLightChange, VehicleHudBase::m_VehicleCurrentGearValue, m_VehicleDamageZoneHitEngineState, m_VehicleDamageZonesHitTimer, m_VehicleEngineLight, m_VehicleFuelLight, m_VehicleFuelPointer, m_VehicleGearCount, VehicleHudBase::m_VehicleGearTable, VehicleHudBase::m_VehicleGearTableAuto, m_VehicleHandBrakeLight, VehicleHudBase::m_VehicleNextGearValue, VehicleHudBase::m_VehiclePrevGearValue, m_VehicleRPMPointer, m_VehicleSpeedPointer, m_VehicleSpeedValue, m_VehicleTemperatureIndicator, m_VehicleTemperatureLight, m_VehicleTemperaturePointer, m_VehicleWheelLight, GameConstants::STATE_WORN и Colors::WHITE.

◆ ShowVehicleInfo()

override void ShowVehicleInfo ( PlayerBase player)
inlineprotected
78 {
79 HumanCommandVehicle hcv = player.GetCommand_Vehicle();
80 if (!hcv)
81 return;
82
83 m_CurrentVehicle = CarScript.Cast(hcv.GetTransport());
85 return;
86
87 m_VehicleGearCount = m_CurrentVehicle.GetGearsCount();
88
89 float rpm_value_red = m_CurrentVehicle.EngineGetRPMRedline() / m_CurrentVehicle.EngineGetRPMMax();
90 m_VehicleRPMDial.SetMaskProgress(rpm_value_red);
91 m_VehicleRPMRedline.SetMaskProgress(1 - rpm_value_red);
92
93 m_VehiclePanel.Show(true);
94 }
Definition CivilianSedan.c:2
Definition human.c:690

Перекрестные ссылки m_CurrentVehicle, m_VehicleGearCount, VehicleHudBase::m_VehiclePanel, m_VehicleRPMDial и m_VehicleRPMRedline.

Поля

◆ m_CurrentVehicle

CarScript m_CurrentVehicle
protected

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

◆ m_TimeSinceLastEngineLightChange

float m_TimeSinceLastEngineLightChange
protected

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

◆ m_VehicleBatteryLight

ImageWidget m_VehicleBatteryLight
protected

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

◆ m_VehicleDamageZoneHitEngineState

bool m_VehicleDamageZoneHitEngineState
protected

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

◆ m_VehicleDamageZonesHitTimer

float m_VehicleDamageZonesHitTimer
protected

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

◆ m_VehicleEngineLight

ImageWidget m_VehicleEngineLight
protected

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

◆ m_VehicleFuelLight

ImageWidget m_VehicleFuelLight
protected

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

◆ m_VehicleFuelPointer

ImageWidget m_VehicleFuelPointer
protected

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

◆ m_VehicleGearCount

int m_VehicleGearCount = -1
protected

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

◆ m_VehicleHandBrakeLight

ImageWidget m_VehicleHandBrakeLight
protected

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

◆ m_VehicleHasCoolant

bool m_VehicleHasCoolant
protected

◆ m_VehicleOilLight

ImageWidget m_VehicleOilLight
protected

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

◆ m_VehicleRPMDial

ImageWidget m_VehicleRPMDial
protected

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

◆ m_VehicleRPMPointer

ImageWidget m_VehicleRPMPointer
protected

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

◆ m_VehicleRPMRedline

ImageWidget m_VehicleRPMRedline
protected

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

◆ m_VehicleSpeedPointer

ImageWidget m_VehicleSpeedPointer
protected

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

◆ m_VehicleSpeedValue

TextWidget m_VehicleSpeedValue
protected

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

◆ m_VehicleTemperatureIndicator

Widget m_VehicleTemperatureIndicator
protected

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

◆ m_VehicleTemperatureLight

ImageWidget m_VehicleTemperatureLight
protected

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

◆ m_VehicleTemperaturePointer

ImageWidget m_VehicleTemperaturePointer
protected

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

◆ m_VehicleWheelLight

ImageWidget m_VehicleWheelLight
protected

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


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