Ejemplo n.º 1
0
 public frmCvnEditor()
 {
     m_entry = m_palette = null;
     m_workingfile = null;
     m_workingpath = string.Empty;
     m_discard_changes = true;
     m_is_from_stream = false;
     m_changed = false;
     m_failed = false;
     InitializeComponent();
 }
Ejemplo n.º 2
0
 private void AddNode(TenshiEntry i)
 {
     string[] Path = i.EntryPath;
     int index;
     TreeNodeCollection root = FileTree.Nodes;
     TreeNodeCollection working = root;
     for (index = 0; index < Path.Length; index++)
     {
         string node = Path[index];
         if (!working.ContainsKey(node)) break;
         working = working[node].Nodes;
     }
     TreeNode last = null;
     for (; index < Path.Length; index++)
     {
         working.Add(new TreeNode(Path[index]) { Name = Path[index], Tag = null });
         last = working[Path[index]];
         working = working[Path[index]].Nodes;
     }
     if (last != null)
     {
         last.Tag = i;
     }
 }
Ejemplo n.º 3
0
 public frmCvnEditor(TenshiEntry BaseFile, TenshiEntry Palette = null)
     : this()
 {
     m_entry = BaseFile;
     m_palette = Palette;
     m_workingpath = m_entry.Entry;
     try
     {
         m_workingfile = cvn.Open(BaseFile, BaseFile.Type, Palette);
     }
     catch (FormatException)
     {
         m_failed = true;
         return;
     }
     if (m_workingfile == null)
     {
         m_failed = true;
         return;
     }
     m_is_from_stream = true;
     RefreshView();
     m_changed = false;
 }
Ejemplo n.º 4
0
        private void MenuAdd_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "cvn 파일(*.cv*)|*.cv*|모든 파일(*.*)|*.*";
            ofd.FilterIndex = 1;
            ofd.CheckFileExists = ofd.CheckPathExists = true;
            ofd.Multiselect = true;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                foreach (string file_name in ofd.FileNames)
                {
                    frmEntryName dlgName = new frmEntryName();
                    dlgName.Top = this.Top + 50;
                    dlgName.Left = this.Left + 50;
                    dlgName.Entry = file_name;
                    dlgName.ShowDialog();
                    if (dlgName.Entry == string.Empty) return;
                    TenshiEntry i = new TenshiEntry(null, dlgName.Entry, 0, 0);
                    i.ChangedStream = File.OpenRead(file_name);
                    m_workingfile.Entries.Add(i);
                    AddNode(i);
                }
            }
        }