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

Diff of /trunk/MorrowindCustomClothingSlotCreator/Form1.cs

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

revision 38 by william, Sat Jul 30 13:58:26 2011 UTC revision 40 by william, Sat Jul 30 14:21:44 2011 UTC
# Line 129  namespace MorrowindCustomClothingSlotCre Line 129  namespace MorrowindCustomClothingSlotCre
129              txtClothingName.Text = entry.CLOT_NAME;              txtClothingName.Text = entry.CLOT_NAME;
130    
131              int actual_type = entry.CLOT_CTDT_TYPE;              int actual_type = entry.CLOT_CTDT_TYPE;
132              //int actual_type = 0x01020309;              //int actual_type = 0x00000F9;        
133    
134              byte type = (byte)( (actual_type & 0x000000FF) >> 0);              byte type = (byte)(actual_type & 0x0000000F);
135              byte unknown2 = (byte)((actual_type & 0x0000FF00) >> 8);              byte index = (byte)((actual_type & 0x000000F0) >> 4);
             byte unknown1 = (byte)((actual_type & 0x00FF0000) >> 16);  
             byte index = (byte)((uint)(actual_type & 0xFF000000) >> 24);  
136    
137              // Set the clothing type in the drop down              // Set the clothing type in the drop down
138              foreach (string item in comboClothingType.Items)              foreach (string item in comboClothingType.Items)
# Line 173  namespace MorrowindCustomClothingSlotCre Line 171  namespace MorrowindCustomClothingSlotCre
171              ClothingEntry entry = (btnCommitEntry.Tag as ClothingEntry);              ClothingEntry entry = (btnCommitEntry.Tag as ClothingEntry);
172              if (entry == null) return;              if (entry == null) return;
173    
174    
175                int unknown1 = 0;
176              byte type = 0;              byte type = 0;
177              byte index = 0;              byte index = 0;
178    
179                unknown1 = entry.CLOT_CTDT_TYPE;
180                //unknown1 = 0x12345609;
181    
182              if (comboClothingType.Items[comboClothingType.SelectedIndex].ToString() == "Unknown")              if (comboClothingType.Items[comboClothingType.SelectedIndex].ToString() == "Unknown")
183              {              {
184                  type = (byte)((entry.CLOT_CTDT_TYPE & 0x000000FF) >> 0);                  type = (byte)(unknown1 & 0x0000000F);
185              }              }
186              else              else
187              {              {
# Line 195  namespace MorrowindCustomClothingSlotCre Line 198  namespace MorrowindCustomClothingSlotCre
198              if (comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString() == "Default") { index = 0; }              if (comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString() == "Default") { index = 0; }
199              else { index = Convert.ToByte(comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString(),16); }              else { index = Convert.ToByte(comboCustomClothingSlotIndex.Items[comboCustomClothingSlotIndex.SelectedIndex].ToString(),16); }
200                            
201                //int SlotIndex = (index << 24) | type;
202                int SlotIndex = (index << 4) | type | (int)(unknown1 & 0xFFFFFF00);
203    
204    
             int SlotIndex = (index << 24) | type;  
205              if (CommitClothingEntry(entry, SlotIndex))              if (CommitClothingEntry(entry, SlotIndex))
206              {              {
207                  MessageBox.Show("Successfully Commited: " + entry.CLOT_NAME, "Clothing Entry Commit:", MessageBoxButtons.OK, MessageBoxIcon.Information);                  MessageBox.Show("Successfully Commited: " + entry.CLOT_NAME, "Clothing Entry Commit:", MessageBoxButtons.OK, MessageBoxIcon.Information);

Legend:
Removed from v.38  
changed lines
  Added in v.40

  ViewVC Help
Powered by ViewVC 1.1.22