mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
fix: wrongly named GatheringSystemMessages/ErrorMessages
This commit is contained in:
parent
91d4f90de6
commit
5ba7cddb28
2 changed files with 21 additions and 10 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat {
|
namespace Dalamud.Game.Chat
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The FFXIV chat types as seen in the LogKind ex table.
|
/// The FFXIV chat types as seen in the LogKind ex table.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum XivChatType : ushort {
|
public enum XivChatType : ushort
|
||||||
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
Debug = 1,
|
Debug = 1,
|
||||||
|
|
||||||
|
|
@ -81,7 +83,10 @@ namespace Dalamud.Game.Chat {
|
||||||
[XivChatTypeInfo("Echo", "echo", 0xFF808080)]
|
[XivChatTypeInfo("Echo", "echo", 0xFF808080)]
|
||||||
Echo = 56,
|
Echo = 56,
|
||||||
SystemError = 58,
|
SystemError = 58,
|
||||||
GatheringSystemMessage = 60,
|
|
||||||
|
SystemMessage = 57,
|
||||||
|
GatheringSystemMessage = 59,
|
||||||
|
ErrorMessage = 60,
|
||||||
// not sure if this is used for anything else
|
// not sure if this is used for anything else
|
||||||
RetainerSale = 71,
|
RetainerSale = 71,
|
||||||
|
|
||||||
|
|
@ -107,14 +112,18 @@ namespace Dalamud.Game.Chat {
|
||||||
CrossLinkShell8 = 107
|
CrossLinkShell8 = 107
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class XivChatTypeExtensions {
|
public static class XivChatTypeExtensions
|
||||||
public static XivChatTypeInfoAttribute GetDetails(this XivChatType p) {
|
{
|
||||||
|
public static XivChatTypeInfoAttribute GetDetails(this XivChatType p)
|
||||||
|
{
|
||||||
return p.GetAttribute<XivChatTypeInfoAttribute>();
|
return p.GetAttribute<XivChatTypeInfoAttribute>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class XivChatTypeInfoAttribute : Attribute {
|
public class XivChatTypeInfoAttribute : Attribute
|
||||||
internal XivChatTypeInfoAttribute(string fancyName, string slug, uint defaultColor) {
|
{
|
||||||
|
internal XivChatTypeInfoAttribute(string fancyName, string slug, uint defaultColor)
|
||||||
|
{
|
||||||
FancyName = fancyName;
|
FancyName = fancyName;
|
||||||
Slug = slug;
|
Slug = slug;
|
||||||
DefaultColor = defaultColor;
|
DefaultColor = defaultColor;
|
||||||
|
|
@ -125,9 +134,11 @@ namespace Dalamud.Game.Chat {
|
||||||
public uint DefaultColor { get; }
|
public uint DefaultColor { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class EnumExtensions {
|
public static class EnumExtensions
|
||||||
|
{
|
||||||
public static TAttribute GetAttribute<TAttribute>(this Enum value)
|
public static TAttribute GetAttribute<TAttribute>(this Enum value)
|
||||||
where TAttribute : Attribute {
|
where TAttribute : Attribute
|
||||||
|
{
|
||||||
var type = value.GetType();
|
var type = value.GetType();
|
||||||
var name = Enum.GetName(type, value);
|
var name = Enum.GetName(type, value);
|
||||||
return type.GetField(name) // I prefer to get attributes this way
|
return type.GetField(name) // I prefer to get attributes this way
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Dalamud.Game.Command {
|
||||||
|
|
||||||
private void OnChatMessage(XivChatType type, uint senderId, ref StdString sender,
|
private void OnChatMessage(XivChatType type, uint senderId, ref StdString sender,
|
||||||
ref StdString message, ref bool isHandled) {
|
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"];
|
var cmdMatch = this.currentLangCommandRegex.Match(message.Value).Groups["command"];
|
||||||
if (cmdMatch.Success) {
|
if (cmdMatch.Success) {
|
||||||
// Yes, it's a chat command.
|
// Yes, it's a chat command.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue