public void ResetBuilding(BuildingInfo info) { var originalProperties = info.GetOriginalProperties(); if (CustomData.TryGetValue(info.name, out BuildingProperties customProps)) { CustomData.Remove(info.name); } info.LoadProperties(originalProperties); if (!CustomizeItExtendedMod.Settings.SavePerCity) { CustomizeItExtendedMod.Settings.Save(); } }
private void CacheOriginalData() { originalBuildingData.Clear(); for (uint index = 0; index < PrefabCollection <BuildingInfo> .LoadedCount(); index++) { BuildingInfo building = PrefabCollection <BuildingInfo> .GetLoaded(index); if (building == null || building.name == null) { continue; } if (!originalBuildingData.TryGetValue(building.name, out CustomizableProperties originalProperties)) { originalBuildingData.Add(building.name, building.GetOriginalProperties()); } } }