private static void Init() { DevTeams.Clear(); DevTeams.AddRange <string>((IEnumerable <string>)GameSettings.Instance.GetDefaultTeams("Design")); Window = WindowManager.SpawnWindow(); Window.InitialTitle = Window.TitleText.text = Window.NonLocTitle = title; Window.MinSize.x = 670; Window.MinSize.y = 400; Window.name = "SIncLibOptions"; Window.MainPanel.name = "SIncLibOptionsPanel"; if (Window.name == "SIncLibOptions") { Window.GetComponentsInChildren <Button>() .SingleOrDefault(x => x.name == "CloseButton") .onClick.AddListener(() => shown = false); } Utils.AddLabel("Team Manager:", new Rect(10, 10, 250, 32)); Utils.AddLabel("Team:", new Rect(10, 52, 250, 32)); var teamButton = Utils.AddButton("SELECT TEAM", new Rect(100, 42, 250, 32), ShowTeamWindow); TeamText = teamButton.GetComponentInChildren <Text>(); Utils.AddLabel("Source From:", new Rect(400, 12, 250, 32)); var sourceButton = Utils.AddButton("SOURCE", new Rect(400, 42, 250, 32), ShowMultiTeamWindow); SourceText = sourceButton.GetComponentInChildren <Text>(); UpdateTeamText(); Utils.AddLabel("Adjust only:", new Rect(10, 80, 250, 32)); Utils.AddToggle("Code", new Rect(10, 110, 250, 32), (SIncLibBehaviour.Instance.AdjustDepartment & SIncLibBehaviour.AdjustHRFlags.Code) != 0, (state) => { if (state) { SIncLibBehaviour.Instance.AdjustDepartment |= SIncLibBehaviour.AdjustHRFlags.Code; } else { SIncLibBehaviour.Instance.AdjustDepartment &= ~SIncLibBehaviour.AdjustHRFlags.Code; } }); Utils.AddToggle("Art", new Rect(100, 110, 250, 32), (SIncLibBehaviour.Instance.AdjustDepartment & SIncLibBehaviour.AdjustHRFlags.Art) != 0, (state) => { if (state) { SIncLibBehaviour.Instance.AdjustDepartment |= SIncLibBehaviour.AdjustHRFlags.Art; } else { SIncLibBehaviour.Instance.AdjustDepartment &= ~SIncLibBehaviour.AdjustHRFlags.Art; } }); Utils.AddToggle("Design", new Rect(200, 110, 250, 32), (SIncLibBehaviour.Instance.AdjustDepartment & SIncLibBehaviour.AdjustHRFlags.Design) != 0, (state) => { if (state) { SIncLibBehaviour.Instance.AdjustDepartment |= SIncLibBehaviour.AdjustHRFlags.Design; } else { SIncLibBehaviour.Instance.AdjustDepartment &= ~SIncLibBehaviour.AdjustHRFlags.Design; } }); Utils.AddToggle("Transfer Idle Only", new Rect(10, 140, 250, 32), SIncLibBehaviour.Instance.IdleOnly, (state) => { SIncLibBehaviour.Instance.IdleOnly = state; }); Utils.AddToggle("Adjust HR rules", new Rect(200, 140, 250, 32), SIncLibBehaviour.Instance.AdjustHR, (state) => { SIncLibBehaviour.Instance.AdjustHR = state; }); Utils.AddButton("Optimise Team", new Rect(210, 180, 250, 32), () => OptimiseTeam()); //Utils.AddButton("Show Auto Dev", new Rect(210, 220, 250, 32), () => ShowAutoDev()); Utils.AddToggle("Get out of stock notifications for acquired software", new Rect(10, 260, 600, 32), SIncLibBehaviour.Instance.StockNotifications, (state) => { SIncLibBehaviour.Instance.StockNotifications = state; }); Utils.AddButton("Market Research", new Rect(10, 300, 250, 32), () => SIncLibMarketResearchUI.ShowWindow()); }
private void Awake() { Instance = this; }