DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CTKeyframe.c
См. документацию.
1class CTKeyframe extends ScriptedWidgetEventHandler
2{
3 protected int m_Index;
4 protected float m_InterpTime;
5 protected float m_TotalTimeBefore;
6
7 protected vector m_Position;
9 protected CameraToolsMenu m_Menu;
10
11 protected Widget m_Root;
12 protected TextWidget m_IndexWidget;
18
19 void CTKeyframe( int index, vector pos, vector orient, float int_value, float fov, float dof, int pin, float time_before, Widget root, CameraToolsMenu parent )
20 {
21 m_Menu = parent;
22
23 m_Root = GetGame().GetWorkspace().CreateWidgets( "gui/layouts/camera_tools/keyframe_entry.layout", root );
24
25 m_IndexWidget = TextWidget.Cast( m_Root.FindAnyWidget( "keyframe_id" ) );
26 m_InterpTimeWidget = EditBoxWidget.Cast( m_Root.FindAnyWidget( "keyframe_time_edit" ) );
27 m_FOVWidget = EditBoxWidget.Cast( m_Root.FindAnyWidget( "keyframe_fov_edit" ) );
28 m_DOFWidget = EditBoxWidget.Cast( m_Root.FindAnyWidget( "keyframe_dof_edit" ) );
29 m_PinWidget = EditBoxWidget.Cast( m_Root.FindAnyWidget( "keyframe_pin_edit" ) );
30 m_TotalTimeWidget = TextWidget.Cast( m_Root.FindAnyWidget( "keyframe_time" ) );
31
32 m_Index = index;
33 m_TotalTimeBefore = time_before;
34 m_Position = pos;
35 m_Orientation = orient;
36
37 SetInterpTime( int_value );
38 SetFOV( fov );
39 SetDOF( dof );
40 SetPin( pin );
41 m_IndexWidget.SetText( m_Index.ToString() );
42 m_Root.SetHandler( this );
43 }
44
46 {
47 delete m_Root;
48 }
49
51 {
52 string time_text = m_InterpTimeWidget.GetText();
53 m_InterpTime = time_text.ToFloat();
54 return m_InterpTime;
55 }
56
57 void SetPin( int pin )
58 {
59 m_PinWidget.SetText( pin.ToString() );
60 }
61
62 int GetPin()
63 {
64 return m_PinWidget.GetText().ToInt();
65 }
66
67 void SetFOV( float fov )
68 {
69 m_FOVWidget.SetText( fov.ToString() );
70 }
71
72 float GetFOV()
73 {
74 return m_FOVWidget.GetText().ToFloat();
75 }
76
77 void SetDOF( float dof )
78 {
79 m_DOFWidget.SetText( dof.ToString() );
80 }
81
82 float GetDOF()
83 {
84 return m_DOFWidget.GetText().ToFloat();
85 }
86
87 void SetPosition( vector pos )
88 {
89 m_Position = pos;
90 }
91
92 void SetOrientation( vector orient )
93 {
94 m_Orientation = orient;
95 }
96
98 {
99 return m_Position;
100 }
101
103 {
104 return m_Orientation;
105 }
106
107 void SetTimeBefore( float time )
108 {
109 m_TotalTimeBefore = time;
111 }
112
113 void SetInterpTime( float time )
114 {
115 m_InterpTime = time;
116 m_InterpTimeWidget.SetText( m_InterpTime.ToString() );
118 }
119
120 void Select()
121 {
122 m_Root.FindAnyWidget( "spacer" ).SetAlpha( 1 );
123 m_IndexWidget.SetColor( ARGBF( 1, 1, 0, 0 ) );
124 m_InterpTimeWidget.SetColor( ARGBF( 1, 1, 0, 0 ) );
125 m_TotalTimeWidget.SetColor( ARGBF( 1, 1, 0, 0 ) );
126 }
127
128 void Unselect()
129 {
130 m_Root.FindAnyWidget( "spacer" ).SetAlpha( 0.625 );
131 m_IndexWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
132 m_InterpTimeWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
133 m_TotalTimeWidget.SetColor( ARGBF( 1, 1, 1, 1 ) );
134 }
135
136 override bool OnClick( Widget w, int x, int y, int button )
137 {
138 if( w == m_Root )
139 {
140 m_Menu.SelectKeyframe( this );
141 return true;
142 }
143 return false;
144 }
145
146 override bool OnFocus( Widget w, int x, int y )
147 {
148 if( IsFocusable( w ) )
149 {
150 m_Menu.SelectKeyframe( this );
151 return true;
152 }
153 return false;
154 }
155
157 {
158 if( w )
159 {
160 return ( w == m_InterpTimeWidget || w == m_TotalTimeWidget || w == m_FOVWidget || w == m_DOFWidget );
161 }
162 return false;
163 }
164}
proto string ToString()
Icon x
Icon y
proto native WorkspaceWidget GetWorkspace()
Определения EnWidgets.c:354
float m_InterpTime
Определения CTKeyframe.c:4
void SetDOF(float dof)
Определения CTKeyframe.c:77
EditBoxWidget m_FOVWidget
Определения CTKeyframe.c:14
float GetFOV()
Определения CTKeyframe.c:72
float GetInterpTime()
Определения CTKeyframe.c:50
void SetPin(int pin)
Определения CTKeyframe.c:57
void SetFOV(float fov)
Определения CTKeyframe.c:67
float GetDOF()
Определения CTKeyframe.c:82
void Select()
Определения CTKeyframe.c:120
Widget m_Root
Определения SizeToChild.c:9
EditBoxWidget m_DOFWidget
Определения CTKeyframe.c:15
EditBoxWidget m_PinWidget
Определения CTKeyframe.c:16
TextWidget m_TotalTimeWidget
Определения CTKeyframe.c:17
void Unselect()
Определения CTKeyframe.c:128
vector GetOrientation()
Определения CTKeyframe.c:102
CameraToolsMenu m_Menu
Определения CTEvent.c:8
void CTKeyframe(int index, vector pos, vector orient, float int_value, float fov, float dof, int pin, float time_before, Widget root, CameraToolsMenu parent)
Определения CTKeyframe.c:19
void SetInterpTime(float time)
Определения CTKeyframe.c:113
vector m_Position
Определения CTKeyframe.c:7
override bool OnClick(Widget w, int x, int y, int button)
Определения CTKeyframe.c:136
vector GetPosition()
Определения CTKeyframe.c:97
void SetPosition(vector pos)
Определения CTKeyframe.c:87
void SetOrientation(vector orient)
Определения CTKeyframe.c:92
vector m_Orientation
Определения CTKeyframe.c:8
float m_TotalTimeBefore
Определения CTKeyframe.c:5
EditBoxWidget m_InterpTimeWidget
Определения CTKeyframe.c:13
bool IsFocusable(Widget w)
Определения CTKeyframe.c:156
void SetTimeBefore(float time)
Определения CTKeyframe.c:107
override bool OnFocus(Widget w, int x, int y)
Определения CTKeyframe.c:146
TextWidget m_IndexWidget
Определения CTEvent.c:11
int GetPin()
Определения CTKeyframe.c:62
void ~CTKeyframe()
Определения CTKeyframe.c:45
int m_Index
Определения CTEvent.c:3
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения EnWidgets.c:220
Определения EnWidgets.c:190
proto string ToString(bool simple=true)
Определения EnConvert.c:106
proto native CGame GetGame()
proto native float ToFloat()
Converts string to float.
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Определения proto.c:332