| 36 | { |
| 37 | public: |
| 38 | UnknownInputAction(std::string_view actionName, |
| 39 | const std::vector<std::string>& existingActions, DebugInfo info) |
| 40 | : Exception("UnknownInputAction", info) |
| 41 | { |
| 42 | this->error("InputAction named '{}' does not exists", actionName); |
| 43 | std::vector<std::string> suggestions |
| 44 | = Utils::String::sortByDistance(actionName.data(), existingActions, 5); |
| 45 | std::transform(suggestions.begin(), suggestions.end(), suggestions.begin(), |
| 46 | Utils::String::quote); |
| 47 | this->hint("Try one of the following InputAction : ({}...)", |
| 48 | fmt::join(suggestions, ", ")); |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | class UnknownInputButton : public Exception |