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

Annotation of /trunk/MorrowindCustomClothingSlotCreator/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23 - (hide annotations) (download)
Fri Jul 29 18:35:02 2011 UTC (8 years, 5 months ago) by william
File size: 2400 byte(s)
*** initial support for editing the clothing slot data

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 william 23 foreach (ClothingEntry entry in this.TES3PluginLoader.ClothingSection.ClothingEntries)
34     {
35     lstClothingEntries.Items.Add(entry.CLOT_NAME);
36     }
37 william 4 MessageBox.Show("Successfully Loaded Plugin: " + pluginFile, "Successfully Loaded File:", MessageBoxButtons.OK, MessageBoxIcon.Information);
38     }
39    
40     return loaded;
41     }
42    
43    
44     private void mnuItemExit_Click(object sender, EventArgs e)
45     {
46     this.Close();
47     }
48    
49     private void mnuItemOpenPlugin_Click(object sender, EventArgs e)
50     {
51 william 17 this.log.Clear();
52 william 4 PluginLoader.InitialDirectory = MorrowindDataFilesPath;
53     DialogResult result = PluginLoader.ShowDialog();
54     string PluginFile = PluginLoader.FileName;
55     if (result != DialogResult.OK) return;
56     //MessageBox.Show("Load Plugin: " + PluginLoader.FileName);
57 william 8 this.TES3PluginLoader = new TES3PluginLoader(PluginFile, this.log);
58 william 4 if (!this.LoadPlugin(PluginFile))
59     {
60     MessageBox.Show("Failed to Load Plugin: " + PluginFile + "\n\nReason: \n\n" + this.TES3PluginLoader.PluginLoadFailureReason, "Failed to Load File:", MessageBoxButtons.OK, MessageBoxIcon.Error);
61     }
62     }
63 william 23
64     private void lstClothingEntries_SelectedIndexChanged(object sender, EventArgs e)
65     {
66    
67     }
68 william 4 }
69     }

  ViewVC Help
Powered by ViewVC 1.1.22