[Commands] Extend #devtools Functionality (#4425)

This commit is contained in:
Alex King
2024-07-22 21:44:34 -04:00
committed by GitHub
parent b6fb8daae8
commit 098498dedd
3 changed files with 30 additions and 8 deletions
+12 -4
View File
@@ -3,11 +3,19 @@
void command_devtools(Client *c, const Seperator *sep)
{
bool is_disable = !strcasecmp(sep->arg[1], "disable");
bool is_enable = !strcasecmp(sep->arg[1], "enable");
const uint16 arguments = sep->argnum;
if (arguments != 2) {
c->ShowDevToolsMenu();
return;
}
if (is_disable || is_enable) {
c->SetDevToolsEnabled(is_enable);
const std::string& type = sep->arg[1];
const bool toggle = Strings::ToBool(sep->arg[2]);
if (Strings::EqualFold(type, "menu")) {
c->SetDevToolsEnabled(toggle);
} else if (Strings::EqualFold(type, "window")) {
c->SetDisplayMobInfoWindow(toggle);
}
c->ShowDevToolsMenu();