private void addFromOscarAssetToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.Filter = "Comp file (*.comp)|*.comp"; openFileDialog1.Title = "Open an Oscar Compound"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { ManagerCompanion companion = new ManagerCompanion(); RigDeserializer deserializer = new RigDeserializer(); PathHelper.InitPathSubstitutions(AreaMapFramework.Properties.Settings.Default.OscarPath); ProjectsManager pm = ProjectsManager.Get(deserializer, new RigCreator(), companion); RigCompound node = pm.GetRig(openFileDialog1.FileName) as RigCompound; RigsProject nodeProj = null; foreach (RigsProject proj in pm.Projects) { if (node.Path.StartsWith(proj.ResolvedProjectPath)) { nodeProj = proj; break; } } if (nodeProj == null) { MessageBox.Show(string.Format("Can't find Project for Node {0} !", node.FullName)); return; } AssetManager am = new AssetManager(nodeProj.AssetFullPath); am.GetVersions(); VersionGeneration version = am.Versions[0]; GenerationData genData = new GenerationData(version, node); genData.GetRenamings(); /* * List<string> controllers = new List<string>(); * * foreach (RigElement elem in genData.Controllers) * { * if (genData.CtrlsInfos.ContainsKey(elem.FullName) && genData.CtrlsInfos[elem.FullName].Expose) * { * ControllerInfos ctrl = genData.CtrlsInfos[elem.FullName]; * controllers.Add(string.Format("{0} : X {1}, Y {2}, Size : {3}, Color {4}", ctrl.RealName, elem.Trans.Pos.X, elem.Trans.Pos.Y, elem.Size, pm.ProjectPrefs.GetColor(elem))); * } * } * * MessageBox.Show(string.Format("Node {0} controllers :\n{1}", node, TypesHelper.Join(controllers, "\n"))); */ if (addOscarForm == null) { editor = new AddOscarControlsUCtrl(); addOscarForm = new Form(); addOscarForm.Controls.Add(editor); editor.Dock = DockStyle.Fill; editor.AddBT.Click += new EventHandler(AddBT_Click); addOscarForm.FormClosed += AddOscarForm_FormClosed; } editor.Init(AreaMapComponent, genData); addOscarForm.Show(); } }