Allow name billboards to be toggled (#1026)

* Allow name billboards to be toggled

* Allow name billboards to be toggled

* Add comments

* Move logic to Character

* Use Entity in Character instead
This commit is contained in:
David Markowitz
2023-03-23 07:49:31 -07:00
committed by GitHub
parent 7671cc6865
commit b967cc57d1
8 changed files with 77 additions and 0 deletions

View File

@@ -171,6 +171,19 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
#endif
if (chatCommand == "togglenameplate" && (Game::config->GetValue("allownameplateoff") == "1" || entity->GetGMLevel() > GAME_MASTER_LEVEL_DEVELOPER)) {
auto* character = entity->GetCharacter();
if (character && character->GetBillboardVisible()) {
character->SetBillboardVisible(false);
ChatPackets::SendSystemMessage(sysAddr, u"Your nameplate has been turned off and is not visible to players currently in this zone.");
} else {
character->SetBillboardVisible(true);
ChatPackets::SendSystemMessage(sysAddr, u"Your nameplate is now on and visible to all players.");
}
return;
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//HANDLE ALL NON GM SLASH COMMANDS RIGHT HERE!
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!