4 protected float m_InterpTime;
5 protected float m_TotalTimeBefore;
9 protected CameraToolsMenu
m_Menu;
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 )
23 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/camera_tools/keyframe_entry.layout", root );
30 m_TotalTimeWidget =
TextWidget.Cast(
m_Root.FindAnyWidget(
"keyframe_time" ) );
33 m_TotalTimeBefore = time_before;
37 SetInterpTime( int_value );
41 m_IndexWidget.SetText( m_Index.ToString() );
52 string time_text = m_InterpTimeWidget.GetText();
53 m_InterpTime = time_text.ToFloat();
57 void SetPin(
int pin )
59 m_PinWidget.SetText( pin.ToString() );
64 return m_PinWidget.GetText().ToInt();
67 void SetFOV(
float fov )
69 m_FOVWidget.SetText( fov.ToString() );
74 return m_FOVWidget.GetText().ToFloat();
77 void SetDOF(
float dof )
79 m_DOFWidget.SetText( dof.ToString() );
84 return m_DOFWidget.GetText().ToFloat();
92 void SetOrientation(
vector orient )
107 void SetTimeBefore(
float time )
109 m_TotalTimeBefore = time;
110 m_TotalTimeWidget.SetText( ( m_TotalTimeBefore + m_InterpTime ).
ToString() );
113 void SetInterpTime(
float time )
116 m_InterpTimeWidget.SetText( m_InterpTime.ToString() );
117 m_TotalTimeWidget.SetText( ( m_TotalTimeBefore + m_InterpTime ).
ToString() );
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 ) );
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 ) );
140 m_Menu.SelectKeyframe(
this );
150 m_Menu.SelectKeyframe(
this );
160 return ( w == m_InterpTimeWidget || w == m_TotalTimeWidget || w == m_FOVWidget || w == m_DOFWidget );