Esempio n. 1
0
 private void OpenEditor(object sender, EventArgs args)
 {
     if (Editor == null || Editor.IsDisposed)
     {
         Editor      = new NutEditor(this);
         Editor.Text = Parent.Text + "\\" + Text;
         //Editor.ShowDialog();
         MainForm.Instance.AddDockedControl(Editor);
     }
     else
     {
         Editor.BringToFront();
     }
 }
Esempio n. 2
0
        public void Save(object sender, EventArgs args)
        {
            using (var sfd = new SaveFileDialog())
            {
                sfd.Filter = "Namco Universal Texture (.nut)|*.nut|" +
                             "All Files (*.*)|*.*";

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    NutEditor.ShowGtxMipmapWarning(this);
                    File.WriteAllBytes(sfd.FileName, Rebuild());
                }
            }
        }
Esempio n. 3
0
 private void chr_13_renderer_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(DataFormats.FileDrop))
     {
         string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
         foreach (string filePath in files)
         {
             if (filePath.ToLower().EndsWith(".dds"))
             {
                 Dds dds = new Dds(new FileData(filePath));
                 if (sender == chr_13_renderer)
                 {
                     chr13 = ReplaceTexture(dds.ToNutTexture(), 416, 416, chr13);
                     if (chr13Loc != null)
                     {
                         chr13.Save(chr13Loc);
                     }
                 }
                 if (sender == chr_00_renderer)
                 {
                     chr00 = ReplaceTexture(dds.ToNutTexture(), 128, 128, chr00);
                     if (chr00Loc != null)
                     {
                         chr00.Save(chr00Loc);
                     }
                 }
                 if (sender == chr_11_renderer)
                 {
                     chr11 = ReplaceTexture(dds.ToNutTexture(), 384, 384, chr13);
                     if (chr11Loc != null)
                     {
                         chr11.Save(chr11Loc);
                     }
                 }
             }
             if (filePath.ToLower().EndsWith(".png"))
             {
                 if (sender == stock_90_renderer)
                 {
                     stock90 = ReplaceTexture(NutEditor.FromPng(filePath, 0), 64, 64, chr13);
                     if (stock90Loc != null)
                     {
                         stock90.Save(stock90Loc);
                     }
                 }
             }
         }
         ((GLControl)sender).Invalidate();
     }
 }