diff --git a/NewHorizons/Builder/Props/DialogueBuilder.cs b/NewHorizons/Builder/Props/DialogueBuilder.cs index b20a57d5..9e617ea1 100644 --- a/NewHorizons/Builder/Props/DialogueBuilder.cs +++ b/NewHorizons/Builder/Props/DialogueBuilder.cs @@ -96,6 +96,23 @@ namespace NewHorizons.Builder.Props dialogueTree.SetTextXml(text); AddTranslation(xml); + switch (info.flashlightToggle) + { + case PropModule.DialogueInfo.FlashlightToggle.TurnOff: + dialogueTree._turnOffFlashlight = true; + dialogueTree._turnOnFlashlight = false; + break; + case PropModule.DialogueInfo.FlashlightToggle.TurnOffThenOn: + dialogueTree._turnOffFlashlight = true; + dialogueTree._turnOnFlashlight = true; + break; + case PropModule.DialogueInfo.FlashlightToggle.None: + default: + dialogueTree._turnOffFlashlight = false; + dialogueTree._turnOnFlashlight = false; + break; + } + conversationZone.transform.parent = sector?.transform ?? planetGO.transform; if (!string.IsNullOrEmpty(info.pathToAnimController)) diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 807aa9d6..0113a05a 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -445,6 +445,18 @@ namespace NewHorizons.External.Modules /// Relative path to the xml file defining the dialogue. /// public string xmlFile; + + /// + /// + [DefaultValue("none")] public FlashlightToggle flashlightToggle = FlashlightToggle.None; + + [JsonConverter(typeof(StringEnumConverter))] + public enum FlashlightToggle + { + [EnumMember(Value = @"none")] None = -1, + [EnumMember(Value = @"turnOff")] TurnOff = 0, + [EnumMember(Value = @"turnOffThenOn")] TurnOffThenOn = 1, + } } [JsonObject]