diff --git a/Libraries/Core/Models/Eft/Common/Globals.cs b/Libraries/Core/Models/Eft/Common/Globals.cs index 852ab8f6..4c2b0367 100644 --- a/Libraries/Core/Models/Eft/Common/Globals.cs +++ b/Libraries/Core/Models/Eft/Common/Globals.cs @@ -1,5 +1,6 @@ using Core.Models.Eft.Common.Tables; using Core.Models.Eft.Hideout; +using Core.Models.Enums; namespace Core.Models.Eft.Common; @@ -538,7 +539,7 @@ public record Config public BTRSettings? BTRSettings { get; set; } [JsonPropertyName("EventType")] - public List EventType { get; set; } + public List EventType { get; set; } [JsonPropertyName("WalkSpeed")] public XYZ? WalkSpeed { get; set; } diff --git a/Libraries/Core/Models/Enums/EventType.cs b/Libraries/Core/Models/Enums/EventType.cs new file mode 100644 index 00000000..eeec61bd --- /dev/null +++ b/Libraries/Core/Models/Enums/EventType.cs @@ -0,0 +1,10 @@ +namespace Core.Models.Enums +{ + public enum EventType + { + None, + Halloween, + Christmas, + HalloweenIllumination + } +} diff --git a/Libraries/Core/Services/SeasonalEventService.cs b/Libraries/Core/Services/SeasonalEventService.cs index 504da4de..00842f60 100644 --- a/Libraries/Core/Services/SeasonalEventService.cs +++ b/Libraries/Core/Services/SeasonalEventService.cs @@ -471,9 +471,9 @@ public class SeasonalEventService( { _halloweenEventActive = true; - globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList(); - globalConfig.EventType.Add("Halloween"); - globalConfig.EventType.Add("HalloweenIllumination"); + globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList(); + globalConfig.EventType.Add(EventType.Halloween); + globalConfig.EventType.Add(EventType.HalloweenIllumination); globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween"; AddEventGearToBots(eventType.Type); AdjustZryachiyMeleeChance(); @@ -513,8 +513,8 @@ public class SeasonalEventService( if (eventType.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList(); - globalConfig.EventType.Add("Christmas"); + globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList(); + globalConfig.EventType.Add(EventType.Christmas); } AddEventGearToBots(eventType.Type); @@ -539,8 +539,8 @@ public class SeasonalEventService( if (eventType.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList(); - globalConfig.EventType.Add("Christmas"); + globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList(); + globalConfig.EventType.Add(EventType.Christmas); } AddEventGearToBots(SeasonalEventType.Christmas); @@ -1032,14 +1032,14 @@ public class SeasonalEventService( protected void HandleModEvent(SeasonalEvent seasonalEvent, Config globalConfig) { if (seasonalEvent.Settings?.EnableChristmasHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList(); - globalConfig.EventType.Add("Christmas"); + globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList(); + globalConfig.EventType.Add(EventType.Christmas); } if (seasonalEvent.Settings?.EnableHalloweenHideout ?? false) { - globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList(); - globalConfig.EventType.Add("Halloween"); - globalConfig.EventType.Add("HalloweenIllumination"); + globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList(); + globalConfig.EventType.Add(EventType.Halloween); + globalConfig.EventType.Add(EventType.HalloweenIllumination); } if (seasonalEvent.Settings?.AddEventGearToBots ?? false) { diff --git a/Libraries/Core/Utils/JsonUtil.cs b/Libraries/Core/Utils/JsonUtil.cs index 9d81ed63..8cb96f67 100644 --- a/Libraries/Core/Utils/JsonUtil.cs +++ b/Libraries/Core/Utils/JsonUtil.cs @@ -42,6 +42,7 @@ public class JsonUtil new EftEnumConverter(), new EftEnumConverter(), new EftEnumConverter(), + new EftEnumConverter(), new BaseInteractionRequestDataConverter() } };