private static void Postfix(BuildingWindow __instance) { if (!Main.enabled || Main.binding_key) { return; } Refers component = BuildingWindow.instance.GetComponent <Refers>(); // 新建 人力调整 Utils.ButtonHK(component.CGet <Button>("NewBuildingManpowerDownButton"), HK_TYPE.DECREASE); Utils.ButtonHK(component.CGet <Button>("NewBuildingManpowerUpButton"), HK_TYPE.INCREASE); // 新建 确定 Utils.ButtonConfirm(component.CGet <Button>("NewBuildingButton")); // 升级 人力调整 Utils.ButtonHK(component.CGet <Button>("UpBuildingManpowerDownButton"), HK_TYPE.DECREASE); Utils.ButtonHK(component.CGet <Button>("UpBuildingManpowerUpButton"), HK_TYPE.INCREASE); // 升级 确定 Utils.ButtonConfirm(component.CGet <Button>("UpBuildingButton")); // 移除 人力调整 Utils.ButtonHK(component.CGet <Button>("RemoveBuildingManpowerDownButton"), HK_TYPE.DECREASE); Utils.ButtonHK(component.CGet <Button>("RemoveBuildingManpowerUpButton"), HK_TYPE.INCREASE); // 移除 确定 Utils.ButtonConfirm(component.CGet <Button>("RemoveBuildingButton")); }
private static void Postfix(MakeSystem __instance) { if (!Main.on) { return; } Refers component = __instance.GetComponent <Refers>(); Utils.ButtonConfirm(component.CGet <Button>("StartMakeButton"), (_) => !Checks.HasDialog() && !__instance.makeingImage.activeInHierarchy); Utils.ButtonConfirm(component.CGet <Button>("StartFixButton")); Utils.ButtonConfirm(component.CGet <Button>("GetItemButton")); }
private static void Postfix(MakeSystem __instance) { if (!Main.on) { return; } Refers component = __instance.GetComponent <Refers>(); Utils.ButtonConfirm(component.CGet <Button>("StartMakeButton")); Utils.ButtonConfirm(component.CGet <Button>("StartFixButton")); Utils.ButtonConfirm(component.CGet <Button>("GetItemButton")); }
private static void Postfix(BookShopSystem __instance) { if (!Main.on) { return; } Refers component = __instance.GetComponent <Refers>(); Utils.ButtonConfirm(component.CGet <Button>("ShopOkButton")); }
private static void Postfix(MainMenu __instance) { if (!Main.on) { return; } Transform welcome = __instance.transform.Find("WelcomeDialog"); Refers refer = welcome.GetComponent <Refers>(); Utils.ButtonConfirm(refer.CGet <CButton>("ConfirmBtn")); }
private static void Postfix(StartBattle __instance) { if (!Main.on) { return; } Refers component = __instance.GetComponent <Refers>(); if (component != null) { var startButton = component.CGet <Button>("StartButton"); Utils.ButtonConfirm(startButton); } }
private static void Postfix(BuildingWindow __instance) { if (!Main.on) { return; } Refers component = __instance.GetComponent <Refers>(); var studyChooseTyp = Traverse.Create(BuildingWindow.instance).Field("studyChooseTyp"); // 修习 Utils.ButtonConfirm(component.CGet <Button>("AddStudySkillButton"), (b) => { return(0 == studyChooseTyp.GetValue <int>() && !__instance.setStudyWindow.gameObject.activeInHierarchy && Traverse.Create(__instance).Field <int>("studySkillId").Value == 0); }); Utils.ButtonConfirm(component.CGet <Button>("StudySkillUpButton"), (b) => { return(0 == studyChooseTyp.GetValue <int>() && !__instance.setStudyWindow.gameObject.activeInHierarchy); }); Utils.ButtonHK(__instance.removeGongFaButton, HK_TYPE.REMOVE_ITEM, (b) => { return(0 == studyChooseTyp.GetValue <int>()); }); // 突破 Utils.ButtonConfirm(component.CGet <Button>("AddSkillLevelUpButton"), (b) => { return(1 == studyChooseTyp.GetValue <int>() && !__instance.setStudyWindow.gameObject.activeInHierarchy && __instance.levelUPSkillId == 0); }); Utils.ButtonConfirm(component.CGet <Button>("StartSkillLevelUpButton"), (b) => { return(1 == studyChooseTyp.GetValue <int>() && !__instance.setStudyWindow.gameObject.activeInHierarchy && !StudyWindow.instance.gameObject.activeInHierarchy); }); Utils.ButtonHK(__instance.removeLevelUPButton, HK_TYPE.REMOVE_ITEM, (b) => { return(1 == studyChooseTyp.GetValue <int>()); }); // 研读 Utils.ButtonConfirm(component.CGet <Button>("AddReadBookButton"), (b) => { return(2 == studyChooseTyp.GetValue <int>() && !__instance.bookWindow.activeInHierarchy && __instance.readBookId == 0); }); Utils.ButtonConfirm(component.CGet <Button>("StartReadBookButton"), (b) => { return(2 == studyChooseTyp.GetValue <int>() && !__instance.bookWindow.activeInHierarchy && !ReadBook.instance.gameObject.activeInHierarchy); }); Utils.ButtonHK(__instance.removeReadBookButton, HK_TYPE.REMOVE_ITEM, (b) => { return(2 == studyChooseTyp.GetValue <int>()); }); }