示例#1
0
        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();
            }
        }
示例#2
0
        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());
                }
            }
        }