private static Result ThreeMapVMPatches(CodePatcherComponent comp) { var callsite = typeof(MapVM).GetConstructor(new Type[] { typeof(INavigationHandler), typeof(IMapStateHandler), typeof(MapBarShortcuts), typeof(Action) }); if (callsite == null) { return(Result.Failure); } var dependentRefreshMethods = new[] { typeof(MapInfoVM).GetMethod(nameof(MapInfoVM.Refresh)), typeof(MapTimeControlVM).GetMethod(nameof(MapTimeControlVM.Refresh)), typeof(MapNavigationVM).GetMethod(nameof(MapNavigationVM.Refresh)), }; if (dependentRefreshMethods.Any(e => e == null)) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); foreach (var method in dependentRefreshMethods) { comp.AddViewModelRefreshPatch(method); } return(Result.Success); }
private static Result CharacterVMPatch(CodePatcherComponent comp) { var callsite = typeof(CharacterDeveloperVM).GetConstructor(new Type[] { typeof(Action) }); if (callsite == null) { return(Result.Failure); } var refresh = typeof(CharacterVM).GetMethod(nameof(CharacterVM.RefreshValues)); if (refresh == null) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); comp.AddViewModelRefreshPatch(refresh); return(Result.Success); }
private static Result MapVMPatch(CodePatcherComponent comp) { var callsite = typeof(GauntlerMapBarGlobalLayer).GetMethod(nameof(GauntlerMapBarGlobalLayer.Initialize)); if (callsite == null) { return(Result.Failure); } var refresh = typeof(MapVM).GetMethod(nameof(MapVM.OnRefresh)); if (refresh == null) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); comp.AddViewModelRefreshPatch(refresh); return(Result.Success); }
private static Result MissionAgentStatusVMPatch(CodePatcherComponent comp) { var callsite = typeof(MissionGauntletAgentStatus).GetMethod(nameof(MissionGauntletAgentStatus.EarlyStart)); if (callsite == null) { return(Result.Failure); } var refresh = typeof(MissionAgentStatusVM).GetMethod(nameof(MissionAgentStatusVM.Tick)); if (refresh == null) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); comp.AddViewModelRefreshPatch(refresh); return(Result.Success); }
private static Result CustomBattleMenuSideVMPatch(CodePatcherComponent comp) { var callsite = typeof(CustomBattleMenuVM).GetConstructor(new[] { typeof(CustomBattleState) }); if (callsite == null) { return(Result.Failure); } var refresh = typeof(CustomBattleMenuSideVM).GetMethod(nameof(CustomBattleMenuSideVM.RefreshValues)); if (refresh == null) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); comp.AddViewModelRefreshPatch(refresh); return(Result.Success); }
private static Result CustomBattleVMPatch(CodePatcherComponent comp) { var callsite = typeof(CustomBattleScreen).GetMethod("OnInitialize", BindingFlags.NonPublic | BindingFlags.Instance); if (callsite == null) { return(Result.Failure); } var refresh = typeof(CustomBattleMenuVM).GetMethod(nameof(CustomBattleMenuVM.RefreshValues)); if (refresh == null) { return(Result.Failure); } comp.AddViewModelInstantiationPatch(callsite); comp.AddViewModelRefreshPatch(refresh); return(Result.Success); }