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

Diff of /trunk/MorrowindCustomClothingSlotCreator/Form1.cs

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

--- trunk/MorrowindCustomClothingSlotCreator/Form1.cs	2011/07/30 12:34:22	35
+++ trunk/MorrowindCustomClothingSlotCreator/Form1.cs	2011/07/30 14:20:13	39
@@ -24,7 +24,8 @@
             this.TES3PluginLoader = new TES3PluginLoader();
 
             foreach (int val in Enum.GetValues(typeof(ClothingTypes))) { comboClothingType.Items.Add(Enum.GetName(typeof(ClothingTypes), val)); }
-            for (int i = 1; i < 0x100; i++) { comboCustomClothingSlotIndex.Items.Add("0x" + i.ToString("X2")); }
+            comboCustomClothingSlotIndex.Items.Add("Default"); 
+            for (int i = 1; i < 0x10; i++) { comboCustomClothingSlotIndex.Items.Add("0x" + i.ToString("X2")); }
 
         }
 
@@ -127,13 +128,11 @@
 
             txtClothingName.Text = entry.CLOT_NAME;
 
-            int actual_type = entry.CLOT_CTDT_TYPE;
-            //int actual_type = 0x01020309;
+            //int actual_type = entry.CLOT_CTDT_TYPE;
+            int actual_type = 0x00000F9;         
 
-            byte type = (byte)( (actual_type & 0x000000FF) >> 0);
-            byte unknown2 = (byte)((actual_type & 0x0000FF00) >> 8);
-            byte unknown1 = (byte)((actual_type & 0x00FF0000) >> 16);
-            byte index = (byte)((uint)(actual_type & 0xFF000000) >> 24);
+            byte type = (byte)(actual_type & 0x0000000F);
+            byte index = (byte)((actual_type & 0x000000F0) >> 4);
 
             // Set the clothing type in the drop down
             foreach (string item in comboClothingType.Items)
@@ -172,12 +171,17 @@
             ClothingEntry entry = (btnCommitEntry.Tag as ClothingEntry);
             if (entry == null) return;
 
+
+            int unknown1 = 0;
             byte type = 0;
             byte index = 0;
 
+            unknown1 = entry.CLOT_CTDT_TYPE;
+            //unknown1 = 0x12345609;
+
             if (comboClothingType.Items[comboClothingType.SelectedIndex].ToString() == "Unknown")
             {
-                type = (byte)((entry.CLOT_CTDT_TYPE & 0x000000FF) >> 0);
+                type = (byte)(unknown1 & 0x0000000F);
             }
             else
             {
@@ -194,9 +198,10 @@
             if (comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString() == "Default") { index = 0; }
             else { index = Convert.ToByte(comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString(),16); }
             
+            //int SlotIndex = (index << 24) | type;
+            int SlotIndex = (index << 4) | type | (int)(unknown1 & 0xFFFFFF00);
 
 
-            int SlotIndex = (index << 24) | type;
             if (CommitClothingEntry(entry, SlotIndex))
             {
                 MessageBox.Show("Successfully Commited: " + entry.CLOT_NAME, "Clothing Entry Commit:", MessageBoxButtons.OK, MessageBoxIcon.Information);

 

  ViewVC Help
Powered by ViewVC 1.1.22