From cbbc264bafc3292033d7d463625d49f6df89007d Mon Sep 17 00:00:00 2001 From: Govorunb Date: Tue, 23 Apr 2024 06:28:04 +1000 Subject: [PATCH] better clarify what's required for PDA logs --- SCHIZO/Items/PDAJournal.cs | 8 +++++++- Unity/Assets/Scripts/SCHIZO/Items/PDAJournal.cs | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SCHIZO/Items/PDAJournal.cs b/SCHIZO/Items/PDAJournal.cs index f518150b..317ef912 100644 --- a/SCHIZO/Items/PDAJournal.cs +++ b/SCHIZO/Items/PDAJournal.cs @@ -10,8 +10,14 @@ partial class PDAJournal { protected override void Register() { + if (!encyData) + { + LOGGER.LogWarning($"{nameof(PDAJournal)} has no encyData, skipping registration"); + return; + } encyData.Register(key); - Subtitles.SubtitlesHandler.RegisterMetadata(subtitles, encyData.description.text); + if (subtitles) + Subtitles.SubtitlesHandler.RegisterMetadata(subtitles, encyData.description.text); PDAJournalPrefab.Register(this); } diff --git a/Unity/Assets/Scripts/SCHIZO/Items/PDAJournal.cs b/Unity/Assets/Scripts/SCHIZO/Items/PDAJournal.cs index 9cb42350..111fe116 100644 --- a/Unity/Assets/Scripts/SCHIZO/Items/PDAJournal.cs +++ b/Unity/Assets/Scripts/SCHIZO/Items/PDAJournal.cs @@ -12,12 +12,13 @@ namespace SCHIZO.Items [DeclareBoxGroup("Below Zero")] public sealed partial class PDAJournal : ModRegistryItem { - [Careful] + [Careful, Required] public string key; [LabelText("PDA Hover Text")] public string pdaHandTargetText; [LabelText("PDA Hover Subtext")] public string pdaHandTargetSubtext; + [Required] public PDAEncyclopediaInfo encyData; public Subtitles.SubtitlesData subtitles;