private void OnPasteFromClipboard() { var temp = XmlUtils.DefaultXmlDeserialize <LayoutDescriptorVehicleXml>(m_clipboard); if (!temp.IsValid()) { K45DialogControl.ShowModalError("The current clipboard layout failed to be copied! See data below.", m_clipboard); return; } temp.VehicleAssetName = CurrentVehicleInfo.name; EditingInstance = temp; }
private void OnCopyToCity() { var data = XmlUtils.DefaultXmlDeserialize <LayoutDescriptorVehicleXml>(XmlUtils.DefaultXmlSerialize(EditingInstance)); if (!data.IsValid()) { K45DialogControl.ShowModalError("The vehicle layout failed to be loaded; it wasn't copied!", null); return; } WTSVehicleData.Instance.CityDescriptors[CurrentVehicleInfo.name] = data; ReloadVehicle(); }
private void LoadIntoCurrentConfig(string loadedItem) { var data = XmlUtils.DefaultXmlDeserialize <LayoutDescriptorVehicleXml>(loadedItem); if (!data.IsValid()) { if (CommonProperties.DebugMode) { K45DialogControl.ShowModalError("The vehicle layout failed to be loaded! See data below.", loadedItem); } return; } WTSVehicleData.Instance.CityDescriptors[WTSVehicleLayoutEditor.Instance.CurrentVehicleInfo.name] = data; WTSVehicleLayoutEditor.Instance.ReloadVehicle(); }