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(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>()); }); }
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); } }