[Dialogue Window / Saylinks] Missing Changes (#1574)

* Implement auto saylink injection

* Cover Lua say since it takes a different code path

* [Dialogue] Dialogue Window Middleware (#1526)

* Dialogue window quest dialogue work

* Add rest of DialogueWindow hooks

* Remove spacing
This commit is contained in:
Chris Miles
2021-10-01 22:09:21 -05:00
committed by GitHub
parent 0762ffa3dc
commit 3883adcefc
7 changed files with 107 additions and 13 deletions
+6 -2
View File
@@ -41,6 +41,7 @@ typedef const char Const_char;
#include "mob.h"
#include "client.h"
#include "../common/spdat.h"
#include "dialogue_window.h"
#ifdef BOTS
#include "bot.h"
@@ -2621,8 +2622,11 @@ XS(XS_Mob_Message) {
char *message = (char *) SvPV_nolen(ST(2));
VALIDATE_THIS_IS_MOB;
// auto inject saylinks
if (RuleB(Chat, AutoInjectSaylinksToClientMessage)) {
if (RuleB(Chat, QuestDialogueUsesDialogueWindow) && THIS->IsClient()) {
std::string window_markdown = message;
DialogueWindow::Render(THIS->CastToClient(), window_markdown);
}
else if (RuleB(Chat, AutoInjectSaylinksToClientMessage)) {
std::string new_message = EQ::SayLinkEngine::InjectSaylinksIfNotExist(message);
THIS->Message(type, new_message.c_str());
}