Core/Chat: Update ChatNotify enum

This commit is contained in:
Shauren
2024-10-20 12:44:15 +02:00
parent b860733822
commit c6fd88bf30
4 changed files with 22 additions and 11 deletions

View File

@@ -76,8 +76,9 @@ enum ChatNotify : uint8
CHAT_NOT_IN_LFG_NOTICE = 0x21, //+ "[%s] You must be queued in looking for group before joining this channel."; -- The user must be in the looking for group system to join LFG chat channels.
CHAT_VOICE_ON_NOTICE = 0x22, //+ "[%s] Channel voice enabled by %s.";
CHAT_VOICE_OFF_NOTICE = 0x23, //+ "[%s] Channel voice disabled by %s.";
CHAT_TRIAL_RESTRICTED = 0x24, //+ "[%s] Free Trial accounts cannot send messages to this channel. |cffffd000|Hstorecategory:gametime|h[Click To Upgrade]|h|r"
CHAT_NOT_ALLOWED_IN_CHANNEL = 0x25 //+ "That operation is not permitted in this channel."
CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE = 0x24, // same as CHAT_VOICE_ON_NOTICE but no chat mode change announcement
CHAT_TRIAL_RESTRICTED = 0x25, //+ "[%s] Free Trial accounts cannot send messages to this channel. |cffffd000|Hstorecategory:gametime|h[Click To Upgrade]|h|r"
CHAT_NOT_ALLOWED_IN_CHANNEL = 0x26 //+ "That operation is not permitted in this channel."
};
enum ChannelFlags

View File

@@ -445,15 +445,16 @@ struct NotInLFGAppend
struct VoiceOnAppend
{
explicit VoiceOnAppend(ObjectGuid const& guid) : _guid(guid) { }
static uint8 const NotificationType = CHAT_VOICE_ON_NOTICE;
explicit VoiceOnAppend(ObjectGuid const& guid, bool announce = true)
: NotificationType(announce ? CHAT_VOICE_ON_NOTICE : CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE), _guid(guid) { }
void Append(WorldPackets::Channel::ChannelNotify& data) const
{
data.SenderGuid = _guid;
}
uint8 const NotificationType;
private:
ObjectGuid _guid;
};

View File

@@ -67,6 +67,7 @@ TC_API_EXPORT EnumText EnumUtils<ChatNotify>::ToString(ChatNotify value)
case CHAT_NOT_IN_LFG_NOTICE: return { "CHAT_NOT_IN_LFG_NOTICE", "CHAT_NOT_IN_LFG_NOTICE", "+ \042[%s] You must be queued in looking for group before joining this channel.\042; -- The user must be in the looking for group system to join LFG chat channels." };
case CHAT_VOICE_ON_NOTICE: return { "CHAT_VOICE_ON_NOTICE", "CHAT_VOICE_ON_NOTICE", "+ \042[%s] Channel voice enabled by %s.\042;" };
case CHAT_VOICE_OFF_NOTICE: return { "CHAT_VOICE_OFF_NOTICE", "CHAT_VOICE_OFF_NOTICE", "+ \042[%s] Channel voice disabled by %s.\042;" };
case CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE: return { "CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE", "CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE", "same as CHAT_VOICE_ON_NOTICE but no chat mode change announcement" };
case CHAT_TRIAL_RESTRICTED: return { "CHAT_TRIAL_RESTRICTED", "CHAT_TRIAL_RESTRICTED", "+ \042[%s] Free Trial accounts cannot send messages to this channel. |cffffd000|Hstorecategory:gametime|h[Click To Upgrade]|h|r\042" };
case CHAT_NOT_ALLOWED_IN_CHANNEL: return { "CHAT_NOT_ALLOWED_IN_CHANNEL", "CHAT_NOT_ALLOWED_IN_CHANNEL", "+ \042That operation is not permitted in this channel.\042" };
default: throw std::out_of_range("value");
@@ -74,7 +75,7 @@ TC_API_EXPORT EnumText EnumUtils<ChatNotify>::ToString(ChatNotify value)
}
template <>
TC_API_EXPORT size_t EnumUtils<ChatNotify>::Count() { return 38; }
TC_API_EXPORT size_t EnumUtils<ChatNotify>::Count() { return 39; }
template <>
TC_API_EXPORT ChatNotify EnumUtils<ChatNotify>::FromIndex(size_t index)
@@ -117,8 +118,9 @@ TC_API_EXPORT ChatNotify EnumUtils<ChatNotify>::FromIndex(size_t index)
case 33: return CHAT_NOT_IN_LFG_NOTICE;
case 34: return CHAT_VOICE_ON_NOTICE;
case 35: return CHAT_VOICE_OFF_NOTICE;
case 36: return CHAT_TRIAL_RESTRICTED;
case 37: return CHAT_NOT_ALLOWED_IN_CHANNEL;
case 36: return CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE;
case 37: return CHAT_TRIAL_RESTRICTED;
case 38: return CHAT_NOT_ALLOWED_IN_CHANNEL;
default: throw std::out_of_range("index");
}
}
@@ -164,8 +166,9 @@ TC_API_EXPORT size_t EnumUtils<ChatNotify>::ToIndex(ChatNotify value)
case CHAT_NOT_IN_LFG_NOTICE: return 33;
case CHAT_VOICE_ON_NOTICE: return 34;
case CHAT_VOICE_OFF_NOTICE: return 35;
case CHAT_TRIAL_RESTRICTED: return 36;
case CHAT_NOT_ALLOWED_IN_CHANNEL: return 37;
case CHAT_VOICE_ON_NO_ANNOUNCE_NOTICE: return 36;
case CHAT_TRIAL_RESTRICTED: return 37;
case CHAT_NOT_ALLOWED_IN_CHANNEL: return 38;
default: throw std::out_of_range("value");
}
}

View File

@@ -58,12 +58,14 @@ TC_API_EXPORT EnumText EnumUtils<Races>::ToString(Races value)
case RACE_MECHAGNOME: return { "RACE_MECHAGNOME", "Mechagnome", "Mechagnome (RaceMask bit 14)" };
case RACE_DRACTHYR_ALLIANCE: return { "RACE_DRACTHYR_ALLIANCE", "Dracthyr", "Dracthyr (Alliance) (RaceMask bit 16)" };
case RACE_DRACTHYR_HORDE: return { "RACE_DRACTHYR_HORDE", "Dracthyr", "Dracthyr (Horde) (RaceMask bit 15)" };
case RACE_EARTHEN_DWARF_HORDE: return { "RACE_EARTHEN_DWARF_HORDE", "Earthen", "Earthen (Horde) (RaceMask bit 17)" };
case RACE_EARTHEN_DWARF_ALLIANCE: return { "RACE_EARTHEN_DWARF_ALLIANCE", "Earthen", "Earthen (Alliance) (RaceMask bit 18)" };
default: throw std::out_of_range("value");
}
}
template <>
TC_API_EXPORT size_t EnumUtils<Races>::Count() { return 27; }
TC_API_EXPORT size_t EnumUtils<Races>::Count() { return 29; }
template <>
TC_API_EXPORT Races EnumUtils<Races>::FromIndex(size_t index)
@@ -97,6 +99,8 @@ TC_API_EXPORT Races EnumUtils<Races>::FromIndex(size_t index)
case 24: return RACE_MECHAGNOME;
case 25: return RACE_DRACTHYR_ALLIANCE;
case 26: return RACE_DRACTHYR_HORDE;
case 27: return RACE_EARTHEN_DWARF_HORDE;
case 28: return RACE_EARTHEN_DWARF_ALLIANCE;
default: throw std::out_of_range("index");
}
}
@@ -133,6 +137,8 @@ TC_API_EXPORT size_t EnumUtils<Races>::ToIndex(Races value)
case RACE_MECHAGNOME: return 24;
case RACE_DRACTHYR_ALLIANCE: return 25;
case RACE_DRACTHYR_HORDE: return 26;
case RACE_EARTHEN_DWARF_HORDE: return 27;
case RACE_EARTHEN_DWARF_ALLIANCE: return 28;
default: throw std::out_of_range("value");
}
}