private void btnNewSprite_Click(object sender, EventArgs e) { if (PromptToApplyChangesAndContinue()) { TempInformation = null; CurrentSIIndex = -1; SetUpEmptyInfo(); SpriteInformationToForm(); UpdateMenu(); } }
/// <summary> /// Update the current SpriteInfo class such that it is identical to the class you are copying from. /// </summary> /// <param name="toCopyFrom">A spriteInfo class</param> public void CopyFrom(SpriteInfo toCopyFrom) { if (toCopyFrom == null) { return; } SpriteName = toCopyFrom.SpriteName; ViewPercent = toCopyFrom.ViewPercent; Animations.Clear(); foreach (AnimationInfo AI in toCopyFrom.Animations) { Animations.Add(AI.Clone()); } }
private void btnBack_Click(object sender, EventArgs e) { if (PromptToApplyChangesAndContinue()) { if (SpriteInformation.Count == 0) { return; //nothing to do } CurrentSIIndex--; if (CurrentSIIndex < 0) { CurrentSIIndex = SpriteInformation.Count - 1; } if (TempInformation == null) { TempInformation = new SpriteInfo(); } WeHaveNewItem(); } }
private void SelectNewIndex(int nindex) { if (nindex < 0) { return; } if (nindex >= SpriteInformation.Count) { return; } CurrentSIIndex = nindex; if (PreviewSprite != null) { PreviewSprite.Destroy(); } TempInformation = SpriteInformation[nindex].Clone(); CurrentSIAnimation = 0; //always start at animation 0 WeHaveNewItem(); UpdateMenu(); }