DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CTObjectFollower.c
См. документацию.
2{
5
6 protected vector m_Position;
7 protected vector m_Orientation;
9
10 protected float m_MaxFade;
11 protected float m_MinFade;
12
13 protected CameraToolsMenu m_Menu;
14
16 {
18 delete m_FollowerRoot;
19 }
20
21 void CreateFollowedObject( string type )
22 {
23 m_FollowedObject = EntityAI.Cast( GetGame().CreateObject( type, m_Position, true ) );
26 }
27
29 {
31 {
33 }
34 }
35
36 void Update( float timeslice )
37 {
38 UpdatePos();
39 }
40
42 {
43 return m_FollowedObject;
44 }
45
46 void SetPosition( vector position )
47 {
48 m_Position = position;
50 {
51 m_FollowedObject.SetPosition( position );
52 m_Position = m_FollowedObject.GetPosition();
53 }
54 UpdatePos();
55 }
56
57 void SetRotation( vector dir )
58 {
59 m_Orientation = dir;
60 PlayerBase player = PlayerBase.Cast( m_FollowedObject );
61 if( player )
62 {
63 player.SetOrientation( m_Orientation );
64 }
65 UpdatePos();
66 }
67
69 {
70 if( m_FollowedObject && m_FollowedObject.GetPosition() != m_Position )
71 {
72 SetPosition( m_FollowedObject.GetPosition() );
73 }
74 return m_Position;
75 }
76
78 {
80 {
81 return m_FollowedObject.GetOrientation();
82 }
83 return "0 0 0";
84 }
85
90 void UpdatePos()
91 {
92 vector relativePos;
93
94 relativePos = GetGame().GetScreenPosRelative( GetPosition() );
95
96 if( relativePos[0] >= 1 || relativePos[0] == 0 || relativePos[1] >= 1 || relativePos[1] == 0 )
97 {
98 m_FollowerRoot.Show( false );
99 return;
100 }
101 else if( relativePos[2] < 0 )
102 {
103 m_FollowerRoot.Show( false );
104 return;
105 }
106 else
107 {
108 m_FollowerRoot.Show( true );
109 }
110
111 float x, y;
112 m_FollowerRoot.GetSize( x, y );
113
114 m_FollowerRoot.SetPos( relativePos[0], relativePos[1] );
115 }
116
117 void Show()
118 {
119 m_FollowerRoot.Show( true );
120 }
121
122 void Hide()
123 {
124 m_FollowerRoot.Show( false );
125 }
126
127 void Fade( bool fade )
128 {
129 if( fade )
130 {
131 m_FollowerRoot.SetAlpha( m_MinFade );
132 }
133 else
134 {
135 m_FollowerRoot.SetAlpha( m_MaxFade );
136 }
137 }
138
139 override bool OnClick( Widget w, int x, int y, int button )
140 {
141 return false;
142 }
143
144 override bool OnDoubleClick( Widget w, int x, int y, int button )
145 {
146 return false;
147 }
148
149 override bool OnMouseButtonDown( Widget w, int x, int y, int button )
150 {
151 if( w == m_FollowerButton && button == MouseState.LEFT )
152 {
153 if( m_Menu )
154 {
155 m_Menu.SelectActor( CTActor.Cast( this ) );
156 }
157 return true;
158 }
159 return false;
160 }
161
162 override bool OnMouseButtonUp( Widget w, int x, int y, int button )
163 {
164 if( w == m_FollowerButton && button == MouseState.LEFT )
165 {
166 if( m_Menu )
167 {
168 m_Menu.SelectActor( null );
169 }
170 return true;
171 }
172 return false;
173 }
174}
Icon x
Icon y
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
proto native void ObjectDelete(Object obj)
void CTActor(int index, vector pos, vector orient, string type, array< string > items, string hands_item, CameraToolsMenu parent)
Определения CTActor.c:13
Определения CTActor.c:2
Определения Building.c:6
Определения PlayerBaseClient.c:2
void UpdatePos()
Function updating the position of the tracker widget.
Определения CTObjectFollower.c:90
void Fade(bool fade)
Определения CTObjectFollower.c:127
void SetRotation(vector dir)
Определения CTObjectFollower.c:57
void ~CTObjectFollower()
Определения CTObjectFollower.c:15
void Update(float timeslice)
Определения CTObjectFollower.c:36
void CreateFollowedObject(string type)
Определения CTObjectFollower.c:21
override bool OnMouseButtonUp(Widget w, int x, int y, int button)
Определения CTObjectFollower.c:162
override bool OnDoubleClick(Widget w, int x, int y, int button)
Определения CTObjectFollower.c:144
vector GetRotation()
Определения CTObjectFollower.c:77
void DestroyFollowedObject()
Определения CTObjectFollower.c:28
CameraToolsMenu m_Menu
Определения CTEvent.c:8
vector m_Position
Определения CTKeyframe.c:7
EntityAI m_FollowedObject
Определения CTObjectFollower.c:8
override bool OnClick(Widget w, int x, int y, int button)
Определения CTObjectFollower.c:139
vector GetPosition()
Определения CTObjectFollower.c:68
void SetPosition(vector position)
Определения CTObjectFollower.c:46
vector m_Orientation
Определения CTKeyframe.c:8
Widget m_FollowerButton
Определения CTObjectFollower.c:4
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
Определения CTObjectFollower.c:149
EntityAI GetObj()
Определения CTObjectFollower.c:41
Widget m_FollowerRoot
Определения CTObjectFollower.c:3
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения EnWidgets.c:190
Определения EnConvert.c:106
proto native CGame GetGame()
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:438
MouseState
Определения EnSystem.c:311
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
proto native void SetRotation(float roll, float pitch, float yaw, bool immedUpdate=true)