private void listKeyframes_SelectedIndexChanged(object sender, EventArgs e) { int index = listKeyframes.SelectedIndex; if (index >= 0) { FogAnimationFrame f = (FogAnimationFrame)listKeyframes.SelectedItem; numFrame.Value = (decimal)(f.Index + 1); } }
private void RefreshPage() { if (_target != null) { //_currentPage = (int)numFrame.Value - 1; _currentFrame = _target.GetAnimFrame(_currentPage); numStart.Value = _currentFrame.Start; numEnd.Value = _currentFrame.End; for (int i = 0; i < 2; i++) UpdateBox(i); btnPrev.Enabled = _currentPage > 0; btnNext.Enabled = _currentPage < (_numFrames - 1); listKeyframes.SelectedIndex = FindKeyframe(_currentPage); } }
public void UpdateKeyframe(int x) { if (!Visible) { return; } _updating = true; if (_target is CHR0EntryNode || _target is SRT0TextureNode) { IKeyframeSource entry = _target as IKeyframeSource; for (int w = 0; w < listKeyframes.Items.Count; w++) { if (_target is CHR0EntryNode) { CHRAnimationFrame a = (CHRAnimationFrame)listKeyframes.Items[w]; if (a.Index == x) { CHRAnimationFrame r = ((CHR0EntryNode)entry).GetAnimFrame(x); if (r.HasKeys) { listKeyframes.Items[w] = r; } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } } else if (_target is SRT0TextureNode) { SRTAnimationFrame a = (SRTAnimationFrame)listKeyframes.Items[w]; if (a.Index == x) { SRTAnimationFrame r = ((SRT0TextureNode)entry).GetAnimFrame(x); if (r.HasKeys) { listKeyframes.Items[w] = r; } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } } } UpdateKeyframes(); } else if (_target is SHP0VertexSetNode) { SHP0VertexSetNode entry = _target as SHP0VertexSetNode; int w = 0; foreach (FloatKeyframe a in listKeyframes.Items) { if (a.Index == x) { KeyframeEntry e = entry.GetKeyframe(x); if (e != null) { listKeyframes.Items[w] = new FloatKeyframe(e); } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } w++; } UpdateKeyframes(); } else if (_target is SCN0EntryNode) { if (_target is SCN0CameraNode) { SCN0CameraNode entry = _target as SCN0CameraNode; for (int w = 0; w < listKeyframes.Items.Count; w++) { CameraAnimationFrame a = (CameraAnimationFrame)listKeyframes.Items[w]; if (a.Index == x) { CameraAnimationFrame r = entry.GetAnimFrame(x); if (r.HasKeys) { listKeyframes.Items[w] = r; } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } } UpdateKeyframes(); } else if (_target is SCN0LightNode) { SCN0LightNode entry = _target as SCN0LightNode; for (int w = 0; w < listKeyframes.Items.Count; w++) { LightAnimationFrame a = (LightAnimationFrame)listKeyframes.Items[w]; if (a.Index == x) { LightAnimationFrame r = entry.GetAnimFrame(x); if (r.HasKeys) { listKeyframes.Items[w] = r; } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } } UpdateKeyframes(); } else if (_target is SCN0FogNode) { SCN0FogNode entry = _target as SCN0FogNode; for (int w = 0; w < listKeyframes.Items.Count; w++) { FogAnimationFrame a = (FogAnimationFrame)listKeyframes.Items[w]; if (a.Index == x) { FogAnimationFrame r = entry.GetAnimFrame(x); if (r.HasKeys) { listKeyframes.Items[w] = r; } else { listKeyframes.Items.RemoveAt(w); } _updating = false; return; } } UpdateKeyframes(); } } _updating = false; }