/// <summary> /// Shows an interface to duplicate the given animation /// </summary> /// <param name="animation">The animation to duplicate</param> public void ShowDuplicateAnimation(Animation animation) { Animation dup = CurrentBundle.DuplicateAnimation(animation, null); _mainForm.AddAnimation(dup, true); _mainForm.OpenViewForAnimation(dup); MarkUnsavedChanges(true); }
/// <summary> /// Returns a unique animation sheet name, used for filling in default animation sheet names /// </summary> /// <returns>A unique animation sheet name to use as a default name</returns> public string GetUniqueUntitledAnimationSheetName() { string prefix = "Untitled-"; int postfix = 1; while (CurrentBundle.GetAnimationSheetByName(prefix + postfix) != null) { postfix++; } return(prefix + postfix); }
/// <summary> /// Removes the given Animation from the current bundle /// </summary> /// <param name="anim">The Animation to remove from the bundle</param> public void RemoveAnimation(Animation anim) { CurrentBundle.RemoveAnimation(anim); _mainForm.RemoveAnimation(anim); AnimationRemoved?.Invoke(this, new AnimationEventArgs(anim)); MarkUnsavedChanges(true); // Dispose of the animation anim.Dispose(); }
/// <summary> /// Shows an interface to duplicate the given AnimationSheet object /// </summary> /// <param name="sheet">The animation sheet to duplicate</param> public void ShowDuplicateAnimationSheet(AnimationSheet sheet) { AnimationSheet dup = CurrentBundle.DuplicateAnimationSheet(sheet); _mainForm.AddAnimationSheet(dup, true); _mainForm.OpenViewForAnimationSheet(dup); // Add the cloned animations as well foreach (Animation anim in dup.Animations) { _mainForm.AddAnimation(anim); } MarkUnsavedChanges(true); }
/// <summary> /// Adds the given Animation Sheet into the current bundle /// </summary> /// <param name="sheet">The sheet to load into the current bundle</param> /// <param name="openOnForm">Whether to open the newly added animation sheet on the main form</param> public void AddAnimationSheet(AnimationSheet sheet, bool openOnForm) { CurrentBundle.AddAnimationSheet(sheet); if (openOnForm) { _mainForm.AddAnimationSheet(sheet, true); _mainForm.OpenViewForAnimationSheet(sheet); } else { _mainForm.AddAnimationSheet(sheet); } AnimationSheetAdded?.Invoke(this, new AnimationSheetEventArgs(sheet)); MarkUnsavedChanges(true); }
/// <summary> /// Adds the given Animation into the current bundle /// </summary> /// <param name="anim">The animation to add to the bundle</param> /// <param name="openOnForm">Whether to open the newly added animation on the main form</param> /// <param name="parentSheet">Optional AnimationSheet that will own the newly created animation</param> public void AddAnimation(Animation anim, bool openOnForm, AnimationSheet parentSheet = null) { CurrentBundle.AddAnimation(anim, parentSheet); if (openOnForm) { _mainForm.AddAnimation(anim, true); _mainForm.OpenViewForAnimation(anim); } else { _mainForm.AddAnimation(anim); } AnimationAdded?.Invoke(this, new AnimationEventArgs(anim)); MarkUnsavedChanges(true); }
/// <summary> /// Removes the given AnimationSeet from the current bundle /// </summary> /// <param name="sheet">The sheet to remove from the bundle</param> /// <param name="deleteAnimations">Whether to delete the nested animations as well. If set to false, the animations will be moved to the bundle's root</param> public void RemoveAnimationSheet(AnimationSheet sheet, bool deleteAnimations) { // Remove/relocate animations if (deleteAnimations) { foreach (Animation anim in sheet.Animations) { RemoveAnimation(anim); } } // Remove the sheet CurrentBundle.RemoveAnimationSheet(sheet, false); _mainForm.RemoveAnimationSheet(sheet); AnimationSheetRemoved?.Invoke(this, new AnimationSheetEventArgs(sheet)); MarkUnsavedChanges(true); }
private void UpdateCurrentBundle() { CurrentBundle.BeginUpdate(); CurrentBundle.Nodes.Clear(); TreeNode root = CurrentBundle.Nodes.Add(string.Format(BUNDLE_SENDER_FORMAT, BundleSelection.Text)); for (int i = 0; i < AccountsContainer.Controls.Count; ++i) { RadioButton radioButton = (RadioButton)AccountsContainer.Controls[i]; if (radioButton.Checked) { root.Nodes.Add(radioButton.Text); break; } } var checkedItems = ProductList.CheckedItems.GetEnumerator(); while (checkedItems.MoveNext()) { root.Nodes.Add(checkedItems.Current.ToString()); } root.ExpandAll(); CurrentBundle.EndUpdate(); }
/// <summary> /// Gets the AnimationSheet that currently owns the given Animation object. /// If the Animation is not inside any AnimationSheet, null is returned /// </summary> /// <param name="anim">The animation object to get the animation sheet of</param> /// <returns>The AnimationSheet that currently owns the given Animation object. If the Animation is not inside any AnimationSheet, null is returned</returns> public AnimationSheet GetOwningAnimationSheet(Animation anim) { return(CurrentBundle.GetOwningAnimationSheet(anim)); }
/// <summary> /// Adds the given Animation object into the given AnimationSheet object /// If null is provided as animation sheet, the animation is removed from it's current animation sheet, if it's inside one /// </summary> /// <param name="anim">The animation to add to the animation sheet</param> /// <param name="sheet">The AnimationSheet to add the animation to</param> public void AddAnimationToAnimationSheet(Animation anim, AnimationSheet sheet) { CurrentBundle.AddAnimationToAnimationSheet(anim, sheet); MarkUnsavedChanges(true); }
/// <summary> /// Rearranges the index of an AnimationSheets in the sheets's current storing container /// </summary> /// <param name="sheet">The sheet to rearrange</param> /// <param name="newIndex">The new index to place the sheet at</param> public void RearrangeAnimationSheetsPosition(AnimationSheet sheet, int newIndex) { CurrentBundle.RearrangeAnimationSheetsPosition(sheet, newIndex); MarkUnsavedChanges(true); }
/// <summary> /// Gets the index of the given AnimationSheet object inside its current parent container /// </summary> /// <param name="sheet">The sheet to get the index of</param> /// <returns>The index of the sheet in its current parent container</returns> public int GetAnimationSheetIndex(AnimationSheet sheet) { return(CurrentBundle.GetAnimationSheetIndex(sheet)); }
/// <summary> /// Rearranges the index of an Animation in the animation's current storing container /// </summary> /// <param name="anim">The animation to rearrange</param> /// <param name="newIndex">The new index to place the animation at</param> public void RearrangeAnimationsPosition(Animation anim, int newIndex) { CurrentBundle.RearrangeAnimationsPosition(anim, newIndex); MarkUnsavedChanges(true); }
/// <summary> /// Gets the index of the given Animation object inside its current parent container /// </summary> /// <param name="anim">The animation to get the index of</param> /// <returns>The index of the animation in its current parent container</returns> public int GetAnimationIndex(Animation anim) { return(CurrentBundle.GetAnimationIndex(anim)); }