MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SetKey

Method SetKey

Editor/TVCharacterKeyDialog.cpp:60–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58// CTVCharacterKeyDialog message handlers
59
60void CTVCharacterKeyDialog::SetKey( IAnimNode *node,IAnimTrack *track,int nkey )
61{
62 m_node = node;
63 m_track = track;
64 m_key = nkey;
65
66 if (m_key < 0 || m_key >= m_track->GetNumKeys())
67 return;
68
69 if (track->GetType() != ATRACK_CHARACTER)
70 return;
71
72 m_animation.ResetContent();
73
74 // Find editor object who owns this node.
75 IEntity *entity = node->GetEntity();
76 if (entity)
77 {
78 // Add available animations.
79 ICryCharInstance *pCharacter = entity->GetCharInterface()->GetCharacter(0);
80 if (pCharacter)
81 {
82 IAnimationSet* pAnimations = pCharacter->GetModel()->GetAnimationSet();
83 assert (pAnimations);
84 int numAnimations = pAnimations->Count();
85 m_animation.AddString("");
86 for (int i = 0; i < numAnimations; i++)
87 {
88 m_animation.AddString ( pAnimations->GetName(i));
89 }
90 }
91 }
92
93 ICharacterKey key;
94 m_track->GetKey( m_key,&key );
95
96 m_animation.SelectString( -1,key.animation );
97 m_blendTime.SetValue( key.blendTime );
98 m_startTime.SetValue( key.startTime );
99 m_timeScale.SetValue( key.speed );
100 m_startTime.SetValue( key.startTime );
101 //m_hide.SetCheck( (key.hidden)?BST_CHECKED:BST_UNCHECKED );
102 m_loopBtn.SetCheck( (key.bLoop)?BST_CHECKED:BST_UNCHECKED );
103 m_unloadBtn.SetCheck(key.bUnload ? BST_CHECKED : BST_UNCHECKED);
104}
105
106//////////////////////////////////////////////////////////////////////////
107BOOL CTVCharacterKeyDialog::OnInitDialog()

Callers 1

ControlsToKeyMethod · 0.45

Calls 15

GetCharInterfaceMethod · 0.80
SelectStringMethod · 0.80
SetCheckMethod · 0.80
GetNumKeysMethod · 0.45
GetTypeMethod · 0.45
ResetContentMethod · 0.45
GetEntityMethod · 0.45
GetCharacterMethod · 0.45
GetAnimationSetMethod · 0.45
GetModelMethod · 0.45
CountMethod · 0.45
AddStringMethod · 0.45

Tested by

no test coverage detected