diff --git a/Extension/Console/commands.cpp b/Extension/Console/commands.cpp index 53fa0532..9cfe5fe1 100644 --- a/Extension/Console/commands.cpp +++ b/Extension/Console/commands.cpp @@ -1,6 +1,8 @@ #include "commands.h" #include "Engine/Core/Log/logging.h" #include "Engine/Core/Platform/path_text.h" +#include "Engine/Game/Input/controller_bindings.h" +#include #include namespace dingosdk::console { @@ -231,6 +233,21 @@ const Commands &game_commands() { register_trainer_commands(*result); register_replay_keyframes_commands(*result); register_plugin_commands(*result); + // Each switch a player binds runs a command (controller_bindings.h action_binds): one whose + // command is gone reads "Unknown command" at every press, as "menu" once did. + for (const auto &bind : action_binds) { + bool found{}; + std::string name; + for (std::size_t at = 0; !found && at <= bind.command.size();) { + const auto end = std::min(bind.command.find(' ', at), bind.command.size()); + name = std::string(bind.command.substr(0, end)); + found = result->find(name) != nullptr; + at = end + 1; + } + if (!found) + logging::log(logging::Level::warning, logging::Channel::command, "The {} bind runs \"{}\", which is not a command.", + bind.name, bind.command); + } return result; }(); return *registry; diff --git a/Extension/Skater/console_commands.cpp b/Extension/Skater/console_commands.cpp index b3d21dd9..f7a724ad 100644 --- a/Extension/Skater/console_commands.cpp +++ b/Extension/Skater/console_commands.cpp @@ -295,6 +295,14 @@ void register_movement_commands(Commands ®istry) { }; registry.add(std::move(entry)); } + // What "bind reskatemenu" runs, for a player who cannot press the menu's key (no Insert key). + auto open_menu = action("menu", "Open the ReSkate menu (bind it to a controller combo or key: bind reskatemenu)", Group::console); + open_menu.inspect = [](const Model &) { return State{true, {}, {}, {}, false}; }; + open_menu.run = [](const Model &, const Values &, const Output &out) { + overlay::menu_open_flag().store(true); + out("Opening the ReSkate menu."); + }; + registry.add(std::move(open_menu)); } void register_ai_commands(Commands ®istry) { const auto ready = [](const Model &m) {