private unsafe void btnOkay_Click(object sender, EventArgs e) { switch (comboBox3.SelectedIndex) { case 0: _parent.AddChild((ResourceNode)_baseInf); break; case 1: _parent.Parent.AddChild((ResourceNode)_baseInf); _parent.Remove(); break; case 2: MergeChildren(_parent, (MDL0BoneNode)_baseInf, _mergeModels ? (ResourceNode)_externalModel : (ResourceNode)node); break; } if (_mergeModels) { foreach (MDL0PolygonNode poly in _externalModel.FindChild("Objects", true).Children) { ImportObject(poly); } } else { ImportObject(node); } _internalModel.SignalPropertyChange(); DialogResult = DialogResult.OK; Close(); }
private unsafe void btnOkay_Click(object sender, EventArgs e) { switch (comboBox3.SelectedIndex) { case 0: foreach (MDL0BoneNode b in (_baseInf as MDL0BoneNode).Children) { MergeChildren(_parent, b, _mergeModels ? _externalModel : (ResourceNode)_node); } break; case 1: _parent.Parent.InsertChild((ResourceNode)_baseInf, true, _parent.Index); _parent.Remove(); break; case 2: _parent.AddChild((ResourceNode)_baseInf); break; } _internalModel.ApplyCHR(null, 0); if (_mergeModels) { _externalModel.ApplyCHR(null, 0); foreach (ResourceNode node in _externalModel?.FindChild("Objects", true)?.Children?.ToArray() ?? new ResourceNode[0]) { if (node is MDL0ObjectNode poly) { ImportObject(poly); } } } else { _node.Model.ApplyCHR(null, 0); ImportObject(_node); } _internalModel.SignalPropertyChange(); DialogResult = DialogResult.OK; Close(); }