static void Postfix() { int?savedLicenses = SaveGameManager.data.GetInt("Job_Licenses"); if (savedLicenses.HasValue) { JobLicenses val = (JobLicenses)savedLicenses.Value; if (val.HasFlag(PassLicenses.Passengers1)) { PassengerJobs.ModEntry.Logger.Log("Acquiring passengers license"); LicenseManager.AcquireJobLicense(PassLicenses.Passengers1); } } }
static void Postfix(JobLicenses requiredLicenses, Image[] ___requiredLicenseSlots) { if (requiredLicenses.HasFlag(PassLicenses.Passengers1)) { // get first non-active slot Image slot = ___requiredLicenseSlots.FirstOrDefault(img => !img.gameObject.activeSelf); if (slot == null) { PassengerJobs.ModEntry.Logger.Warning($"Can't fit Passengers 1 license on job overview"); return; } if (PassengerLicenseUtil.Pass1Sprite == null) { PassengerJobs.ModEntry.Logger.Warning($"Missing icon for {PassengerLicenseUtil.PASS1_LICENSE_NAME}"); return; } slot.sprite = PassengerLicenseUtil.Pass1Sprite; slot.gameObject.SetActive(true); } }