[Bots] Command add fix for spelltypeids/spelltypenames (#5074)
Some checks are pending
Build / Linux (push) Waiting to run
Build / Windows (push) Waiting to run

This commit is contained in:
nytmyr 2026-04-29 01:59:19 -05:00 committed by GitHub
parent c6ddf300a4
commit 85c3255568
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -775,7 +775,7 @@ void helper_send_usage_required_bots(Client *bot_owner, uint16 spell_type)
bot_owner->Message(Chat::Green, "%s", description.c_str());
}
void SendSpellTypeWindow(Client* c, const Seperator* sep) {
void SendSpellTypeWindow(Client* c, const Seperator* sep, bool short_names) {
std::string arg0 = sep->arg[0];
std::string arg1 = sep->arg[1];
@ -828,7 +828,7 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
std::string popup_text = DialogueWindow::TableRow(
DialogueWindow::TableCell(DialogueWindow::ColorMessage(goldenrod, spell_type_field))
+
DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(goldenrod, id_field) : DialogueWindow::ColorMessage(goldenrod, shortname_field)))
DialogueWindow::TableCell((!short_names ? DialogueWindow::ColorMessage(goldenrod, id_field) : DialogueWindow::ColorMessage(goldenrod, shortname_field)))
);
popup_text += DialogueWindow::TableRow(
@ -845,7 +845,7 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
popup_text += DialogueWindow::TableRow(
DialogueWindow::TableCell(DialogueWindow::ColorMessage(forest_green, Bot::GetSpellTypeNameByID(i)))
+
DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, Bot::GetSpellTypeShortNameByID(i))))
DialogueWindow::TableCell((!short_names ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, Bot::GetSpellTypeShortNameByID(i))))
);
}

View File

@ -1182,4 +1182,4 @@ bool helper_is_help_or_usage(const char* arg);
bool helper_no_available_bots(Client *bot_owner, Bot *my_bot = nullptr);
void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, std::vector<const char*> subcommand_list);
void helper_send_usage_required_bots(Client *bot_owner, uint16 spell_type);
void SendSpellTypeWindow(Client* c, const Seperator* sep);
void SendSpellTypeWindow(Client* c, const Seperator* sep, bool short_names = false);

View File

@ -24,5 +24,5 @@ void bot_command_spelltype_ids(Client* c, const Seperator* sep)
void bot_command_spelltype_names(Client* c, const Seperator* sep)
{
SendSpellTypeWindow(c, sep);
SendSpellTypeWindow(c, sep, true);
}