public void UpdateJournal(Career job) { if (!mUpdatedToday) { if (job.SharedData == null) { return; } mUpdatedToday = true; OmniJournalData data = OmniJournalData.GetJournalData(job.SharedData.Name, job.CareerLevel); if (data != null) { data = data.Clone(); if (data != null) { mJournalEdition = data.CurrentEdition + SimClock.ElapsedCalendarDays(); base.Data = data; base.Data.ID = data.ID + mJournalEdition; base.BookId = base.Data.ID; mBookCareer = job.SharedData.Name; mBookLevelId = job.CareerLevel; } } } }
// Methods public static OmniJournal CreateOutOfWorld(OmniJournalData data, SimDescription Actor) { OmniJournal journal = ObjectCreation.CreateObject(0x6694B72C99D44369, ProductVersion.BaseGame, null) as OmniJournal; if (journal == null) { return(null); } journal.Data = data.Clone(); journal.mJournalEdition = data.CurrentEdition + SimClock.ElapsedCalendarDays(); journal.Data.ID = data.ID + journal.mJournalEdition; Career career = Actor.Occupation as Career; if (career != null) { journal.mBookCareer = career.SharedData.Name; } journal.mBookLevelId = Actor.Occupation.CareerLevel; journal.mBookId = journal.Data.ID; journal.mOwner = Actor; journal.mUpdatedToday = true; journal.SetGeometryState(journal.Data.GeometryState); journal.SetMaterial(journal.Data.MaterialState); return(journal); }
public override bool TestReadBook(Sim Actor, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { GreyedOutTooltipCallback callback = null; OmniJournalData data = base.Data as OmniJournalData; OmniCareer career = Actor.Occupation as OmniCareer; if (career == null) { return(true); } if ((career.CurLevel.HasMetricType(typeof(MetricJournals))) && ((data != null) && (career.CareerLevel >= data.CareerLevel))) { return(true); } if (callback == null) { callback = delegate { return(LocalizeString(Actor.SimDescription, "NonDoctorReadFailureTooltip", new object[] { Actor })); }; } greyedOutTooltipCallback = callback; return(false); }
public override void OnLoad() { try { OmniJournalData data = OmniJournalData.GetJournalData(mBookCareer, mBookLevelId); if (data != null) { base.Data = data.Clone(); base.Data.ID = base.Data.ID + this.mJournalEdition; } } catch (Exception e) { Common.Exception(mBookCareer + " - " + mBookLevelId, e); } }