/[MorrowindCustomClothingSlotCreator]/trunk/libTES3FileFormat/TES3PluginLoader.cs
ViewVC logotype

Diff of /trunk/libTES3FileFormat/TES3PluginLoader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libTES3FileFormat/TES3PluginLoader.cs	2011/07/30 11:47:53	33
+++ trunk/libTES3FileFormat/TES3PluginLoader.cs	2011/07/30 12:33:46	34
@@ -9,6 +9,7 @@
 {
     public interface IPluginData
     {
+        string PluginFile { get; }
         PluginMagic Magic { get; }
         PluginHeader Header { get; }
         PluginMaster MasterSection { get; }
@@ -46,7 +47,7 @@
         {
             this.Log = new ConsoleLog(LogControl);
         }
-        private string PluginFile = "";
+        //private string PluginFile = "";
 
         #region ITES3PluginLoader Members
         private bool _PluginSavingIsImplemented;
@@ -58,7 +59,8 @@
         private StringBuilder AddPluginFailureReason;
         public string PluginLoadFailureReason { get { return AddPluginFailureReason.ToString(); } internal set { this.AddPluginFailureReason.Append(value); } }
 
-        
+        private string _PluginFile;
+        public string PluginFile { get { return _PluginFile; } private set { _PluginFile = value; } }
 
         public bool Load()
         {
@@ -140,6 +142,10 @@
                     this.PluginLoadFailureReason = "This plugin was opened in readonly mode";
                     return false;
                 }
+                else
+                {
+                    return Save();
+                }
             }
             if (!this.PluginLoaded)
             {
@@ -147,8 +153,12 @@
                 return false;
             }
             bool ret = false;
-            //AddPluginFailureReason.Append("Plugin Loading has not been implemented");
-            this.PluginLoadFailureReason = "Plugin Saving has not been implemented";
+            ////AddPluginFailureReason.Append("Plugin Loading has not been implemented");
+            //this.PluginLoadFailureReason = "Plugin Saving has not been implemented";
+
+            CustomCommitFileWriter writer = new CustomCommitFileWriter(this, filename);
+            ret = this.Commit(writer);
+
             return ret;
         }
         #endregion
@@ -196,7 +206,18 @@
 
             return ret;
         }
+        //public bool Commit(ICustomCommitFileWriter writer)
+        //{
+        //    bool ret = false;
+        //    ret = this.ClothingSection.Commit(writer);
+
+        //    if (ret)
+        //    {
+        //        writer.GetWriter().Close();
+        //    }
 
+        //    return ret;
+        //}
         #endregion
 
         #region ICommitWriter Members

 

  ViewVC Help
Powered by ViewVC 1.1.22