Move SendCommandHelpWindow to SendBotCommandHelpWindow and simplify

This commit is contained in:
nytmyr
2025-01-22 15:11:13 -06:00
parent 2301b91e77
commit e9d809301c
39 changed files with 620 additions and 1428 deletions
+10 -37
View File
@@ -97,25 +97,17 @@ void bot_command_pet_remove(Client *c, const Seperator *sep)
void bot_command_pet_set_type(Client *c, const Seperator *sep)
{
if (helper_command_alias_fail(c, "bot_command_pet_set_type", sep->arg[0], "petsettype")) {
c->Message(Chat::White, "note: Allows you to change the type of pet Magician bots will cast.");
return;
}
if (helper_is_help_or_usage(sep->arg[1])) {
std::vector<std::string> description =
{
"Allows you to change the type of pet Magician bots will cast"
};
BotCommandHelpParams p;
std::vector<std::string> notes = {};
std::vector<std::string> example_format =
{
fmt::format(
"{} [current | water | fire | air | earth | monster | epic] [actionable, default: target]"
, sep->arg[0]
)
};
std::vector<std::string> examples_one =
p.description = { "Allows you to change the type of pet Magician bots will cast." };
p.example_format = { fmt::format("{} [current | water | fire | air | earth | monster | epic] [actionable, default: target]", sep->arg[0]) };
p.examples_one =
{
"To set all spawned bots to use Water pets:",
fmt::format(
@@ -123,7 +115,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
sep->arg[0]
)
};
std::vector<std::string> examples_two =
p.examples_two =
{
"To set Magelulz to use Fire pets:",
fmt::format(
@@ -131,7 +123,7 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
sep->arg[0]
)
};
std::vector<std::string> examples_three =
p.examples_three =
{
"To check the current pet type for all bots:",
fmt::format(
@@ -139,28 +131,9 @@ void bot_command_pet_set_type(Client *c, const Seperator *sep)
sep->arg[0]
)
};
p.actionables = { "target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned" };
std::vector<std::string> actionables =
{
"target, byname, ownergroup, ownerraid, targetgroup, namesgroup, healrotationtargets, mmr, byclass, byrace, spawned"
};
std::vector<std::string> options = { };
std::vector<std::string> options_one = { };
std::vector<std::string> options_two = { };
std::vector<std::string> options_three = { };
std::string popup_text = c->SendCommandHelpWindow(
c,
description,
notes,
example_format,
examples_one, examples_two, examples_three,
actionables,
options,
options_one, options_two, options_three
);
std::string popup_text = c->SendBotCommandHelpWindow(p);
popup_text = DialogueWindow::Table(popup_text);
c->SendPopupToClient(sep->arg[0], popup_text.c_str());