public static void Execute(CommandQueue queue, CommandEntry entry) { Client TheClient = (entry.Command as GP_BindCommand).TheClient; string key = entry.GetArgument(queue, 0); if (!Enum.TryParse(key, true, out GamePadButton btn)) { queue.HandleError(entry, "Unknown button: " + key); return; } if (entry.Arguments.Count == 1) { CommandScript cs = TheClient.Gamepad.ButtonBinds[(int)btn]; if (cs == null) { queue.HandleError(entry, "That button is not bound, or does not exist."); } else { entry.InfoOutput(queue, btn + ": {\n" + cs.FullString() + "}"); } } else if (entry.Arguments.Count >= 2) { TheClient.Gamepad.BindButton(btn, entry.GetArgument(queue, 1)); entry.GoodOutput(queue, "Keybind updated for " + btn + "."); } }
/// <summary>Executes the command.</summary> /// <param name="queue">The command queue involved.</param> /// <param name="entry">Entry to be executed.</param> public static void Execute(CommandQueue queue, CommandEntry entry) { string args = entry.GetArgument(queue, 0); entry.InfoOutput(queue, args); }