예제 #1
0
        private static void MapPage_SaveMapConfig(On.DevInterface.MapPage.orig_SaveMapConfig orig, MapPage self)
        {
            string customFilePath = string.Empty;

            foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
            {
                customFilePath = CRExtras.BuildPath(keyValues.Value,
                                                    CRExtras.CustomFolder.RegionID, regionID: self.owner.game.world.name, file: "Properties.txt");

                if (File.Exists(customFilePath))
                {
                    CustomWorldMod.Log($"Saving custom Map Config to Properties.txt from [{keyValues.Value}]");
                    SaveCustomMapConfig(self, customFilePath);
                    return;
                }
            }

            CustomWorldMod.Log($"No Custom Properties.txt file found for [{self.owner.game.world.name}], using vanilla...");
            orig(self);
        }
예제 #2
0
        private static void MapPage_SaveMapConfig(On.DevInterface.MapPage.orig_SaveMapConfig orig, MapPage self)
        {
            string customFilePath = string.Empty;

            foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
            {
                customFilePath = Custom.RootFolderDirectory() +
                                 CustomWorldMod.resourcePath + keyValues.Value + Path.DirectorySeparatorChar +
                                 "World" + Path.DirectorySeparatorChar + "Regions" + Path.DirectorySeparatorChar + self.owner.game.world.name + Path.DirectorySeparatorChar + "Properties.txt";

                if (File.Exists(customFilePath))
                {
                    CustomWorldMod.Log($"Saving custom Map Config to Properties.txt from [{keyValues.Value}]");
                    SaveCustomMapConfig(self, customFilePath);
                    return;
                }
            }

            CustomWorldMod.Log($"No Custom Properties.txt file found for [{self.owner.game.world.name}], using vanilla...");
            orig(self);
        }