This commit is contained in:
aozhiwei 2024-03-29 16:18:17 +08:00
parent 41b3485be1
commit b554d706c9

View File

@ -1,5 +1,7 @@
#include "precompile.h"
#include <a8/magicenum.h>
#include "mt/InGameVoice.h"
IMPL_TABLE(mt::InGameVoice)
@ -9,8 +11,39 @@ int mt::InGameVoice::series_kill_interval = 0;
namespace mt
{
static InGameVoiceNotifyObject_e ParseNotifyObject(const std::string& type)
{
if (type == "global") {
return InGameVoiceNotifyObject_e::kGlobal;
} else if (type == "killer") {
return InGameVoiceNotifyObject_e::kKiller;
} else if (type == "!killer") {
return InGameVoiceNotifyObject_e::kNoKiller;
} else if (type == "killer_team") {
return InGameVoiceNotifyObject_e::kKillerTeam;
} else if (type == "!killer_team") {
return InGameVoiceNotifyObject_e::kNoKillerTeam;
} else if (type == "dead") {
return InGameVoiceNotifyObject_e::kDead;
} else if (type == "!dead") {
return InGameVoiceNotifyObject_e::kNoDead;
} else if (type == "dead_team") {
return InGameVoiceNotifyObject_e::kDeadTeam;
} else if (type == "!dead_team") {
return InGameVoiceNotifyObject_e::kNoDeadTeam;
} else if (type == "teammate_exclude_dead") {
return InGameVoiceNotifyObject_e::kTeammateExcludeDead;
} else {
A8_ABORT();
}
}
void InGameVoice::Init1()
{
if (a8::GetEnumName<InGameVoiceEventType_e>(event_type()).empty()) {
A8_ABORT();
}
_notify_object = ParseNotifyObject(notify_object());
}
void InGameVoice::Init2()