diff --git a/Nautilus/Assets/Gadgets/ScanningGadget.cs b/Nautilus/Assets/Gadgets/ScanningGadget.cs index 285eff75a..9f3f998c8 100644 --- a/Nautilus/Assets/Gadgets/ScanningGadget.cs +++ b/Nautilus/Assets/Gadgets/ScanningGadget.cs @@ -13,8 +13,6 @@ namespace Nautilus.Assets.Gadgets; /// public class ScanningGadget : Gadget { - private const string DefaultUnlockMessage = "NotficationBlueprintUnlocked"; - private bool _isBuildable; /// @@ -177,7 +175,7 @@ public ScanningGadget WithAnalysisTech( List storyGoalsToTrigger = null, #endif FMODAsset unlockSound = null, - string unlockMessage = "NotificationBlueprintUnlocked" + string unlockMessage = null ) { AnalysisTech ??= new KnownTech.AnalysisTech(); @@ -192,9 +190,7 @@ public ScanningGadget WithAnalysisTech( AnalysisTech.storyGoals = storyGoalsToTrigger ?? new(); #endif AnalysisTech.unlockSound = unlockSound; - AnalysisTech.unlockMessage = unlockMessage == DefaultUnlockMessage - ? unlockMessage - : $"{prefab.Info.TechType.AsString()}_DiscoverMessage"; + AnalysisTech.unlockMessage = unlockMessage ?? KnownTechHandler.DefaultUnlockData.BlueprintUnlockMessage; return this; } @@ -246,11 +242,11 @@ protected internal override void Build() PDAHandler.AddCustomScannerEntry(ScannerEntryData); } - if (CompoundTechsForUnlock is { Count: > 0 } || RequiredForUnlock is not TechType.None) + if (CompoundTechsForUnlock is { Count: > 0 } || RequiredForUnlock != TechType.None) { if (AnalysisTech is null) { - KnownTechHandler.SetAnalysisTechEntry(RequiredForUnlock, new[] { prefab.Info.TechType }, DefaultUnlockMessage); + KnownTechHandler.SetAnalysisTechEntry(RequiredForUnlock, new[] { prefab.Info.TechType }, KnownTechHandler.DefaultUnlockData.BlueprintUnlockMessage, KnownTechHandler.DefaultUnlockData.BlueprintUnlockSound); } KnownTechPatcher.UnlockedAtStart.Remove(prefab.Info.TechType); diff --git a/Nautilus/Handlers/KnownTechHandler.cs b/Nautilus/Handlers/KnownTechHandler.cs index 9236a3f01..9371e5f95 100644 --- a/Nautilus/Handlers/KnownTechHandler.cs +++ b/Nautilus/Handlers/KnownTechHandler.cs @@ -315,16 +315,16 @@ public static void RemoveAllCurrentAnalysisTechEntry(TechType targetTechType) public static class DefaultUnlockData { /// Message on unlocking new creatures; "NEW LIFEFORM DISCOVERED" - public static string NewCreatureDiscoveredMessage { get; } = "NotificationCreatureDiscovered"; + public const string NewCreatureDiscoveredMessage = "NotificationCreatureDiscovered"; /// Sound on unlocking new creatures; "NEW LIFEFORM DISCOVERED" public static FMODAsset NewCreatureDiscoveredSound { get; } = AudioUtils.GetFmodAsset("event:/player/new_creature"); /// Message on unlocking new blueprints from picking up items; "NEW BLUEPRINT SYNTHESIZED FROM ALIEN RESOURCE" - public static string BlueprintPickupMessage { get; } = "NotificationBlueprintPickup"; + public const string BlueprintPickupMessage = "NotificationBlueprintPickup"; /// Message on unlocking new blueprints from scanning; "NEW BLUEPRINT SYNTHESIZED" - public static string BlueprintUnlockMessage { get; } = "NotificationBlueprintUnlocked"; + public const string BlueprintUnlockMessage = "NotificationBlueprintUnlocked"; /// Sound on unlocking new blueprints from scanning or picking up items; "NEW BLUEPRINT SYNTHESIZED" public static FMODAsset BlueprintUnlockSound { get; } = AudioUtils.GetFmodAsset("event:/tools/scanner/new_blueprint"); diff --git a/Nautilus/Patchers/KnownTechPatcher.cs b/Nautilus/Patchers/KnownTechPatcher.cs index 1bd1cf610..54aef4302 100644 --- a/Nautilus/Patchers/KnownTechPatcher.cs +++ b/Nautilus/Patchers/KnownTechPatcher.cs @@ -61,7 +61,7 @@ internal static void InitializePostfix() foreach (KnownTech.AnalysisTech tech in analysisTech) { - if (UnlockSound == null && tech.unlockSound != null && tech.techType == TechType.Lead) + if (UnlockSound == null && tech.unlockSound != null && tech.techType == TechType.CreepvinePiece) { UnlockSound = tech.unlockSound; }