public static void DrawUnPatches(Rect right) { var rListing = new Listing_Standard(); rListing.Begin(right); DubGUI.CenterText(() => rListing.Label("UnProfilePatchMethod".Translate())); rListing.GapLine(6); DubGUI.OptionalBox(rListing.GetRect(Text.LineHeight + 3), "input.unpatchmethod".Translate(), () => unPatchType = UnPatchType.Method, unPatchType == UnPatchType.Method); DubGUI.OptionalBox(rListing.GetRect(Text.LineHeight + 3), "input.unpatchmethodsonmethod".Translate(), () => unPatchType = UnPatchType.MethodsOnMethod, unPatchType == UnPatchType.MethodsOnMethod); DubGUI.OptionalBox(rListing.GetRect(Text.LineHeight + 3), "input.unpatchtype".Translate(), () => unPatchType = UnPatchType.Type, unPatchType == UnPatchType.Type); DubGUI.OptionalBox(rListing.GetRect(Text.LineHeight + 3), "input.unpatchinternalmethod".Translate(), () => unPatchType = UnPatchType.InternalMethod, unPatchType == UnPatchType.InternalMethod); DubGUI.OptionalBox(rListing.GetRect(Text.LineHeight + 3), "input.unpatchall".Translate(), () => unPatchType = UnPatchType.All, unPatchType == UnPatchType.All); rListing.curY += 2; DisplayUnPatchInputField(rListing); rListing.curY += 2; if (Widgets.ButtonText(rListing.GetRect(Text.LineHeight + 3), "unpatch".Translate())) { if (currentInput != null || unPatchType == UnPatchType.All) { ExecuteUnPatch(); } } rListing.End(); }
public static void DrawPatches(Rect left) { var lListing = new Listing_Standard(); lListing.Begin(left); DubGUI.CenterText(() => lListing.Label("ProfilePatchMethod".Translate())); lListing.GapLine(6); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.method".Translate(), () => input = CurrentInput.Method, input == CurrentInput.Method); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.type".Translate(), () => input = CurrentInput.Type, input == CurrentInput.Type); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.methodharmony".Translate(), () => input = CurrentInput.MethodHarmony, input == CurrentInput.MethodHarmony); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.typeharmony".Translate(), () => input = CurrentInput.TypeHarmony, input == CurrentInput.TypeHarmony); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.methodinternal".Translate(), () => input = CurrentInput.InternalMethod, input == CurrentInput.InternalMethod); DubGUI.OptionalBox(lListing.GetRect(Text.LineHeight + 3), "input.assembly".Translate(), () => input = CurrentInput.Assembly, input == CurrentInput.Assembly); lListing.curY += 2; DisplayInputField(lListing); lListing.curY += 2; var box = lListing.GetRect(Text.LineHeight + 3); DubGUI.OptionalBox(box.LeftPart(.3f), "patch.type.tick".Translate(), () => patchType = UpdateMode.Tick, patchType == UpdateMode.Tick); box = box.RightPart(.65f); DubGUI.OptionalBox(box.LeftPart(.4f), "patch.type.update".Translate(), () => patchType = UpdateMode.Update, patchType == UpdateMode.Update); if (Widgets.ButtonText(box.RightPart(.5f), "patch".Translate())) { if (currentInput != null) { ExecutePatch(); } } lListing.End(); }