private void Main() { if (!MessageBox.Show(L.Get("pjSMLbegin"), L.Get("pjSML"), MessageBoxButtons.OKCancel, MessageBoxIcon.Information).Equals(DialogResult.OK)) { return; } SimPe.Plugin.RefFile refFile = new SimPe.Plugin.RefFile(); refFile.ProcessData(refFilePFD, currentPackage); if (LinkBodyMesh(refFile)) { refFile.SynchronizeUserData(); MessageBox.Show(L.Get("pjSMLdone"), L.Get("pjSML"), MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Updates the SkinTone References in the 3IDR Files /// </summary> /// <param name="reffile">the 3IDR File</param><param name="skin">the new skintone</param> /// <param name="skinfiles">a Hashtable listing al Proerty Sets for each available skintone (key=skintone string, value= ArrayList of Cpf Objects)</param> void UpdateSkintone(SimPe.Plugin.RefFile reffile, string skin, Hashtable skinfiles) { if (reffile == null) { return; } if (reffile.Items == null) { return; } if (reffile.Package == null) { return; } for (int i = 0; i < reffile.Items.Length; i++) { SimPe.Interfaces.Files.IPackedFileDescriptor pfd = (SimPe.Interfaces.Files.IPackedFileDescriptor)reffile.Items[i]; if (pfd == null) { continue; } if (pfd.Type == Data.MetaData.GZPS) { SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem[] fii = FileTable.FileIndex.FindFile(pfd, reffile.Package); if (fii.Length > 0) { Cpf skinfile = new Cpf(); skinfile.ProcessData(fii[0]); reffile.Items[i] = UpdateSkintone(skinfile, skin, skinfiles); } } } reffile.SynchronizeUserData(); }