/[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 13:58:26	38
+++ trunk/MorrowindCustomClothingSlotCreator/Form1.cs	2011/07/30 14:20:13	39
@@ -128,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)
@@ -173,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
             {
@@ -195,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