public override void LoadData() { // set manualChanged flag manualChanged = true; // clear combo boxes cmbActor.Items.Clear(); cmbAnimation.Items.Clear(); // fill combo box FrmAnimationTimeline dlg = this.findAncestorControl(typeof(FrmAnimationTimeline)) as FrmAnimationTimeline; if (dlg != null && dlg.document != null) { List <TLayer> actors = dlg.document.currentScene().getAllChilds(); for (int i = 0; i < actors.Count; i++) { cmbActor.Items.Add(actors[i].name); } } // load action data TActionInstantStopAnimation myAction = (TActionInstantStopAnimation)this.action; cmbActor.Text = myAction.actor; if (myAction.eventu == "" || myAction.state == "") { cmbAnimation.Text = ""; } else { cmbAnimation.Text = myAction.eventu + " - " + myAction.state; } // clear mnualChanged flag manualChanged = false; }
private void SaveData(object sender, EventArgs e) { FrmAnimationTimeline dlg = this.findAncestorControl(typeof(FrmAnimationTimeline)) as FrmAnimationTimeline; TLayer layer = dlg.document.currentScene().findLayer(cmbActor.Text); if (manualChanged == false) { TActionInstantStopAnimation myAction = (TActionInstantStopAnimation)this.action; myAction.actor = cmbActor.Text; if (cmbAnimation.SelectedIndex != -1) { myAction.eventu = layer.animations[cmbAnimation.SelectedIndex].eventu; myAction.state = layer.animations[cmbAnimation.SelectedIndex].state; } else { myAction.eventu = ""; myAction.state = ""; } base.SaveData(); } }