void ShowAnimationSet(AnimationSet animSet) { listView2.Items.Clear(); listView2.Tag = animSet; foreach (Animation anim in animSet.Animations) { ListViewItem lvItem = listView2.Items.Add(anim.Name); lvItem.Tag = anim; } }
public Player(Game1 game) { mGame = game; mAnimationset = AnimationSetManager.Instance.Get("tuzi"); mAnimation = mAnimationset.Animations[0]; }
private void OnNewAnimSetClicked(object sender, EventArgs e) { AnimationSet animationSet = new AnimationSet(); animationSet.Name = "AnimationSet" + AnimationSetManager.Instance.AnimationSets.Count; SettingDlg dlg = new SettingDlg("New Animation Set", animationSet); if (dlg.ShowDialog() != DialogResult.OK) return; if (AnimationSetManager.Instance.Contains(animationSet.Name)) { MessageBox.Show(string.Format("Animation '{0}' already exist!!!", animationSet.Name)); return; } AnimationSetManager.Instance.Add(animationSet); ShowAnimationSets(); listView1.Items[listView1.Items.Count - 1].Selected = true; }