| 12960 | } |
| 12961 | |
| 12962 | std::string Client::SendBotCommandHelpWindow(const BotCommandHelpParams& params) { |
| 12963 | unsigned string_length = 0; |
| 12964 | unsigned current_place = 0; |
| 12965 | uint16 max_length = RuleI(Command, MaxHelpLineLength); // Line length before splitting |
| 12966 | const std::string& header_color = "indian_red"; |
| 12967 | const std::string& description_color = "light_grey"; |
| 12968 | const std::string& description_color_secondary = "dark_orange"; |
| 12969 | const std::string& example_color = "goldenrod"; |
| 12970 | const std::string& example_color_secondary = "slate_blue"; |
| 12971 | const std::string& option_color = "light_grey"; |
| 12972 | const std::string& option_color_secondary = "slate_blue"; |
| 12973 | const std::string& filler_line_color = "dark_grey"; |
| 12974 | |
| 12975 | std::string filler_line = "--------------------------------------------------------------------"; |
| 12976 | std::string filler_dia = DialogueWindow::TableRow(DialogueWindow::TableCell(fmt::format("{}", DialogueWindow::ColorMessage(filler_line_color, filler_line)))); |
| 12977 | std::string break_line = DialogueWindow::Break(); |
| 12978 | std::string popup_text; |
| 12979 | |
| 12980 | if (!params.description.empty()) { |
| 12981 | popup_text += GetCommandHelpHeader("[Description]", header_color); |
| 12982 | popup_text += SplitCommandHelpText(params.description, description_color, max_length); |
| 12983 | } |
| 12984 | |
| 12985 | if (!params.notes.empty()) { |
| 12986 | popup_text += break_line + break_line; |
| 12987 | popup_text += GetCommandHelpHeader("[Notes]", header_color); |
| 12988 | popup_text += SplitCommandHelpText(params.notes, description_color_secondary, max_length); |
| 12989 | } |
| 12990 | |
| 12991 | if (!params.example_format.empty()) { |
| 12992 | popup_text += filler_dia; |
| 12993 | popup_text += GetCommandHelpHeader("[Examples]", header_color); |
| 12994 | popup_text += SplitCommandHelpText(params.example_format, example_color, max_length); |
| 12995 | } |
| 12996 | |
| 12997 | if (!params.examples_one.empty()) { |
| 12998 | popup_text += break_line + break_line; |
| 12999 | popup_text += SplitCommandHelpText(params.examples_one, example_color, max_length, example_color_secondary); |
| 13000 | } |
| 13001 | |
| 13002 | if (!params.examples_two.empty()) { |
| 13003 | popup_text += SplitCommandHelpText(params.examples_two, example_color, max_length, example_color_secondary); |
| 13004 | } |
| 13005 | |
| 13006 | if (!params.examples_three.empty()) { |
| 13007 | popup_text += SplitCommandHelpText(params.examples_three, example_color, max_length, example_color_secondary); |
| 13008 | } |
| 13009 | |
| 13010 | if (!params.options.empty()) { |
| 13011 | popup_text += filler_dia; |
| 13012 | popup_text += GetCommandHelpHeader("[Options]", header_color); |
| 13013 | popup_text += SplitCommandHelpText(params.options, option_color, max_length); |
| 13014 | } |
| 13015 | |
| 13016 | if (!params.options_one.empty()) { |
| 13017 | popup_text += break_line + break_line; |
| 13018 | popup_text += SplitCommandHelpText(params.options_one, option_color_secondary, max_length); |
| 13019 | } |
no test coverage detected