public static PatchConfig Default(Mod mtn) { PatchConfig newConfig = new PatchConfig(); newConfig.EventPatch = new Dictionary <string, bool> { { "SetExitLocation", true } }; newConfig.FarmPatch = new Dictionary <string, bool> { { "CheckAction", true }, { "Constructor", true }, { "Draw", true }, { "GetFrontDoorPositionForFarmer", true }, { "LeftClick", true }, { "ResetLocalState", true }, { "UpdateWhenCurrentLocation", true }, }; newConfig.FarmHousePatch = new Dictionary <string, bool> { { "Constructor", true }, { "GetPorchStandingSpot", false }, { "UpdateMap", true } }; newConfig.Game1Patch = new Dictionary <string, bool> { { "LoadForNewGame", true } }; newConfig.GameLocationPatch = new Dictionary <string, bool> { { "LoadObjects", true }, { "PerformAction", true }, { "StartEvent", true } }; newConfig.NPCPatch = new Dictionary <string, bool> { { "UpdateConstructionAnimation", true } }; newConfig.ObjectPatch = new Dictionary <string, bool> { { "TotemWarpForReal", true } }; newConfig.PetPatch = new Dictionary <string, bool> { { "DayUpdate", true }, { "SetAtFarmPosition", true } }; newConfig.SaveGamePatch = new Dictionary <string, bool> { { "LoadDataForLocations", false } }; newConfig.TitleMenuPatch = new Dictionary <string, bool> { { "SetUpIcons", true } }; newConfig.WandPatch = new Dictionary <string, bool> { { "WandWarpForReal", true } }; newConfig.WorldChangeEventPatch = new Dictionary <string, bool> { { "SetUp", true } }; newConfig.Version = mtn.ModManifest.Version.ToString(); return(newConfig); }
public void Initialize(IModHelper helper, IMonitor monitor) { this.helper = helper; patchConfig = helper.Data.ReadJsonFile <PatchConfig>("darkmagic.json"); if (patchConfig == null || patchConfig.Version != FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion) { patchConfig = PatchConfig.Default; helper.Data.WriteJsonFile("darkmagic.json", patchConfig); } ImpInitialize(patchConfig.EventPatch["SetExitLocation"], "Event", "setExitLocation", new setExitLocationPatch(customManager), typeof(setExitLocationPatch)); ImpInitialize(patchConfig.FarmPatch["CheckAction"], "Farm", "checkAction", new checkActionPatch(customManager), typeof(checkActionPatch)); ImpInitialize(patchConfig.FarmPatch["Constructor"], "Farm", "", new ConstructorFarmPatch(customManager), typeof(ConstructorFarmPatch), new Type[] { typeof(string), typeof(string) }); ImpInitialize(patchConfig.FarmPatch["Draw"], "Farm", "draw", new drawPatch(customManager), typeof(drawPatch)); ImpInitialize(patchConfig.FarmPatch["GetFrontDoorPositionForFarmer"], "Farm", "getFrontDoorPositionForFarmer", new getFrontDoorPositionForFarmerPatch(customManager), typeof(getFrontDoorPositionForFarmerPatch)); ImpInitialize(patchConfig.FarmPatch["LeftClick"], "Farm", "leftClick", new leftClickPatch(customManager), typeof(leftClickPatch)); ImpInitialize(patchConfig.FarmPatch["ResetLocalState"], "Farm", "resetLocalState", new resetLocalStatePatch(customManager), typeof(resetLocalStatePatch)); ImpInitialize(patchConfig.FarmPatch["UpdateWhenCurrentLocation"], "Farm", "UpdateWhenCurrentLocation", new UpdateWhenCurrentLocationPatch(customManager), typeof(UpdateWhenCurrentLocationPatch)); ImpInitialize(patchConfig.FarmHousePatch["Constructor"], "Locations.FarmHouse", "", new ConstructorFarmHousePatch(customManager), typeof(ConstructorFarmHousePatch), new Type[] { typeof(string), typeof(string) }); ImpInitialize(patchConfig.FarmHousePatch["GetPorchStandingSpot"], "Locations.FarmHouse", "GetPorchStandingSpot", new getPorchStandingSpotPatch(customManager), typeof(getPorchStandingSpotPatch)); ImpInitialize(patchConfig.FarmHousePatch["UpdateMap"], "Locations.FarmHouse", "updateMap", new updateMapPatch(customManager), typeof(updateMapPatch)); ImpInitialize(patchConfig.Game1Patch["LoadForNewGame"], "Game1", "loadForNewGame", new loadForNewGamePatch(customManager, monitor), typeof(loadForNewGamePatch)); ImpInitialize(patchConfig.GameLocationPatch["LoadObjects"], "GameLocation", "loadObjects", new loadObjectsPatch(customManager), typeof(loadObjectsPatch)); ImpInitialize(patchConfig.GameLocationPatch["PerformAction"], "GameLocation", "performAction", new performActionPatch(customManager), typeof(performActionPatch)); ImpInitialize(patchConfig.GameLocationPatch["StartEvent"], "GameLocation", "startEvent", new startEventPatch(customManager), typeof(startEventPatch)); ImpInitialize(patchConfig.NPCPatch["UpdateConstructionAnimation"], "NPC", "updateConstructionAnimation", new updateConstructionAnimationPatch(customManager), typeof(updateConstructionAnimationPatch)); ImpInitialize(patchConfig.ObjectPatch["TotemWarpForReal"], "Object", "totemWarpForReal", new totemWarpForRealPatch(customManager), typeof(totemWarpForRealPatch)); ImpInitialize(patchConfig.PetPatch["DayUpdate"], "Characters.Pet", "dayUpdate", new dayUpdatePatch(customManager), typeof(dayUpdatePatch)); ImpInitialize(patchConfig.PetPatch["SetAtFarmPosition"], "Characters.Pet", "setAtFarmPosition", new setAtFarmPositionPatch(customManager), typeof(setAtFarmPositionPatch)); ImpInitialize(patchConfig.SaveGamePatch["LoadDataForLocations"], "SaveGame", "loadDataToLocations", new loadDataToLocationsPatch(), typeof(loadDataToLocationsPatch)); ImpInitialize(patchConfig.TitleMenuPatch["SetUpIcons"], "Menus.TitleMenu", "setUpIcons", new setUpIconsPatch(), typeof(setUpIconsPatch)); ImpInitialize(patchConfig.WandPatch["WandWarpForReal"], "Tools.Wand", "wandWarpForReal", new wandWarpForRealPatch(customManager), typeof(wandWarpForRealPatch)); ImpInitialize(patchConfig.WorldChangeEventPatch["SetUp"], "Events.WorldChangeEvent", "setUp", new setUpPatch(customManager), typeof(setUpPatch)); //ImpInitialize(helper, "Network.NetBuildingRef", "get_Value", new ValueGetterPatch(), typeof(ValueGetterPatch)); }