/[MorrowindCustomClothingSlotCreator]/trunk/MorrowindCustomClothingSlotCreator/Form1.cs
ViewVC logotype

Annotation of /trunk/MorrowindCustomClothingSlotCreator/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (hide annotations) (download)
Fri Jul 29 16:09:53 2011 UTC (8 years, 6 months ago) by william
File size: 2074 byte(s)
*** overhaul of code:
    +++ forget trying to parse the entire TES3 ESM/ESP plugin format
        just parse the clothing section

1 william 4 using System;
2     using System.Collections.Generic;
3     using System.ComponentModel;
4     using System.Data;
5     using System.Drawing;
6     using System.Text;
7     using System.Windows.Forms;
8     using libTES3FileFormat;
9    
10     namespace MorrowindCustomClothingSlotCreator
11     {
12    
13     public partial class Form1 : Form
14     {
15     public static MorrowindPathHelper MorrowindData = new MorrowindPathHelper();
16     public static string MorrowindPath = MorrowindData.MorrowindInstallPath;
17     public static string MorrowindDataFilesPath = MorrowindPath + "\\Data Files\\";
18    
19     private TES3PluginLoader TES3PluginLoader;
20    
21     public Form1()
22     {
23     InitializeComponent();
24     this.TES3PluginLoader = new TES3PluginLoader();
25     }
26    
27     public bool LoadPlugin(string pluginFile)
28     {
29     bool loaded = this.TES3PluginLoader.Load();
30    
31     if (loaded)
32     {
33     MessageBox.Show("Successfully Loaded Plugin: " + pluginFile, "Successfully Loaded File:", MessageBoxButtons.OK, MessageBoxIcon.Information);
34     }
35    
36     return loaded;
37     }
38    
39    
40     private void mnuItemExit_Click(object sender, EventArgs e)
41     {
42     this.Close();
43     }
44    
45     private void mnuItemOpenPlugin_Click(object sender, EventArgs e)
46     {
47 william 17 this.log.Clear();
48 william 4 PluginLoader.InitialDirectory = MorrowindDataFilesPath;
49     DialogResult result = PluginLoader.ShowDialog();
50     string PluginFile = PluginLoader.FileName;
51     if (result != DialogResult.OK) return;
52     //MessageBox.Show("Load Plugin: " + PluginLoader.FileName);
53 william 8 this.TES3PluginLoader = new TES3PluginLoader(PluginFile, this.log);
54 william 4 if (!this.LoadPlugin(PluginFile))
55     {
56     MessageBox.Show("Failed to Load Plugin: " + PluginFile + "\n\nReason: \n\n" + this.TES3PluginLoader.PluginLoadFailureReason, "Failed to Load File:", MessageBoxButtons.OK, MessageBoxIcon.Error);
57     }
58     }
59     }
60     }

  ViewVC Help
Powered by ViewVC 1.1.22