示例#1
0
        /// <summary>Saves generated AnimChainList to file and copies it's sprite sheet file to same director if necessary.</summary>
        /// <param name="animChainListSave">AnimationChainListSave data structure generated by GenerateAnimChain()</param>
        /// <param name="achxSavePath">Directory path to where achx file should be saved</param>
        /// <param name="achxFileName">Name of achx output file without extension</param>
        /// <param name="spriteSheetLocation">Directory where sprite sheet image for this cnim chain is located</param>
        public static void SaveAchx(AnimationChainListSave animChainListSave, string achxSavePath, string achxFileName, string spriteSheetLocation)
        {
            if (!File.Exists(Path.Combine(achxSavePath, _SpriteSheetFileName)))
            {
                File.Copy(
                    Path.Combine(spriteSheetLocation, _SpriteSheetFileName),
                    Path.Combine(achxSavePath, _SpriteSheetFileName)
                    );
            }

            animChainListSave.Save(Path.Combine(achxSavePath, achxFileName + ".achx"));
        }
示例#2
0
        private void HandleForceSaveAll(object sender, EventArgs e)
        {
            foreach (var rfs in FlatRedBall.Glue.Elements.ObjectFinder.Self.GetAllReferencedFiles()
                     .Where(item => FileManager.GetExtension(item.Name) == "achx"))
            {
                string fullFileName = FlatRedBall.Glue.ProjectManager.MakeAbsolute(rfs.Name);

                if (System.IO.File.Exists(fullFileName))
                {
                    try
                    {
                        AnimationChainListSave acls = AnimationChainListSave.FromFile(fullFileName);

                        acls.Save(fullFileName);

                        PluginManager.ReceiveOutput("Re-saved " + rfs.ToString());
                    }
                    catch (Exception exc)
                    {
                        PluginManager.ReceiveError(exc.ToString());
                    }
                }
            }
        }