[Saylinks] Convert all GM Command Saylinks to Silent Saylinks. (#2373)

* [Saylinks] Convert all GM Command Saylinks to Silent Saylinks.
- This cleans up all non-silent GM Command Saylinks that we had before due to the way they worked before. All saylinks like this should be silent now.
- Add source short hand capability for say links with same link as text.

* Defaults to r anyway.

* Spacing.
This commit is contained in:
Kinglykrab
2022-08-13 20:40:22 -04:00
committed by GitHub
parent 597b041d92
commit 216b6ef426
33 changed files with 186 additions and 356 deletions
+13 -7
View File
@@ -590,25 +590,31 @@ inline void NPCCommandsMenu(Client* client, NPC* npc)
std::string menu_commands;
if (npc->GetGrid() > 0) {
menu_commands += "[" + Saylink::Create("#grid show", false, "Grid Points") + "] ";
menu_commands += "[" + Saylink::Silent("#grid show", "Grid Points") + "] ";
}
if (npc->GetEmoteID() > 0) {
std::string saylink = StringFormat("#emotesearch %u", npc->GetEmoteID());
menu_commands += "[" + Saylink::Create(saylink, false, "Emotes") + "] ";
menu_commands += "[" + Saylink::Silent(fmt::format("#emotesearch {}", npc->GetEmoteID()), "Emotes") + "] ";
}
if (npc->GetLoottableID() > 0) {
menu_commands += "[" + Saylink::Create("#npcloot show", false, "Loot") + "] ";
menu_commands += "[" + Saylink::Silent("#npcloot show", "Loot") + "] ";
}
if (npc->IsProximitySet()) {
menu_commands += "[" + Saylink::Create("#proximity show", false, "Proximity") + "] ";
menu_commands += "[" + Saylink::Silent("#proximity show", "Proximity") + "] ";
}
if (menu_commands.length() > 0) {
std::string dev_menu = "[" + Saylink::Create("#devtools", false, "DevTools") + "] ";;
client->Message(Chat::White, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str());
const auto& dev_menu = Saylink::Silent("#devtools", "DevTools");
client->Message(
Chat::White,
fmt::format(
"| [{}] [Show Commands] {}",
dev_menu,
menu_commands
).c_str()
);
}
}