From 78b7edf0df23aad2670ebe1af7b4d1032989c474 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Wed, 5 Apr 2023 10:17:48 +0200 Subject: [PATCH] update Pilz.Dalamud --- .../ActivityContextManager.cs | 36 ++++++++++--------- Pilz.Dalamud/ActivityContexts/ZoneType.cs | 14 ++++---- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Pilz.Dalamud/ActivityContexts/ActivityContextManager.cs b/Pilz.Dalamud/ActivityContexts/ActivityContextManager.cs index bf218d6..5ba94f3 100644 --- a/Pilz.Dalamud/ActivityContexts/ActivityContextManager.cs +++ b/Pilz.Dalamud/ActivityContexts/ActivityContextManager.cs @@ -54,28 +54,32 @@ namespace Pilz.Dalamud.ActivityContexts } else { - // Check for ActivityContext if (content.PvP) + { newActivityContext = ActivityType.PvpDuty; + newZoneType = ZoneType.Pvp; + } else + { newActivityContext = ActivityType.PveDuty; - // Find correct member type - var memberType = content.ContentMemberType.Row; - if (content.RowId == 16 || content.RowId == 15) - memberType = 2; // Praetorium and Castrum Meridianum - else if (content.RowId == 735 || content.RowId == 778) - memberType = 127; // Bozja + // Find correct member type + var memberType = content.ContentMemberType.Row; + if (content.RowId == 16 || content.RowId == 15) + memberType = 2; // Praetorium and Castrum Meridianum + else if (content.RowId == 735 || content.RowId == 778) + memberType = 127; // Bozja - // Check for ZoneType - newZoneType = memberType switch - { - 2 => ZoneType.Dungeon, - 3 => ZoneType.Raid, - 4 => ZoneType.AllianceRaid, - 127 => ZoneType.Foray, - _ => ZoneType.Dungeon, - }; + // Check for ZoneType + newZoneType = memberType switch + { + 2 => ZoneType.Doungen, + 3 => ZoneType.Raid, + 4 => ZoneType.AllianceRaid, + 127 => ZoneType.Foray, + _ => ZoneType.Doungen, + }; + } } CurrentActivityContext = new(newActivityContext, newZoneType); diff --git a/Pilz.Dalamud/ActivityContexts/ZoneType.cs b/Pilz.Dalamud/ActivityContexts/ZoneType.cs index 6800511..aa40d28 100644 --- a/Pilz.Dalamud/ActivityContexts/ZoneType.cs +++ b/Pilz.Dalamud/ActivityContexts/ZoneType.cs @@ -8,13 +8,15 @@ using System.Threading.Tasks; namespace Pilz.Dalamud.ActivityContexts { - [JsonConverter(typeof(StringEnumConverter))] + [Flags, JsonConverter(typeof(StringEnumConverter))] public enum ZoneType { - Overworld, - Dungeon, - Raid, - AllianceRaid, - Foray + Overworld = 1, + Doungen = 2, + Raid = 4, + AllianceRaid = 8, + Foray = 16, + Pvp = 32, + Everywhere = int.MaxValue } }