DayZ 1.24
Loading...
Searching...
No Matches
GPSReceiver Class Reference
Inheritance diagram for GPSReceiver:
[legend]
Collaboration diagram for GPSReceiver:
[legend]

Protected Member Functions

void GPSReceiver ()
 
void PositionalUpdate ()
 
override void OnMovedInsideCargo (EntityAI container)
 need to be overriden, otherwise the item will be turned off when moved to cargo
 
override void SetActions ()
 
override bool IsTurnedOn ()
 
override void OnWorkStart ()
 
override void OnWorkStop ()
 
override void OnWork (float consumed_energy)
 
void UpdateDisplayState (bool pIsTurnedOn)
 
void UpdateDisplayPosition ()
 
void UpdateDisplayElevation ()
 
int GetHiddenSelection (string selection)
 
override void OnDebugSpawn ()
 

Protected Attributes

ref set< stringm_DisplayGridSelections
 
ref set< stringm_DisplayAltSelections
 
ref map< int, stringm_DisplayNumericSignTextureMap
 
ref array< intm_OrderedPositionNumbersLast
 cache
 
ref array< intm_AltitudeNumbersLast
 

Private Attributes

const string DISPLAY_TEXTURE_PATH_FORMAT = "dz\\gear\\navigation\\data\\GPS_%1_ca.paa"
 
const string ANIM_PHASE_DISPLAY_HIDE = "DisplayState"
 

Detailed Description

Definition at line 1 of file GPSReceiver.c.

Constructor & Destructor Documentation

◆ GPSReceiver()

void GPSReceiver::GPSReceiver ( )
inlineprotected

translate numerical -1 to - texture

Definition at line 15 of file GPSReceiver.c.

16 {
19
20 int i;
21 for (i = 0; i < MapNavigationBehaviour.DISPLAY_GRID_POS_MAX_CHARS_COUNT * 2; ++i)
23
24 for (i = 0; i < MapNavigationBehaviour.DISPLAY_ALT_MAX_CHARS_COUNT; ++i)
25 m_AltitudeNumbersLast.Insert(0);
26
28 m_DisplayGridSelections.Insert("grid_1_0");
29 m_DisplayGridSelections.Insert("grid_1_1");
30 m_DisplayGridSelections.Insert("grid_1_2");
31 m_DisplayGridSelections.Insert("grid_2_0");
32 m_DisplayGridSelections.Insert("grid_2_1");
33 m_DisplayGridSelections.Insert("grid_2_2");
34
36 m_DisplayAltSelections.Insert("alt_0");
37 m_DisplayAltSelections.Insert("alt_1");
38 m_DisplayAltSelections.Insert("alt_2");
39 m_DisplayAltSelections.Insert("alt_3");
40
42 for (i = -1; i < 11; i++)
43 {
44
45 string texturePath = string.Format(DISPLAY_TEXTURE_PATH_FORMAT, i);
46
48 if (i == -1)
49 texturePath = string.Format(DISPLAY_TEXTURE_PATH_FORMAT, "dash");
50
52 }
53 }
void MapNavigationBehaviour(PlayerBase pPlayer, EMapNavigationType pNavigationType=EMapNavigationType.BASIC)
ref map< int, string > m_DisplayNumericSignTextureMap
Definition GPSReceiver.c:9
ref array< int > m_AltitudeNumbersLast
Definition GPSReceiver.c:13
ref set< string > m_DisplayAltSelections
Definition GPSReceiver.c:8
const string DISPLAY_TEXTURE_PATH_FORMAT
Definition GPSReceiver.c:4
ref set< string > m_DisplayGridSelections
Definition GPSReceiver.c:7
ref array< int > m_OrderedPositionNumbersLast
cache
Definition GPSReceiver.c:12

References DISPLAY_TEXTURE_PATH_FORMAT, m_AltitudeNumbersLast, m_DisplayAltSelections, m_DisplayGridSelections, m_DisplayNumericSignTextureMap, m_OrderedPositionNumbersLast, and MapNavigationBehaviour().

Member Function Documentation

◆ GetHiddenSelection()

int GPSReceiver::GetHiddenSelection ( string selection)
inlineprotected

Definition at line 151 of file GPSReceiver.c.

152 {
153 int idx = GetHiddenSelectionIndex(selection);
154
155 if (idx != INDEX_NOT_FOUND)
156 return idx;
157 else
158 return 0;
159 }
const int INDEX_NOT_FOUND
Definition gameplay.c:13

References INDEX_NOT_FOUND.

Referenced by UpdateDisplayElevation(), and UpdateDisplayPosition().

◆ IsTurnedOn()

override bool GPSReceiver::IsTurnedOn ( )
inlineprotected

Definition at line 72 of file GPSReceiver.c.

73 {
74 return GetCompEM() && GetCompEM().IsWorking();
75 }

◆ OnDebugSpawn()

override void GPSReceiver::OnDebugSpawn ( )
inlineprotected

Definition at line 165 of file GPSReceiver.c.

166 {
167 Battery9V.Cast(GetInventory().CreateInInventory("Battery9V"));
168 }

◆ OnMovedInsideCargo()

override void GPSReceiver::OnMovedInsideCargo ( EntityAI container)
protected

need to be overriden, otherwise the item will be turned off when moved to cargo

◆ OnWork()

override void GPSReceiver::OnWork ( float consumed_energy)
inlineprotected

Definition at line 102 of file GPSReceiver.c.

103 {
105 }
void PositionalUpdate()
Definition GPSReceiver.c:55

References PositionalUpdate().

◆ OnWorkStart()

override void GPSReceiver::OnWorkStart ( )
inlineprotected

Definition at line 78 of file GPSReceiver.c.

79 {
81
82 if (GetHierarchyRoot())
83 {
84 PlayerBase pb = PlayerBase.Cast(GetHierarchyRoot());
85 if (pb)
86 pb.MapNavigationItemInPossession(this);
87 }
88 }
void UpdateDisplayState(bool pIsTurnedOn)

References UpdateDisplayState().

◆ OnWorkStop()

override void GPSReceiver::OnWorkStop ( )
inlineprotected

Definition at line 90 of file GPSReceiver.c.

91 {
92 UpdateDisplayState(false);
93
94 if (GetHierarchyRoot())
95 {
96 PlayerBase pb = PlayerBase.Cast(GetHierarchyRoot());
97 if (pb)
98 pb.MapNavigationItemNotInPossession(this);
99 }
100 }

References UpdateDisplayState().

◆ PositionalUpdate()

void GPSReceiver::PositionalUpdate ( )
inlineprotected

Definition at line 55 of file GPSReceiver.c.

56 {
59 }
void UpdateDisplayElevation()
void UpdateDisplayPosition()

References UpdateDisplayElevation(), and UpdateDisplayPosition().

Referenced by OnWork().

◆ SetActions()

override void GPSReceiver::SetActions ( )
inlineprotected

Definition at line 64 of file GPSReceiver.c.

References AddAction().

◆ UpdateDisplayElevation()

void GPSReceiver::UpdateDisplayElevation ( )
inlineprotected

Definition at line 132 of file GPSReceiver.c.

133 {
134 int selectionIndex;
135 string selectionName;
136 array<int> altitudeNumbers = MapNavigationBehaviour.OrderedAltitudeNumbersPosition(this);
137
138 if (altitudeNumbers.DifferentAtPosition(m_AltitudeNumbersLast) != INDEX_NOT_FOUND)
139 {
140 for (int i = 0; i < m_DisplayAltSelections.Count(); ++i)
141 {
145 }
146
148 }
149 }
int GetHiddenSelection(string selection)

References GetHiddenSelection(), INDEX_NOT_FOUND, m_AltitudeNumbersLast, m_DisplayAltSelections, m_DisplayNumericSignTextureMap, and MapNavigationBehaviour().

Referenced by PositionalUpdate().

◆ UpdateDisplayPosition()

void GPSReceiver::UpdateDisplayPosition ( )
inlineprotected

◆ UpdateDisplayState()

void GPSReceiver::UpdateDisplayState ( bool pIsTurnedOn)
inlineprotected

Definition at line 108 of file GPSReceiver.c.

109 {
110 SetAnimationPhaseNow(ANIM_PHASE_DISPLAY_HIDE, !pIsTurnedOn);
111 }
const string ANIM_PHASE_DISPLAY_HIDE
Definition GPSReceiver.c:5

References ANIM_PHASE_DISPLAY_HIDE.

Referenced by OnWorkStart(), and OnWorkStop().

Member Data Documentation

◆ ANIM_PHASE_DISPLAY_HIDE

const string GPSReceiver::ANIM_PHASE_DISPLAY_HIDE = "DisplayState"
private

Definition at line 5 of file GPSReceiver.c.

Referenced by UpdateDisplayState().

◆ DISPLAY_TEXTURE_PATH_FORMAT

const string GPSReceiver::DISPLAY_TEXTURE_PATH_FORMAT = "dz\\gear\\navigation\\data\\GPS_%1_ca.paa"
private

Definition at line 4 of file GPSReceiver.c.

Referenced by GPSReceiver().

◆ m_AltitudeNumbersLast

ref array<int> GPSReceiver::m_AltitudeNumbersLast
protected

Definition at line 13 of file GPSReceiver.c.

Referenced by GPSReceiver(), and UpdateDisplayElevation().

◆ m_DisplayAltSelections

ref set<string> GPSReceiver::m_DisplayAltSelections
protected

Definition at line 8 of file GPSReceiver.c.

Referenced by GPSReceiver(), and UpdateDisplayElevation().

◆ m_DisplayGridSelections

ref set<string> GPSReceiver::m_DisplayGridSelections
protected

Definition at line 7 of file GPSReceiver.c.

Referenced by GPSReceiver(), and UpdateDisplayPosition().

◆ m_DisplayNumericSignTextureMap

ref map<int, string> GPSReceiver::m_DisplayNumericSignTextureMap
protected

Definition at line 9 of file GPSReceiver.c.

Referenced by GPSReceiver(), UpdateDisplayElevation(), and UpdateDisplayPosition().

◆ m_OrderedPositionNumbersLast

ref array<int> GPSReceiver::m_OrderedPositionNumbersLast
protected

cache

Definition at line 12 of file GPSReceiver.c.

Referenced by GPSReceiver(), and UpdateDisplayPosition().


The documentation for this class was generated from the following file: