예제 #1
0
 public virtual void Run(Progress progress)
 {
 }
예제 #2
0
 protected override bool OnSave(string fileName, Progress progress)
 {
     myBIN.Save(fileName);
     return(true);
 }
예제 #3
0
        public override void Build(BIGFile big, Progress progress)
        {
            base.Build(big, progress);

            addEntryToolStripMenuItem.Text = "Add Texture";
        }
예제 #4
0
        protected void CheckUIDs(string[] files, Progress progress)
        {
            string info = "Checking ";

            int index = 0;

            for (int i = 0; i < files.Length; ++i)
            {
                progress.Info =
                    info + Path.GetFileName(files[i]) + "...";

                TNGFile tng = new TNGFile(
                    FileDatabase.Instance.TNGDefinitions);

                tng.Load(files[i]);

                List <CTCBlock> ctcs = GetOwned(tng);

                for (int j = 0; j < tng.SectionCount; ++j)
                {
                    foreach (Thing thing in tng.get_Sections(j).Things)
                    {
                        if (IsValid(thing))
                        {
                            int found = myUIDs.IndexOf(thing.UID);

                            if (found >= 0 && found != index)
                            {
                                /*
                                 * Console.WriteLine(
                                 *  "Update: Index={0} Found={1} Thing={2}",
                                 *  index,
                                 *  found,
                                 *  thing.DefinitionType);
                                 */

                                UpdateThing(thing, ctcs);

                                ++myCount;
                            }
                            else
                            {
                                // New uid, add to the list.
                                myUIDs.Add(thing.UID);
                            }

                            ++index;
                        }
                    }
                }

                if (tng.Modified)
                {
                    if (mySaves.IndexOf(files[i]) < 0)
                    {
                        mySaves.Add(files[i]);
                    }

                    tng.Save(files[i]);
                }

                ctcs = null;

                tng.Dispose();

                progress.Update();
            }
        }