From 5ba7cddb28e7d84f861fa07ceb94be25055dcbe1 Mon Sep 17 00:00:00 2001 From: goat Date: Fri, 24 Apr 2020 01:37:00 +0200 Subject: [PATCH] fix: wrongly named GatheringSystemMessages/ErrorMessages --- Dalamud/Game/Chat/XivChatType.cs | 29 ++++++++++++++++++-------- Dalamud/Game/Command/CommandManager.cs | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Dalamud/Game/Chat/XivChatType.cs b/Dalamud/Game/Chat/XivChatType.cs index 4a457cf3f..7e8eb5326 100644 --- a/Dalamud/Game/Chat/XivChatType.cs +++ b/Dalamud/Game/Chat/XivChatType.cs @@ -1,11 +1,13 @@ using System; using System.Linq; -namespace Dalamud.Game.Chat { +namespace Dalamud.Game.Chat +{ /// /// The FFXIV chat types as seen in the LogKind ex table. /// - public enum XivChatType : ushort { + public enum XivChatType : ushort + { None = 0, Debug = 1, @@ -81,7 +83,10 @@ namespace Dalamud.Game.Chat { [XivChatTypeInfo("Echo", "echo", 0xFF808080)] Echo = 56, SystemError = 58, - GatheringSystemMessage = 60, + + SystemMessage = 57, + GatheringSystemMessage = 59, + ErrorMessage = 60, // not sure if this is used for anything else RetainerSale = 71, @@ -107,14 +112,18 @@ namespace Dalamud.Game.Chat { CrossLinkShell8 = 107 } - public static class XivChatTypeExtensions { - public static XivChatTypeInfoAttribute GetDetails(this XivChatType p) { + public static class XivChatTypeExtensions + { + public static XivChatTypeInfoAttribute GetDetails(this XivChatType p) + { return p.GetAttribute(); } } - public class XivChatTypeInfoAttribute : Attribute { - internal XivChatTypeInfoAttribute(string fancyName, string slug, uint defaultColor) { + public class XivChatTypeInfoAttribute : Attribute + { + internal XivChatTypeInfoAttribute(string fancyName, string slug, uint defaultColor) + { FancyName = fancyName; Slug = slug; DefaultColor = defaultColor; @@ -125,9 +134,11 @@ namespace Dalamud.Game.Chat { public uint DefaultColor { get; } } - public static class EnumExtensions { + public static class EnumExtensions + { public static TAttribute GetAttribute(this Enum value) - where TAttribute : Attribute { + where TAttribute : Attribute + { var type = value.GetType(); var name = Enum.GetName(type, value); return type.GetField(name) // I prefer to get attributes this way diff --git a/Dalamud/Game/Command/CommandManager.cs b/Dalamud/Game/Command/CommandManager.cs index aad85dfec..4c5b85f1b 100644 --- a/Dalamud/Game/Command/CommandManager.cs +++ b/Dalamud/Game/Command/CommandManager.cs @@ -59,7 +59,7 @@ namespace Dalamud.Game.Command { private void OnChatMessage(XivChatType type, uint senderId, ref StdString sender, ref StdString message, ref bool isHandled) { - if (type == XivChatType.GatheringSystemMessage && senderId == 0) { + if (type == XivChatType.ErrorMessage && senderId == 0) { var cmdMatch = this.currentLangCommandRegex.Match(message.Value).Groups["command"]; if (cmdMatch.Success) { // Yes, it's a chat command.