private void CreateMessagePageMenuControls() { this.assignBuildingWorkersButton = this.CreateMenuButton("AssignBuildingWorkersButton", () => { HumanResource.AssignBuildingWorkersForTaiwuVillage(); this.ShowMessage(showLastPage: true); }, Path.Combine(Path.Combine(Main.resBasePath, "Texture"), $"ButtonIcon_Majordomo_AssignBuildingWorkers.png"), TaiwuCommon.SetColor(TaiwuCommon.COLOR_WHITE, "重新指派工作")); }
/// <summary> /// 只要在各个 panel 创建完之后再创建 menu item,事件中的 panel 引用就都是有效的。 /// </summary> private void CreateMenuItems() { this.logsPanelButton = this.CreateMenuButton("LogsPanelButton", () => this.SwitchPanel(this.panelLogs), Path.Combine(Path.Combine(Main.resBasePath, "Texture"), $"ButtonIcon_Majordomo_LogsPanel.png"), "翻阅记录"); this.chartsPanelButton = this.CreateMenuButton("ChartsPanelButton", () => this.SwitchPanel(this.panelCharts), Path.Combine(Path.Combine(Main.resBasePath, "Texture"), $"ButtonIcon_Majordomo_ChartsPanel.png"), "查看图表"); this.assignBuildingWorkersButton = this.CreateMenuButton("AssignBuildingWorkersButton", () => { YesOrNoWindow.instance.SetYesOrNoWindow(-1, "太吾管家", "管家已重新指派了各个建筑的负责人。", canClose: false); HumanResource.AssignBuildingWorkersForTaiwuVillage(); this.panelLogs.SetPageIndex(-1); if (this.panelLogs.gameObject.activeInHierarchy) { this.panelLogs.Update(); } }, Path.Combine(Path.Combine(Main.resBasePath, "Texture"), $"ButtonIcon_Majordomo_AssignBuildingWorkers.png"), "重新指派工作"); }
private static bool Prefix(UIDate __instance) { if (!Main.enabled) { return(true); } AutoHarvest.GetAllBooties(); ResourceMaintainer.TryBuyingResources(); ResourceMaintainer.UpdateResourceWarning(); TurnEvent.AddEvent(__instance); if (Main.settings.autoAssignBuildingWorkers) { HumanResource.AssignBuildingWorkersForTaiwuVillage(); } return(true); }